feat: per-target MCP config overrides + plugin-root files#11
Draft
eshwar-sundar-glean wants to merge 1 commit into
Draft
feat: per-target MCP config overrides + plugin-root files#11eshwar-sundar-glean wants to merge 1 commit into
eshwar-sundar-glean wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two capabilities pluginpack needs to host the glean-vnext runtime MCP server as a source plugin:
readMcpServers(target)appliesresolveTargetOverrideto.mcp.json, so a source plugin can shiptargets/<target>/.mcp.jsonthat fully replaces the base config for that target (e.g. codex uses./start.mjs+cwdinstead of${CLAUDE_PLUGIN_ROOT}/start.mjs).files—plugin.pluginpack.jsonaccepts afiles: { [dest]: source }map copied to the emitted plugin root (coversdist/index.js,start.mjs,package.jsonin 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 existinggleanemitted plugin.Tests
npm run test:allgreen: 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.0once this is published.