@kud/mcp-github-copilot
v1.0.2
Published
MCP server for GitHub Copilot — query any Copilot model programmatically via the official SDK.
Downloads
173
Maintainers
Readme
██████╗ ██╗████████╗██╗ ██╗██╗ ██╗██████╗ ██████╗ ██████╗ ██████╗ ██╗██╗ ██████╗ ████████╗
██╔════╝ ██║╚══██╔══╝██║ ██║██║ ██║██╔══██╗ ██╔════╝██╔═══██╗██╔══██╗██║██║ ██╔═══██╗╚══██╔══╝
██║ ███╗██║ ██║ ███████║██║ ██║██████╔╝ ██║ ██║ ██║██████╔╝██║██║ ██║ ██║ ██║
██║ ██║██║ ██║ ██╔══██║██║ ██║██╔══██╗ ██║ ██║ ██║██╔═══╝ ██║██║ ██║ ██║ ██║
╚██████╔╝██║ ██║ ██║ ██║╚██████╔╝██████╔╝ ╚██████╗╚██████╔╝██║ ██║███████╗╚██████╔╝ ██║
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝Query any GitHub Copilot model from your AI assistant — no extra API key required.
Features • Quick Start • Installation • Tools • Development
Features
- 🤖 Query any Copilot model — Claude, GPT-5, Codex, and more via the official
@github/copilot-sdk - 🔍 Discover models — list all available models with capabilities, context limits, and billing multipliers
- 🚀 Zero extra config — uses your existing GitHub Copilot CLI credentials automatically
- 🖼️ Image attachments — attach files or base64 images for vision-capable models
- ⚡ Modern Stack — TypeScript 5+, ESM, Zod schemas, MCP 1.27
- 📦 MCP Protocol — native integration with Claude Desktop, Claude Code CLI, Cursor, and more
Quick Start
Prerequisites
- Node.js 20+
- GitHub Copilot subscription
The @github/copilot CLI is bundled as a dependency — nothing extra to install. On first run it will open a browser to authenticate automatically, or you can pass a GITHUB_TOKEN env var to skip the prompt.
Install
npm install -g @kud/mcp-github-copilotMinimal Claude Code config
github-copilot:
transport: stdio
command: npx
args:
- -y
- "@kud/mcp-github-copilot"Installation
claude mcp add --transport stdio --scope user github-copilot \
-- npx --yes @kud/mcp-github-copilot@latestVerify: claude mcp list should show github-copilot
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"github-copilot": {
"command": "npx",
"args": ["--yes", "@kud/mcp-github-copilot@latest"]
}
}
}Restart Claude Desktop.
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"github-copilot": {
"command": "npx",
"args": ["--yes", "@kud/mcp-github-copilot@latest"]
}
}
}Restart Claude Desktop.
In Cursor settings → MCP → Add server:
{
"github-copilot": {
"command": "npx",
"args": ["--yes", "@kud/mcp-github-copilot@latest"]
}
}Edit ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"github-copilot": {
"command": "npx",
"args": ["--yes", "@kud/mcp-github-copilot@latest"]
}
}
}Edit .vscode/mcp.json in your workspace:
{
"servers": {
"github-copilot": {
"type": "stdio",
"command": "npx",
"args": ["--yes", "@kud/mcp-github-copilot@latest"]
}
}
}Available Tools
Querying
| Tool | Description |
| ------- | ----------------------------------------------------------------------------------------------------------------------- |
| query | Send a prompt to a Copilot model and return the response. Supports optional model selection and file/image attachments. |
Discovery
| Tool | Description |
| ------------- | ---------------------------------------------------------------------------------------------------- |
| list_models | List all available Copilot models with capabilities, context window limits, and billing multipliers. |
Total: 2 Tools
Image Attachments
The query tool accepts an optional attachments array for vision-capable models (Claude, GPT-5+):
File attachment — reads from disk:
{
"type": "file",
"path": "/absolute/path/to/screenshot.png"
}Blob attachment — inline base64 data:
{
"type": "blob",
"data": "<base64-encoded-content>",
"mimeType": "image/png"
}Both support an optional displayName field.
Example Conversations
"What Copilot models do I have access to?" → Calls
list_models, returns all models with context limits and pricing.
"Ask GPT-5 to explain the difference between TCP and UDP." → Calls
querywithmodel: "gpt-5".
"Use Claude Sonnet to review this code and suggest improvements." → Calls
querywithmodel: "claude-sonnet-4.6"and the code as the prompt.
"What's in this screenshot?" → Calls
querywith ablobattachment containing the image.
"Get a second opinion from Codex on this algorithm." → Calls
querywithmodel: "gpt-5.3-codex".
Development
Project structure
mcp-github-copilot/
├── src/
│ └── index.ts # MCP server — all tools in one file
├── dist/ # Compiled output (generated)
├── package.json
├── tsconfig.json
└── README.mdScripts
| Script | Description |
| --------------------- | --------------------------------------- |
| npm run build | Compile TypeScript to dist/ |
| npm run build:watch | Watch mode |
| npm run dev | Run directly via tsx (no build needed) |
| npm test | Run tests |
| npm run test:watch | Watch mode tests |
| npm run coverage | Test coverage report |
| npm run inspect | Open MCP Inspector against built server |
| npm run inspect:dev | Open MCP Inspector via tsx |
| npm run typecheck | Type-check without emitting |
| npm run clean | Remove dist/ |
Dev workflow
git clone https://github.com/kud/mcp-github-copilot.git
cd mcp-github-copilot
npm install
npm run build
npm testUse the MCP Inspector to test tools interactively:
npm run inspect
# Opens http://localhost:5173How it works
This MCP server bridges your AI assistant and GitHub Copilot via the official @github/copilot-sdk:
- On startup, it spawns the Copilot CLI server and connects via JSON-RPC over stdio
- Each
querycall creates a fresh Copilot session, sends the prompt (with optional attachments), collects the response, then disconnects list_modelsqueries the CLI for available models — results are cached automatically to avoid rate limiting- Authentication is handled entirely by the Copilot CLI — log in once with
gh auth loginand this MCP inherits it
Troubleshooting
Server not showing in the MCP list
- Ensure the Copilot CLI extension is installed:
gh extension list - Check Node.js version:
node --version(must be ≥ 20) - Try running manually:
npx @kud/mcp-github-copilot
Authentication errors
- Delete any cached auth state and let the CLI re-authenticate via browser on next run
- Or set
GITHUB_TOKENin your MCP server config to authenticate without a browser prompt
"Model not found" errors
- Use
list_modelsto see your available models — only models enabled on your subscription will appear
MCP Inspector logs
npm run inspectSecurity 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_TOKENin the MCP server env to avoid interactive browser prompts
Tech Stack
| | |
| ----------------- | --------------------------------- |
| Runtime | Node.js ≥ 20 |
| Language | TypeScript 5+ (ESM) |
| Protocol | Model Context Protocol (MCP) 1.27 |
| Copilot SDK | @github/copilot-sdk |
| Schema | Zod |
| Tests | Vitest |
| Module System | ESM ("type": "module") |
Contributing
- Fork the repo
- Create a branch:
git checkout -b feat/my-change - Make your changes and add tests
- Run
npm run build && npm test - Open a pull request
License
MIT — see LICENSE.
Acknowledgments
Built on top of the official GitHub Copilot SDK and the Model Context Protocol by Anthropic.
Resources
Support
Made with ❤️ for GitHub Copilot users
⭐ Star this repo if it's useful to you · ↑ Back to top
