Uh oh!
There was an error while loading. Please reload this page.
sdk: Expose disabled MCP servers across languages - #2260
Open
connor4312 wants to merge 3 commits into
Open
Conversation
Allow callers to disable exact MCP server names per session on create and resume without mutating global settings. Cover all SDK wire mappings and verify plugin and built-in GitHub MCP servers stay stopped on the first message. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds session-scoped disabled MCP server configuration across all six SDKs without modifying global settings.
Changes:
- Exposes and forwards disabled server names during create and resume.
- Adds serialization, cloning, and E2E coverage.
- Documents cross-language configuration names and behavior.
Show a summary per file
| File | Description |
|---|---|
test/harness/test-mcp-server.mjs | Adds configurable server names and startup markers. |
test/harness/replayingCapiProxy.ts | Adds a hermetic /mcp transport mock. |
rust/src/wire.rs | Adds create and resume wire fields. |
rust/src/types.rs | Adds Rust configuration APIs and tests. |
python/test_client.py | Tests Python forwarding and omission semantics. |
python/copilot/client.py | Adds Python create and resume options. |
nodejs/test/e2e/disabled_mcp_servers.e2e.test.ts | Tests create, built-in, and cold-resume behavior. |
nodejs/test/client.test.ts | Tests Node.js request forwarding. |
nodejs/src/types.ts | Defines the Node.js public option. |
nodejs/src/client.ts | Forwards the Node.js option. |
java/src/test/java/com/github/copilot/SessionRequestBuilderTest.java | Tests Java request serialization. |
java/src/test/java/com/github/copilot/ConfigCloneTest.java | Tests Java configuration cloning. |
java/src/main/java/com/github/copilot/SessionRequestBuilder.java | Copies configuration into requests. |
java/src/main/java/com/github/copilot/rpc/SessionConfig.java | Adds Java create-session configuration. |
java/src/main/java/com/github/copilot/rpc/ResumeSessionRequest.java | Adds the Java resume wire field. |
java/src/main/java/com/github/copilot/rpc/ResumeSessionConfig.java | Adds Java resume configuration. |
java/src/main/java/com/github/copilot/rpc/CreateSessionRequest.java | Adds the Java create wire field. |
go/types.go | Adds Go public and wire fields. |
go/client.go | Preserves nil versus empty Go lists. |
go/client_test.go | Tests Go serialization semantics. |
dotnet/test/Unit/SerializationTests.cs | Tests .NET wire serialization. |
dotnet/test/Unit/CloneTests.cs | Tests .NET collection cloning. |
dotnet/src/Types.cs | Adds the .NET public property. |
dotnet/src/Client.cs | Forwards the .NET property. |
docs/features/mcp.md | Documents session-scoped disabling. |
Review details
- Files reviewed: 25/25 changed files
- Comments generated: 1
- Review effort level: Balanced
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Review details
Suppressed comments (1)
nodejs/test/e2e/disabled_mcp_servers.e2e.test.ts:439
- This cold-resume test uses the global 30-second Vitest timeout, even though both polling helpers below allow up to 60 seconds and the test starts two runtimes. On slower CI hosts, Vitest can abort a valid run before those waits complete. Give this test the same explicit extended timeout as the two preceding MCP tests.
"applies disabled plugin MCP servers on cold stdio resume",
async () => {
- Files reviewed: 25/25 changed files
- Comments generated: 0 new
- Review effort level: Balanced
Format the disabled MCP server accessors and Javadocs exactly as required by the Java CI Spotless check. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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 freeto 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.
Why
SDK consumers can supply MCP servers and plugin directories per session, but cannot currently prevent a discovered server from starting before the first turn. The global
disabledMcpServerssetting avoids startup but persists user state and has the wrong scope.This addresses https://github.com/github/copilot-mcp-core/issues/2056.
Companion runtime contract PR: https://github.com/github/copilot-agent-runtime/pull/14727
What
Expose session-scoped disabled MCP server names on create and resume across all six SDKs:
disabledMcpServersdisabled_mcp_serversDisabledMCPServersDisabledMcpServerssetDisabledMcpServers(...)with_disabled_mcp_servers(...)The exact names are forwarded as
disabledMcpServerswithout writing global settings. Omission preserves existing behavior; Python and Go also preserve an explicitly empty list.The Node E2E coverage uses real plugin-provided stdio servers and the built-in
github-mcp-serverto prove:/mcprequest;connected;Testing
Release note
The option is backward-compatible and targets the existing legacy
session.create/session.resumewire field. After the runtime contract PR is released, SDK codegen can be refreshed to expose the same field through generatedsessions.openoptions.