In short.
This GitHub guide explains how developers can connect Copilot SDK applications to external tools, but several features depend on matching SDK and runtime releases. It documents local and remote connections, tool restrictions, server lifecycle, prompt retrieval, OAuth and diagnostics. Particularly useful details explain why a connected server can still use old configuration, why authentication recovery does not prove tool success, and why sandbox policy must be applied before startup. Exact minimum releases, costs and licensing terms are unknown from this page. No examples were executed; reliability and performance are not assessed.
Researched and written by an AI model and checked by a second AI model. How it works
The scope is the complete supplied documentation page at [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-sdk/features/mcp]. Coverage includes configuration examples, lifecycle and inventory contracts, per-session disabling, prompt operations, startup sandbox policy, tool restrictions, OAuth ownership and recovery, diagnostics, troubleshooting and related feature notices. Linked specifications, issues, package pages, repositories and other guides are excluded. No examples or runtime behavior were executed or independently verified. Exact release requirements, costs, licensing terms and operational performance remain unknown.
The overview
Identity
Using MCP servers with the GitHub Copilot SDK is a GitHub documentation guide about connecting Copilot-powered applications to external tools and data through Model Context Protocol. The selected source is the complete page at [https://docs.github.com/api/article/body?pathname=/en/copilot/how-tos/copilot-sdk/features/mcp].
The resource teaches an SDK feature through configuration examples and API explanations. The capabilities available to an application depend on the MCP servers it connects to.
Assessment
The guide is useful for developers who need both an initial connection example and precise explanations of what the runtime guarantees. Its strongest material concerns boundaries that applications can otherwise misinterpret: configuration versus live state, authentication acceptance versus completed recovery, and policy configuration versus protection from the first process.
Adoption requires attention to release compatibility. The inventory lifecycle contract is experimental, and the page says the SDK and runtime must be aligned. It also explains that the overall protocol version does not identify individual feature revisions. No exact compatible release pair or minimum runtime release is supplied, so compatibility with a particular installation remains unknown.
Users
The intended readers are developers building Copilot SDK applications that need local scripts, filesystem access, database queries or external APIs. Developers operating shared services will also find material on remote authentication, callbacks, lifecycle observations and troubleshooting.
Configuration examples cover Node.js/TypeScript, Python, Go and .NET. Selected API tables also cover Java and Rust; equivalent end-to-end examples are not provided for every language. Beginners can follow the filesystem example, although SDK installation, account access and a full introduction to authentication are not established by this page.
Capabilities
The SDK supports local servers communicating through standard input and output, and remote servers accessed through HTTP or SSE. Local configuration includes a command, arguments and optional environment variables, working directory and timeout. Remote configuration includes a URL and optional headers, OAuth settings and timeout.
Tool access can allow every tool with ["*"], allow specific tool names, or disable all tools with []. The per-session disabledMcpServers setting matches exact server names and does not change global configuration. On creation and cold resume, disabled servers are neither started nor taken through runtime-initiated authentication.
Additional APIs expose configured servers and lifecycle state, targeted startup and restart, server-provided prompt discovery and retrieval, OAuth operations and session-scoped diagnostics. Prompt listing and retrieval each address one connected server; they do not aggregate results across servers.
Using it
Requirements
Applications need compatible SDK and runtime releases, plus the dependencies required by their chosen servers. A local server needs an executable command and arguments. A remote server needs a reachable endpoint and any required credentials or authorization. The page does not establish installation prerequisites, subscription entitlements or model availability.
Startup sandboxing requires a supporting runtime release. The guide directs applications to inspect the runtime version returned by server.connect; the SDK protocol version is insufficient as a feature signal. The minimum supporting version is unspecified.
Runtime-managed hosted OAuth requires a trusted public HTTPS callback URI that exactly matches a URI advertised by the chosen OAuth client. That configured URI must contain neither a query nor a fragment.
Mechanism
MCP servers expose functions that Copilot can invoke during conversations. Local servers run as separate subprocesses. Startup is lazy: reading inventory or enabling diagnostics does not start a server. The parameterless listConfigured operation also does not authenticate, apply sandbox policy or wait for startup.
Inventory separates configuration from runtime observations. An enabled server can report not_configured when no runtime server has materialized. Other lifecycle states include stopped, pending, connected, needs-auth and failed. A connected status can describe an older connection after configuration changes. Inventory retries concurrent graph replacement a bounded number of times and fails if it cannot obtain a consistent snapshot.
A name-only startServer or restartServer can resolve just the requested server after a cold resume, including user, plugin and built-in GitHub configurations. It continues to respect disabled state, authentication, policy and configuration precedence.
Prompt listing uses opaque pagination cursors. Prompt retrieval returns ordered messages with typed roles and structured JSON content; applications must inspect content types. Omitted arguments differ from an explicitly empty dictionary, and extension fields remain available through additionalProperties. Returned messages are not automatically sent to the model or used to fetch resources or execute tools. Server sampling and elicitation requests still pass through the configured host responders.
Setup
Configure mcpServers when creating a session. For a local server, supply its command and arguments; for a remote server, supply its type and URL. Choose the enabled tool names and application permission handler deliberately: several examples allow every server tool or approve permission requests automatically.
To apply confinement before discovered or explicitly configured servers start, pass sandboxConfig during session creation or resume. The example enables sandboxing for MCP servers and blocks outbound network access. Re-supply the policy on a cold resume. A conflicting managed policy fails creation or resume with managed_sandbox_policy_conflict.
Choose one OAuth ownership model for each authentication attempt: runtime-managed local callback, runtime-managed hosted callback, or host-managed token acquisition. For a runtime-managed hosted callback, wait for needs-auth, call the generated session.rpc.mcp.oauth.login method with the server name and redirect URI; when browser interaction is required, the result contains authorizationUrl and authorizationId, so open authorizationUrl in the user's browser and retain authorizationId with the target session. Deliver the callback through session.rpc.mcp.oauth.complete using the configured public origin and path plus the original callback query. The page warns against combining this flow with a host-managed OAuth handler or trusting client-supplied forwarding headers.
Example
The filesystem example imports CopilotClient from @github/copilot-sdk and configures a local server using npx with arguments -y, @modelcontextprotocol/server-filesystem and /tmp. It enables all server tools, creates a session and asks the assistant to list files in the allowed directory, then disconnects and stops the client.
The page includes illustrative output describing files and directories under /tmp. That output is documentation evidence, not an observed result here. The example was not executed, and its dependency availability, actual directory contents and successful completion are unknown. When adapting it, developers need to choose an appropriate allowed directory, tool list and permission policy.
Assessment & evidence
Limitations
A resident resume cannot undo processes already spawned. Older runtimes can ignore unknown startup fields, so sending sandboxConfig and updating options afterward can leave an initial period before policy applies. An identical effective sandbox-policy update does not restart servers; a different effective MCP sandbox policy retains the documented restart behavior.
Prompt retrieval fails explicitly when the runtime cannot preserve the raw response, including standard-input/output response frames above the 1 MiB capture limit. Missing or failing sampling and elicitation responders also fail the request. Applications must handle structured content and explicit failures.
A runtimeRefresh handoff is supported only when the authentication request advertises that capability. Acceptance does not establish completed refresh, reconnect or tool execution. The recovery-completed event distinguishes succeeded, cancelled and failed outcomes for the particular attempt. Missing saved grants, failed refreshes and failed reconnects terminate the original invocation. Stopping the turn or session prevents that invocation from later resuming, although an already-issued rotating-grant exchange can finish persisting credentials. There is no overall storage-settlement deadline.
Diagnostics can contain sensitive user or server content at every enabled level. Warning and higher levels can include server stderr; debug and trace can additionally contain payloads, arguments and paths. Credential filtering does not guarantee removal of arbitrary secrets. Retention is limited to 1,024 records and 4 MiB per session, with a 16 KiB limit per encoded record. Records can be truncated or dropped, and diagnostics are not saved in session history.
Reasoning
The documented design suggests a useful fit when an application needs several MCP integrations under one Copilot session. It provides common configuration, lifecycle observations, authentication operations and diagnostics, while leaving the host responsible for permission decisions, policy and interpretation of returned content. This fit is an architectural inference from the documented interfaces; implementation effort has not been measured.
Applications should distinguish configured, connected, authenticated and successfully completed states. The page explicitly explains why a retained connection or a later successful authorization attempt does not prove that an earlier invocation succeeded. Keeping those states separate should make application status messages and recovery decisions more accurate.
Alternatives
Within the documented approach, local standard-input/output servers suit local tools, files and scripts, while remote HTTP/SSE servers suit shared or cloud-hosted services. Runtime-managed and host-managed OAuth offer different divisions of authentication responsibility.
The page points to the MCP Servers Directory [https://github.com/modelcontextprotocol/servers] and GitHub MCP Server [https://github.com/github/github-mcp-server] for server options. It also links an SDK quickstart covering custom tools [https://docs.github.com/en/copilot/get-started/sdk-quickstart]. Those linked resources are outside the assessed scope. Their current capabilities, costs and comparative merits are unknown here.
Evidence
The evidence is the complete selected GitHub documentation page, captured as selected-page.txt on 2026-11-15 at 14:42:11.021 UTC. Its source snapshot SHA-256 is ea9d5247ffcb236f9a96a22f052899afdbc1a93e3b53dd68d07f6b03040c3e8f. The page supplies API descriptions, configuration examples, troubleshooting advice and illustrative output.
These findings describe documented behavior. No code, server, authentication flow or application journey was executed. Actual compatibility, security enforcement, reliability, latency and resource consumption are not assessed.
Access & freshness
Costs
The page supplies no prices for the SDK, Copilot access, model usage, remote MCP services or hosting. It also does not establish quotas or which entitlements include the illustrated functionality. Total cost is unknown; the examples do not establish that access is free or included in an existing subscription.
Rights
The selected page contains no licence text or explicit redistribution terms for its documentation, examples, SDK or referenced server packages. Reuse, redistribution and commercial-use permissions are therefore unknown from this evidence. Describing MCP as an open standard does not establish the licences of implementations or connected services.
Freshness
The snapshot records the page as captured on 2026-11-15. The page calls MCP integration an evolving feature and identifies experimental interfaces. It provides no publication date, last-update date or exact minimum runtime release for the contracts described.
The page links a tracking discussion at [https://github.com/github/copilot-sdk/issues/36], but that discussion was not assessed. Current release availability and changes after the capture are unknown.
Actions
Before adopting these interfaces, establish the required SDK/runtime release pair and compare the runtime version returned by server.connect with the application's requirements. Confirm account access, server dependencies, prices and applicable licences separately. Select local or remote transport, tool names, permission handling and OAuth ownership for the intended workload.
For troubleshooting, check executable paths and arguments, enabled tools, server stderr, remote connectivity and authentication. Enable MCP diagnostics deliberately, retain each reader's cursor, account for expired cursors and truncated records, and stop the read loop when capture is disabled. Disabling capture also clears its retained buffer.
Validate startup confinement, cold and resident resume behavior, configuration changes and authentication failure or cancellation in the intended environment before relying on them. These are recommended next steps; none has been performed here.
