docs: add MCP server usage documentation#98
Conversation
Add comprehensive documentation for configuring and using MCP servers with the Copilot SDK across all supported languages (Node.js, Python, Go, .NET). This includes: - Configuration examples for local/stdio and remote HTTP/SSE servers - Complete reference for all configuration options - Troubleshooting guide for common issues - Links to related resources and issues Closes github#36
bd0bd16 to
f51aebc
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive documentation for configuring and using MCP (Model Context Protocol) servers with the GitHub Copilot SDK.
Changes:
- New documentation file explaining MCP server types, configuration for all 4 SDKs, complete configuration reference, and troubleshooting guidance
- Updates to getting-started guide with links to the new MCP documentation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| docs/mcp.md | Comprehensive MCP documentation with examples for Node.js, Python, Go, and .NET SDKs, configuration reference tables, and troubleshooting guide |
| docs/getting-started.md | Added links to new MCP documentation in the "Connect to MCP Servers" section and "Learn More" section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
docs/mcp.md
Outdated
|
|
||
| const client = new CopilotClient(); | ||
| const session = await client.createSession({ | ||
| model: "gpt-4.1", |
There was a problem hiding this comment.
The model value "gpt-4.1" is inconsistent with the rest of the codebase and may not be valid. According to the Python SDK types in python/copilot/types.py line 200, valid models are: "gpt-5", "claude-sonnet-4", "claude-sonnet-4.5", "claude-haiku-4.5". The rest of the documentation and examples in this repository use "gpt-5". Consider changing this to "gpt-5" to maintain consistency.
| model: "gpt-4.1", | |
| model: "gpt-5", |
docs/mcp.md
Outdated
| await client.start() | ||
|
|
||
| session = await client.create_session({ | ||
| "model": "gpt-4.1", |
There was a problem hiding this comment.
The model value "gpt-4.1" is inconsistent with the rest of the codebase and may not be valid. According to the Python SDK types in python/copilot/types.py line 200, valid models are: "gpt-5", "claude-sonnet-4", "claude-sonnet-4.5", "claude-haiku-4.5". The rest of the documentation and examples in this repository use "gpt-5". Consider changing this to "gpt-5" to maintain consistency.
docs/mcp.md
Outdated
| defer client.Stop() | ||
|
|
||
| session, err := client.CreateSession(&copilot.SessionConfig{ | ||
| Model: "gpt-4.1", |
There was a problem hiding this comment.
The model value "gpt-4.1" is inconsistent with the rest of the codebase and may not be valid. According to the Python SDK types in python/copilot/types.py line 200, valid models are: "gpt-5", "claude-sonnet-4", "claude-sonnet-4.5", "claude-haiku-4.5". The rest of the documentation and examples in this repository use "gpt-5". Consider changing this to "gpt-5" to maintain consistency.
docs/mcp.md
Outdated
| await using var client = new CopilotClient(); | ||
| await using var session = await client.CreateSessionAsync(new SessionConfig | ||
| { | ||
| Model = "gpt-4.1", |
There was a problem hiding this comment.
The model value "gpt-4.1" is inconsistent with the rest of the codebase and may not be valid. According to the Python SDK types in python/copilot/types.py line 200, valid models are: "gpt-5", "claude-sonnet-4", "claude-sonnet-4.5", "claude-haiku-4.5". The rest of the documentation and examples in this repository use "gpt-5". Consider changing this to "gpt-5" to maintain consistency.
docs/mcp.md
Outdated
| await using var session = await client.CreateSessionAsync(new SessionConfig | ||
| { | ||
| Model = "gpt-4.1", | ||
| McpServers = new Dictionary<string, McpServerConfig> |
There was a problem hiding this comment.
The type annotation is incorrect. According to the .NET SDK types in dotnet/src/Types.cs line 335, McpServers is defined as Dictionary<string, object>?, not Dictionary<string, McpServerConfig>. The McpServerConfig type doesn't exist in the .NET SDK - instead, the dictionary values should be typed as object to allow either McpLocalServerConfig or McpRemoteServerConfig.
| McpServers = new Dictionary<string, McpServerConfig> | |
| McpServers = new Dictionary<string, object> |
Added a Quick Start section with a complete, tested example using @modelcontextprotocol/server-filesystem. This provides users with a copy-paste working example they can try immediately.
- Changed 'gpt-4.1' to 'gpt-5' for consistency with codebase - Fixed .NET McpServers type to Dictionary<string, object>
546a77e to
a78408b
Compare
|
Thanks @AnassKartit 🙏 Appreciate you adding this while we work to catch up on docs. |
Summary
This PR adds comprehensive documentation for configuring and using MCP (Model Context Protocol) servers with the Copilot SDK, addressing the request in #36.
Changes
New file:
docs/mcp.md- Complete MCP documentation including:Updated:
docs/getting-started.mdReferences
Test plan
python/copilot/types.pyandnodejs/src/types.ts