Repository navigation
Add MCP base app samples for Node.js, Python, Go, and .NET - #1
Merged
Merged
Conversation
Co-authored-by: Trustinbtc999-hue <266692684+Trustinbtc999-hue@users.noreply.github.com>
Co-authored-by: Trustinbtc999-hue <266692684+Trustinbtc999-hue@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Trustinbtc999-hue
July 15, 2026 12:54
View session
Trustinbtc999-hue
approved these changes
Jul 15, 2026
Trustinbtc999-hue
marked this pull request as ready for review
July 15, 2026 13:36
Trustinbtc999-hue
self-requested a review
July 15, 2026 13:37
There was a problem hiding this comment.
Pull request overview
Adds minimal, runnable MCP integration samples across the Node.js, Python, Go, and .NET Copilot SDKs, using the @modelcontextprotocol/server-filesystem MCP server to demonstrate configuring MCP servers on a session and sending a prompt.
Changes:
- Added new MCP sample apps for Node.js, Python, Go, and .NET that configure a local stdio MCP server and print the assistant response.
- Added Go sample module updates (
go.mod/go.sum) to reflect indirect dependencies needed by the samples module.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| python/samples/mcp.py | New Python MCP sample demonstrating session MCP server configuration and prompt/response flow |
| nodejs/samples/mcp.ts | New Node.js MCP sample demonstrating session MCP server configuration and prompt/response flow |
| go/samples/mcp/main.go | New Go MCP sample demonstrating session MCP server configuration and prompt/response flow |
| go/samples/go.mod | Updates Go samples module dependencies (adds indirect requirement) |
| go/samples/go.sum | Updates Go samples module checksums for added dependency |
Comment on lines
+1
to
+16
| import { CopilotClient, approveAll } from "@github/copilot-sdk"; | ||
|
|
||
| // Demonstrate using an MCP server (filesystem) with the Copilot SDK. | ||
| // The @modelcontextprotocol/server-filesystem package must be available via npx. | ||
|
|
||
| async function main() { | ||
| const client = new CopilotClient(); | ||
|
|
||
| const session = await client.createSession({ | ||
| onPermissionRequest: approveAll, | ||
| mcpServers: { | ||
| filesystem: { | ||
| type: "local", | ||
| command: "npx", | ||
| args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"], | ||
| tools: ["*"], |
Comment on lines
+1
to
+21
| import asyncio | ||
|
|
||
| from copilot import CopilotClient | ||
| from copilot.session import PermissionHandler | ||
| from copilot.session_events import AssistantMessageData | ||
|
|
||
| # Demonstrate using an MCP server (filesystem) with the Copilot SDK. | ||
| # The @modelcontextprotocol/server-filesystem package must be available via npx. | ||
|
|
||
|
|
||
| async def main(): | ||
| client = CopilotClient() | ||
| await client.start() | ||
|
|
||
| session = await client.create_session( | ||
| on_permission_request=PermissionHandler.approve_all, | ||
| mcp_servers={ | ||
| "filesystem": { | ||
| "command": "npx", | ||
| "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"], | ||
| "tools": ["*"], |
Comment on lines
+4
to
+28
| "context" | ||
| "fmt" | ||
|
|
||
| copilot "github.com/github/copilot-sdk/go" | ||
| ) | ||
|
|
||
| // Demonstrate using an MCP server (filesystem) with the Copilot SDK. | ||
| // The @modelcontextprotocol/server-filesystem package must be available via npx. | ||
| // | ||
| // Set the COPILOT_CLI_PATH environment variable if the Copilot CLI is not in PATH. | ||
|
|
||
| func main() { | ||
| ctx := context.Background() | ||
| client := copilot.NewClient(nil) | ||
| if err := client.Start(ctx); err != nil { | ||
| panic(err) | ||
| } | ||
| defer client.Stop() | ||
|
|
||
| session, err := client.CreateSession(ctx, &copilot.SessionConfig{ | ||
| OnPermissionRequest: copilot.PermissionHandler.ApproveAll, | ||
| MCPServers: map[string]copilot.MCPServerConfig{ | ||
| "filesystem": copilot.MCPStdioServerConfig{ | ||
| Command: "npx", | ||
| Args: []string{"-y", "@modelcontextprotocol/server-filesystem", "/tmp"}, |
| ["filesystem"] = new McpStdioServerConfig | ||
| { | ||
| Command = "npx", | ||
| Args = ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"], |
Member
|
@copilot Fix the code for all comments in this review thread. When a review comment includes a suggested change, apply the suggestion exactly. Do not make changes beyond what is described in the linked review thread. |
Trustinbtc999-hue
self-requested a review
July 15, 2026 19:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds minimal runnable sample apps demonstrating MCP server integration across all four primary SDK languages, using
@modelcontextprotocol/server-filesystemas the reference server.New files
nodejs/samples/mcp.tspython/samples/mcp.pygo/samples/mcp/main.godotnet/samples/Mcp.csPattern (TypeScript example)
Each sample follows the same shape: create client → open session with MCP config → send prompt → print response. Go uses
copilot.NewClient(nil)(respectsCOPILOT_CLI_PATH); Node.js/Python/.NET bundle the CLI automatically.