Fix #286: plugin MCP servers join the config lookup/merge#318
Open
ericleepi314 wants to merge 1 commit into
Open
Fix #286: plugin MCP servers join the config lookup/merge#318ericleepi314 wants to merge 1 commit into
ericleepi314 wants to merge 1 commit into
Conversation
The plugin-scope loader returned {} unconditionally — plugin-provided
MCP servers were invisible to the config aggregation (no per-name
lookup, no merge-driven listings, no scope-policy filtering).
- McpPluginWrapper gains server_config (set at registration via the
new wrap_mcp_server_as_plugin kwarg; None keeps legacy tools-only
registrations invisible, unchanged)
- get_managed_mcp_configs reads the wrapper registry and returns
managed-scope entries with plugin_source attribution; the
consumption side (aggregator merge, by-name lookup,
allow_managed_only_mcp policy) was already wired
- dedup_plugin_mcp_servers (previously unit-tested but never called)
wired into the aggregator: a plugin server whose launch signature
duplicates an ENABLED manual entry is suppressed with a notice
(disabled manual twins don't suppress — the claudeai carve-out)
- get_mcp_config_by_name honors the enterprise-lockdown short-circuit
(all scopes): with a managed-mcp.json present, by-name no longer
hands out configs the merge excluded
Known follow-up: manifest-declared mcp_servers parsed by
src/plugins/loader.py never register wrappers, so those remain
invisible until a loader-to-registry bridge lands.
Closes #286
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Closes #286
Summary
The plugin-scope loader (
get_managed_mcp_configs) returned{}unconditionally — any MCP server shipped by a plugin was invisible to the config aggregation layer: no per-name lookup, no merge-driven/mcplistings, no scope-policy filtering.McpPluginWrapper.server_config(the issue's fix sketch): set at registration via the newwrap_mcp_server_as_plugin(..., server_config=...)kwarg.None(all existing callers) keeps legacy tools-only registrations invisible — bit-identical behavior.LoadedPlugin.mcp_serversnow reflects the real transport type instead of hardcodedstdio.ScopedMcpServerConfig(scope="managed", plugin_source=<plugin name>). Scope"managed"(not the sketch's"plugin") matches the existingConfigScopeand theallow_managed_only_mcppolicy tuple — the consumption side (aggregator merge at lowest precedence, by-name lookup, policy filter) was already wired and engages immediately.dedup_plugin_mcp_serverswired in (existed with unit tests, zero callers): a plugin server whose launch signature duplicates an enabled manual entry under a different name is suppressed with a warning notice. Disabled manual twins don't suppress (the claudeai-dedup carve-out — otherwise disabling the manual copy would leave zero working servers; critic-found).managed-mcp.jsonpresent,get_mcp_config_by_namenow restricts to enterprise scope, matching the aggregate — previously it was a side door handing reconnect/OAuth flows configs the merge excluded (newly reachable for managed; latent for dynamic since before).Known follow-ups (out of scope, noted per review)
mcp_serversparsed bysrc/plugins/loader.pynever registerMcpPluginWrappers — those stay invisible until a loader→registry bridge lands.filter_mcp_servers_by_policy(pre-existing class, strictly narrower after this PR).Test plan
allow_managed_only_mcpkeeps plugin servers; enterprise lockdown by-name. Hermetic fixture isolatesCLAUDE_CONFIG_DIR/CLAUDE_MANAGED_CONFIG_DIRand clears the process-wide enterprise-exists latch (these are the suite's first end-to-endget_all_mcp_configstests).🤖 Generated with Claude Code