Repository navigation
[FEAT]: Support MCP servers #17
Description
Activity
- linked a pull request that will close this issueAdd MCP server support: events and session management methods #29
on Mar 25, 2026 I see a new MR has been created, that is awesome and I'm eager to try it out!
But does this MR actually get the copilot agent to use the user's MCPs? It adds support to the SDK that lets the user view and query current MCP status, but does it actually get the agent that gets created to use the user's MCP configuration file? I think the issue here is that the agent that the SDK creates when it creates new sessions, for whatever reason, doesn't know how to find the user's
mcp.jsonfile. I have mine at~/.copilot/mcp-config.json, and this works for thecopilotCLI, but if I talk to copilot through the SDK it can't use any of the MCP tools. So I think there's a bigger issue at play here with how Copilot sessions are being created through the SDK.The issue has two distinct requests (from @QuinnBast):
-
Primary pain point: "I tried getting the Copilot to call Jira MCP, but it kept complaining that it didn't have access to
search_jiraMCP tools, even though these tools are available in my IDE." — The agent created via the SDK doesn't discover/load the user's MCP configuration (e.g.~/.copilot/mcp-config.json). Sessions created through the SDK can't use MCP tools at all. -
Secondary request: "It would also be nice to be able to view connected MCPs and list available tools through the
session" — An observability/management API for MCP servers.
What PR #29 Delivers
The PR addresses only the secondary request — runtime observability and management:
Capability Delivered? Event: session.mcp_servers_loadedYes Event: session.mcp_server_status_changedYes listMcpServers()Yes enableMcpServer()/disableMcpServer()Yes reloadMcpServers()Yes McpServerInfoDTOYes What PR #29 Does NOT Deliver
The core problem remains unsolved. The SDK already has
SessionConfig.setMcpServers(Map)which gets forwarded to the session creation request viaSessionRequestBuilder. But:- There's no mechanism for the SDK to auto-discover the user's
~/.copilot/mcp-config.json(or wherever it lives) and pass those MCP server configs into the session. The user must manually construct theMap<String, Object>and callsetMcpServers()— and the format for that map isn't documented. - There's no documentation or example showing how to configure MCP servers with
SessionConfig.setMcpServers(). - If the Copilot CLI process itself discovers
mcp-config.jsonat startup (server-side), the PR doesn't change that behavior either.
Verdict
As @QuinnBast correctly noted in both the issue comment and PR comment: This PR adds the management/observability plumbing but doesn't solve the root problem — that sessions created through the SDK don't load the user's MCP tools. The new APIs (list, enable, disable, reload) are useful but moot if no MCP servers get loaded in the first place.
The PR would more accurately be described as "partial progress toward #17" rather than a fix. The missing piece is either:
- Auto-discovery of MCP config files (client-side), or
- Documentation/examples for how to populate
SessionConfig.setMcpServers(), or - Confirmation that this is a server-side (Copilot CLI) concern, not an SDK concern.
-
Is the problem identified by issue #17 also present in the .NET implementation?
Yes, the same problem exists in the .NET implementation. The architecture is identical across both SDKs:
SessionConfig.McpServersis aDictionary<string, object>?that the user must manually populate.- At session creation, Client.cs simply forwards
config.McpServersinto theCreateSessionRequestJSON-RPC call (line 496). - There is no auto-discovery of
~/.copilot/mcp-config.jsonor any other config file — no code in either the .NET or Java SDK reads MCP configuration from disk. - Both SDKs have the same management APIs (
session.mcp.list,session.mcp.enable,session.mcp.disable,session.mcp.reload), and the .NET ones are generated code in Rpc.cs. - The .NET README.md mentions MCP only in the context of permission request types (
"mcp"tool kind) — there's no documentation on how to configure MCP servers.
This means the issue reporter's core complaint — that the SDK-created agent can't find the user's MCP tools even though the CLI can — is a cross-SDK architectural gap, not a Java-specific bug. The Copilot CLI in standalone mode presumably discovers
~/.copilot/mcp-config.jsonitself, but when invoked via JSON-RPC from any SDK, MCP server configs must be explicitly passed by the caller. Neither SDK bridges that gap.Reacted by Quinn BastHello @QuinnBast , thanks for your interest and support.
Given that SDK tracks the reference implementation GitHub Copilot SDKs for .NET and nodejs, and that the reference implementation also does not support this feature, the right way to go about this is to open an issue on https://github.com/github/copilot-sdk and reference this one.
I will mark this closed for now and we can either re-open it or create a new one when the source of truth has implemented the feature.
Reacted by Quinn BastThanks for the reply! I left a comment there as well as found a workaround (which seems to be just call
.setMcpServers()yourself and point it to the default MCP config file and load it into a JSON object manually.However, I think PR #29 is still relevant though. I believe that the features being added in #29 (listing MCP servers, enabling and disabling them, and reloading) are features that .NET has implemented that Java does not (though I could be wrong).
https://github.com/github/copilot-sdk/blob/main/docs/features/mcp.md
https://github.com/github/copilot-sdk/blob/main/dotnet/src/Generated/Rpc.cs#L723
Describe the need
Currently this implementation does not support MCP servers, it can only do basic tool calls. This is a feature request to add support for MCP tools to the SDK.
I tried getting the Copilot to call Jira MCP, but it kept complaining that it didn't have access to
search_jiraMCP tools, even though these tools are available in my IDE.It would also be nice to be able to view connected MCPs and list available tools through the
sessionSDK Version
No response
Relevant log output
Code of Conduct