mcp-github-copilot

⚙️ How It Works

How the server bridges your assistant and GitHub Copilot via the official SDK.

This MCP server bridges your AI assistant and GitHub Copilot via the official @github/copilot-sdk:

  1. On startup, it spawns the Copilot CLI server and connects via JSON-RPC over stdio
  2. Each query call creates a fresh Copilot session, sends the prompt (with optional attachments), collects the response, then disconnects
  3. list_models queries the CLI for available models — results are cached automatically to avoid rate limiting
  4. Authentication is handled entirely by the Copilot CLI — log in once with gh auth login and this MCP inherits it

🔒 Security best practices

  • ✅ No extra API keys — the bundled CLI handles auth via browser OAuth or GITHUB_TOKEN
  • ✅ Never commit .mcp.json (gitignored by default)
  • ✅ Use GITHUB_TOKEN in the MCP server env to avoid interactive browser prompts

🧱 Tech stack

RuntimeNode.js ≥ 20
LanguageTypeScript 5+ (ESM)
ProtocolModel Context Protocol (MCP) 1.27
Copilot SDK@github/copilot-sdk
SchemaZod
TestsVitest
Module SystemESM ("type": "module")

On this page