Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bf1592a
feat: add managed MCP session support
mattdholloway Aug 28, 2026
8514b7f
Merge origin/main into managed MCP SDK
mattdholloway Sep 1, 2026
baea1f5
Regenerate Java codegen output
github-actions[bot] Sep 1, 2026
6039d98
Make managed MCP codegen reproducible
mattdholloway Sep 1, 2026
938065a
Merge origin/main into managed MCP SDK
mattdholloway Sep 2, 2026
5d2ea30
Notify hooks after response delivery
gimenete Sep 1, 2026
f864677
Make managed MCP startup vendoring-safe
mattdholloway Sep 2, 2026
a0793ab
Fix managed MCP required checks
mattdholloway Sep 2, 2026
b1a5f32
Merge origin/main into managed MCP SDK
mattdholloway Sep 14, 2026
523d190
Merge branch 'main' into mattdholloway-managed-mcp-sdk
mattdholloway Sep 14, 2026
9540059
Merge remote-tracking branch 'origin/main' into mattdholloway-managed…
Copilot Sep 14, 2026
ce609cb
Reject partial MCP schemas and recover header callback panics
mattdholloway Sep 15, 2026
2b5e165
Align Java managed MCP callback naming and experimental opt-in
mattdholloway Sep 15, 2026
eff6104
Preserve HookContext source compatibility with request-aware dispatch
mattdholloway Sep 15, 2026
21d9192
Merge branch 'main' into mattdholloway-managed-mcp-sdk
mattdholloway Sep 15, 2026
cd6a8f1
Expose Connector MCP session bridge across SDKs
mattdholloway Sep 16, 2026
1bb9d1e
Merge origin/main into Connector MCP SDK support
mattdholloway Sep 16, 2026
9cb96f6
Remove unrelated Rust compatibility changes
mattdholloway Sep 16, 2026
95e67ba
Expose experimental Connector session APIs
mattdholloway Sep 18, 2026
8b0e46a
Clarify Rust Connector availability
mattdholloway Sep 18, 2026
743b56c
Address Connector API review feedback
mattdholloway Sep 18, 2026
7d74add
Align Connector polling bounds with runtime
mattdholloway Sep 18, 2026
b324480
Handle undefined schema values in overlay comparison
mattdholloway Sep 18, 2026
071478d
Merge remote-tracking branch 'origin/main' into mattdholloway-managed…
mattdholloway Sep 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions docs/features/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,73 @@ The SDK supports two types of MCP servers:
| **Local/Stdio** | Runs as a subprocess, communicates via stdin/stdout | Local tools, file access, custom scripts |
| **HTTP/SSE** | Remote server accessed via HTTP | Shared services, cloud-hosted tools |

## Copilot Connectors

The experimental Connector session API lets SDK hosts offer the same non-UI
Connector flow as Copilot CLI. The runtime owns catalog validation, GitHub
authorization, bounded connection polling, MCP projection, and authoritative
same-session reconciliation. The SDK host owns account selection, browser
opening, confirmation, and presentation.

Use `mcpServers` for MCP servers that your application configures directly.
Use the Connector API for service-backed catalog entries whose connection and
session lifecycle the runtime manages.

Start with capability detection. When availability is `enabled`, obtain the
opaque account ID from your host's account-selection flow, list the catalog,
reconcile already-connected entries, and drive the typed connection result:

<!-- docs-validate: skip -->

```typescript
async function connectConnector(session, accountId, openConsentUrl) {
const capabilities = await session.rpc.connectors.getCapabilities();
if (capabilities.availability !== "enabled") return;

const catalog = await session.rpc.connectors.list({ accountId });
await session.rpc.connectors.reconcile({ accountId });
const connectorName = await chooseConnector(catalog.connectors);

const result = await session.rpc.connectors.connect({
accountId,
connectorName,
});
if (result.kind === "consent_required") {
await openConsentUrl(result.consentUrl);
}
if (result.kind !== "connected") {
await session.rpc.connectors.continueConnection({
continuationId: result.continuationId,
maxAttempts: Math.min(30, capabilities.maxPollAttempts),
pollIntervalMs: Math.min(2_000, capabilities.maxPollIntervalMs),
deadlineMs: Math.min(60_000, capabilities.maxDeadlineMs),
});
}
}
```

The generated API also exposes `refresh`, `reconnect`, `disconnect`,
`getStatus`, and `reconcile`. Connect and continuation results are discriminated
as `connected`, `consent_required`, or `pending`. Disconnect and reconcile
return authoritative session state, including live Connector-owned MCP status.
Account IDs and continuation IDs are opaque. The host obtains the account ID
through its existing account-selection flow and passes only that identifier to
Connector methods; credentials and provider tokens never appear in Connector
DTOs.

| SDK | Connector API |
| --- | --- |
| Node.js | `session.rpc.connectors` |
| Python | `session.rpc.connectors` |
| Go | `session.RPC.Connectors` |
| .NET | `session.Rpc.Connectors` |
| Java | `session.getRpc().connectors` |
| Rust | `session.rpc().connectors()` |

> [!NOTE]
> Connector support is experimental and may be unavailable in some runtime
> versions. Always call the capability method before using the API.

## Configuration

### Node.js / TypeScript
Expand Down
38 changes: 38 additions & 0 deletions dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,44 @@ tool name is `<server-key>-<tool-name>`. For `AvailableTools` and
`mcp:<server-key>-<tool-name>`. For `CustomAgents[].Tools` and
`DefaultAgent.ExcludedTools`, use `<server-key>-<tool-name>` directly.

## Experimental Connector API

`session.Rpc.Connectors` exposes the runtime-owned Connector catalog and
lifecycle. The API is experimental, so call `GetCapabilitiesAsync()` first and
use the remaining methods only when availability is enabled.

```csharp
using GitHub.Copilot.Rpc;

const string accountId = "opaque-account-selection-id";
var connectors = session.Rpc.Connectors;
var capabilities = await connectors.GetCapabilitiesAsync();

if (capabilities.Availability == ConnectorAvailability.Enabled)
{
var catalog = await connectors.ListAsync(accountId);
await connectors.ReconcileAsync(accountId);
var result = await connectors.ConnectAsync(accountId, catalog.Connectors[0].Name);

if (result is ConnectorConnectResultConsentRequired consent)
{
OpenBrowser(consent.ConsentUrl);
result = await connectors.ContinueConnectionAsync(
consent.ContinuationId,
maxAttempts: capabilities.MaxPollAttempts,
pollIntervalMs: capabilities.MaxPollIntervalMs,
deadlineMs: capabilities.MaxDeadlineMs);
}
}
```

The nine experimental methods are `GetCapabilitiesAsync`, `GetStatusAsync`,
`ListAsync`, `RefreshAsync`, `ConnectAsync`, `ReconnectAsync`,
`ContinueConnectionAsync`, `DisconnectAsync`, and `ReconcileAsync`. The host
selects the opaque GitHub account and handles consent UI. Connector methods
accept only that account ID, never credentials or provider tokens; credentials
and MCP projection remain runtime-owned.

## API Reference

### CopilotClient
Expand Down
Loading
Loading