Skip to content

Conversation

@AnassKartit
Copy link

@AnassKartit AnassKartit commented Jan 22, 2026

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:

    • Overview of MCP and server types (local/stdio vs HTTP/SSE)
    • Configuration examples for all 4 SDKs (Node.js, Python, Go, .NET)
    • Complete reference table for all configuration options
    • Troubleshooting guide for common issues
    • Links to related resources
  • Updated: docs/getting-started.md

    • Added link to new MCP docs in the "Connect to MCP Servers" section
    • Added MCP docs to the "Learn More" section

References

Test plan

  • Verified all code examples match the actual SDK types
  • Cross-referenced with python/copilot/types.py and nodejs/src/types.ts
  • Links to external resources verified

Copilot AI review requested due to automatic review settings January 22, 2026 20:16
@AnassKartit AnassKartit requested a review from a team as a code owner January 22, 2026 20:16
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
@AnassKartit AnassKartit force-pushed the docs/add-mcp-documentation branch from bd0bd16 to f51aebc Compare January 22, 2026 20:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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",
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
model: "gpt-4.1",
model: "gpt-5",

Copilot uses AI. Check for mistakes.
docs/mcp.md Outdated
await client.start()

session = await client.create_session({
"model": "gpt-4.1",
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
docs/mcp.md Outdated
defer client.Stop()

session, err := client.CreateSession(&copilot.SessionConfig{
Model: "gpt-4.1",
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
docs/mcp.md Outdated
await using var client = new CopilotClient();
await using var session = await client.CreateSessionAsync(new SessionConfig
{
Model = "gpt-4.1",
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
docs/mcp.md Outdated
await using var session = await client.CreateSessionAsync(new SessionConfig
{
Model = "gpt-4.1",
McpServers = new Dictionary<string, McpServerConfig>
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
McpServers = new Dictionary<string, McpServerConfig>
McpServers = new Dictionary<string, object>

Copilot uses AI. Check for mistakes.
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>
@AnassKartit AnassKartit force-pushed the docs/add-mcp-documentation branch from 546a77e to a78408b Compare January 22, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add MCP usage documentation

1 participant