Skip to content

feat: per-target MCP config overrides + plugin-root files#11

Draft
eshwar-sundar-glean wants to merge 1 commit into
mainfrom
eshwar/per-target-mcp-and-plugin-root-files
Draft

feat: per-target MCP config overrides + plugin-root files#11
eshwar-sundar-glean wants to merge 1 commit into
mainfrom
eshwar/per-target-mcp-and-plugin-root-files

Conversation

@eshwar-sundar-glean

Copy link
Copy Markdown

Summary

Adds two capabilities pluginpack needs to host the glean-vnext runtime MCP server as a source plugin:

  1. Per-target MCP config overridereadMcpServers(target) applies resolveTargetOverride to .mcp.json, so a source plugin can ship targets/<target>/.mcp.json that fully replaces the base config for that target (e.g. codex uses ./start.mjs + cwd instead of ${CLAUDE_PLUGIN_ROOT}/start.mjs).
  2. Plugin-root filesplugin.pluginpack.json accepts a files: { [dest]: source } map copied to the emitted plugin root (covers dist/index.js, start.mjs, package.json in one feature). Supports target overrides on source paths; guards against collisions, unsafe paths, and missing sources.

Why

The glean-vnext plugin is a local stdio MCP server (bundled runtime + launcher) that can't be expressed with the current pluginpack model (no arbitrary plugin-root files; no way to vary the MCP invocation per target). These features let vnext live as a normal source plugin under sources/glean-vnext/ and be folded into the existing glean emitted plugin.

Tests

npm run test:all green: format:check, lint, typecheck, 32 tests, build, docs. 4 new tests cover per-target MCP override, plugin-root files (with target override + managed-manifest tracking), collision guard, and missing-source guard.

Consumer

Depended on by gleanwork/agent-plugins eshwar/glean-vnext-fold-into-glean (draft PR #3). agent-plugins must bump to @gleanwork/pluginpack@^0.8.0 once this is published.

Two capabilities that let a source plugin ship a runtime MCP server
(e.g. a bundled stdio server + launcher) into the pluginpack model:

1. Per-target MCP config override: thread  through
   SourceProvider.readMcpServers and resolveMcpServers so a
   targets/<host>/.mcp.json file overrides the base .mcp.json content
   for that host. Lets one source ship different server definitions per
   app (e.g. ${CLAUDE_PLUGIN_ROOT}/start.mjs for Claude vs
   cwd: "." + ./start.mjs for Codex). The manifest (mcpServers in
   plugin.pluginpack.json) form has no per-file override.

2. Plugin-root files: a source plugin declares arbitrary files in
   plugin.pluginpack.json (: { dest -> source }) emitted verbatim
   at the plugin root — e.g. dist/index.js, start.mjs, package.json.
   Files are tracked as managed output and support target overrides on
   the source path; a destination colliding with a component/static
   file, or a missing source, is an error. pluginpack still does not
   build bundles — produce build output before pluginpack build.

Tests, typecheck, lint, format, and docs all green (npm run test:all).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant