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")