Skip to content

[FEAT]: Support MCP servers #17

Description

@QuinnBast

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_jira MCP 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 session

SDK Version

No response

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. QuinnBast commented on Mar 25, 2026

    @QuinnBast
    Author

    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.json file. I have mine at ~/.copilot/mcp-config.json, and this works for the copilot CLI, 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.

  2. edburns commented on Mar 25, 2026

    @edburns
    Collaborator

    The issue has two distinct requests (from @QuinnBast):

    1. Primary pain point: "I tried getting the Copilot to call Jira MCP, but it kept complaining that it didn't have access to search_jira MCP 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.

    2. 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_loaded Yes
    Event: session.mcp_server_status_changed Yes
    listMcpServers() Yes
    enableMcpServer() / disableMcpServer() Yes
    reloadMcpServers() Yes
    McpServerInfo DTO Yes

    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 via SessionRequestBuilder. 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 the Map<String, Object> and call setMcpServers() — 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.json at 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.
  3. edburns commented on Mar 25, 2026

    @edburns
    Collaborator

    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:

    1. SessionConfig.McpServers is a Dictionary<string, object>? that the user must manually populate.
    2. At session creation, Client.cs simply forwards config.McpServers into the CreateSessionRequest JSON-RPC call (line 496).
    3. There is no auto-discovery of ~/.copilot/mcp-config.json or any other config file — no code in either the .NET or Java SDK reads MCP configuration from disk.
    4. 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.
    5. 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.json itself, but when invoked via JSON-RPC from any SDK, MCP server configs must be explicitly passed by the caller. Neither SDK bridges that gap.

  4. edburns commented on Mar 25, 2026

    @edburns
    Collaborator

    Hello @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.

  5. QuinnBast commented on Mar 25, 2026

    @QuinnBast
    Author

    Thanks 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions