Repository navigation
feat(mcp): let agents manage shared MCP servers - #428
Merged
Merged
Conversation
shuv1337
marked this pull request as ready for review
November 10, 2026 00:16
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.
Problem
Agents can use shared MCP servers but cannot manage them without editing harness configuration or using the settings UI.
Change
Add
t3_mcp_server_list,t3_mcp_server_set,t3_mcp_server_remove, andt3_mcp_server_test, all withenvironmentIdpeer forwarding. List/set expose only public metadata,hasToken, andshared-<id>. Writes use the existing settings service; testing usesSharedMcpServers.test.All four require orchestration capability and a live full-access/default thread or a full-access MCP client. Read-only, supervised, plan-mode, inactive, narrowed and restricted-link callers cannot manage the settings. Writes recheck after acquiring the caller's command lock.
Tokens enter only through a one-use
request_secretreference, consumed with its project scope. Secret refs are destination-host-local: for a forwarded token update, first request the secret in a thread on that host and pass its destinationprojectId.Review fixes
providers:manageguards UI/WebSocket clients; full-access orchestrator callers may manage shared MCP servers through these tools. Updated the contract comment and user guidance.bearerToken, through strict MCP validation and service decoding.SECRET_REDACTED, not the plaintext saved token. The real settings service preserves or clears it, including clearing on URL changes.label: nullclears the label; removing an unknown id fails with the management service'snot_foundreason.Context budget
Measured with
AgentContextBudget.test.tsagainst main30e776dc26:The final budget is 71 bytes smaller than the pre-review PR (50,161 bytes). It includes the nullable-label schema change. No unrelated tool descriptions were cut.
This still exceeds main's ceiling; the context-budget growth check requires maintainer approval via
agent-context-increase. No label was added.Eval results
Live runs were attempted for
shared-mcp.ndjsonon both supported backends:~/.codex/config.tomlhas nomodel_providers.vibeproxy; the proxy loader exits withKeyError: 'model_providers'. A CLIProxyAPI endpoint configured under that name, with working authentication, is required. The existing Codex subscription/OAuth login is not an input this eval harness supports; no OpenAI API key is configured there.ANTHROPIC_API_KEYis absent from the environment and there is no worktree-root.env. The harness explicitly does not useANTHROPIC_AUTH_TOKENorANTHROPIC_BASE_URL.No live samples ran; no live pass rate is claimed. Codex-format dry runs successfully built 3 shared-MCP cases and 27 secrets cases. The existing eval-auth papercut is
pc_5f1425cca2cf.Verification
vp run check:changed: passed format, lint, both knip checks, GraphQL, all 37 affected-package typechecks, and 545 selected tests.git diff --check: passed.Model: GPT-6 Astra. Harness: Pi (shuvpi).