GitHub Copilot MCP Server
Integrates with GitHub Copilot CLI to provide coding assistance tools for asking questions, explaining code, suggesting CLI commands, debugging errors, refactoring code, generating unit tests, reviewing code, and managing conversation sessions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
GitHub Copilot MCP Server
A Model Context Protocol (MCP) server that integrates GitHub Copilot CLI with MCP clients.
Features
9 Tools - Interactive Copilot commands for coding assistance
2 Resources - Session history and management
3 Prompts - Workflow templates for common tasks
Full MCP Support - Compatible with Claude Desktop, Claude Code, Cline, and more
Related MCP server: GitHub Copilot MCP Server
Quick Start
For use:
Add to your configuration file:
{
"mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@leonardommello/copilot-mcp-server"]
}
}
}Prerequisites
You need GitHub Copilot CLI installed and authenticated:
npm install -g @github/copilot
copilot /loginTools
Tool | Description | Parameters |
ask-copilot | Ask Copilot for coding help, debugging, architecture |
|
copilot-explain | Get detailed code explanations |
|
copilot-suggest | Get CLI command suggestions |
|
copilot-debug | Debug code errors |
|
copilot-refactor | Get refactoring suggestions |
|
copilot-test-generate | Generate unit tests |
|
copilot-review | Get code review with feedback |
|
copilot-session-start | Start new conversation session | - |
copilot-session-history | Get session history |
|
Resources
Resource | URI | Description |
session-history |
| Access conversation history for a session |
sessions-list |
| List all active sessions |
Prompts
Prompt | Description | Arguments |
code-review-template | Structured code review template |
|
debug-template | Debug assistance template |
|
refactor-template | Code refactoring template |
|
๐ AI Client Integration
This MCP server works with any MCP-compatible client. Below are detailed setup instructions for popular AI coding assistants.
๐ Claude Desktop (Recommended)
Claude Desktop is the most tested and recommended client for this MCP server.
Configuration Path:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Method 1: NPX (No Installation Required)
{
"mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@leonardommello/copilot-mcp-server"]
}
}
}Method 2: Global Installation
npm install -g @leonardommello/copilot-mcp-serverThen add to config:
{
"mcpServers": {
"copilot": {
"command": "copilot-mcp-server"
}
}
}Method 3: Local Development
{
"mcpServers": {
"copilot": {
"command": "node",
"args": ["/absolute/path/to/copilot-mcp-tool/dist/esm/examples/server/copilotMcpServer.js"]
}
}
}After Setup:
Restart Claude Desktop
Look for the ๐ icon in the bottom-right corner
Click it to see "copilot" in the connected servers list
๐ฅ๏ธ Claude Code (CLI)
Claude Code provides the fastest setup experience via CLI.
Quick Setup:
# Using npx (no installation)
claude mcp add copilot -- npx -y @leonardommello/copilot-mcp-server
# Or with global installation
npm install -g @leonardommello/copilot-mcp-server
claude mcp add copilot copilot-mcp-serverImport from Claude Desktop:
# If you already configured Claude Desktop
claude mcp add-from-claude-desktopVerify Connection:
claude mcp list
# Should show: copilot (connected)Usage in Chat:
/mcp # Check server status๐ฏ Cursor
Cursor supports both one-click and manual installation.
Method 1: Manual Configuration
Edit ~/.cursor/mcp.json (create if it doesn't exist):
{
"mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@leonardommello/copilot-mcp-server"]
}
}
}Method 2: Settings UI
Open Cursor Settings (Cmd/Ctrl + ,)
Search for "MCP"
Click "Add MCP Server"
Name:
copilotCommand:
npx -y @leonardommello/copilot-mcp-server
๐ง VS Code with Cline Extension
Cline is a popular MCP-compatible VS Code extension.
Setup:
Install Cline extension from VS Code marketplace
Open Cline settings (gear icon in Cline panel)
Navigate to "MCP Servers" section
Add new server:
{
"mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@leonardommello/copilot-mcp-server"]
}
}
}Alternatively, edit VS Code settings.json:
{
"cline.mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@leonardommello/copilot-mcp-server"]
}
}
}โก Zed Editor
Zed has native MCP support built-in.
Configuration File: ~/.config/zed/mcp.json
{
"mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@leonardommello/copilot-mcp-server"]
}
}
}Or use Zed's UI:
Open Zed Settings (Cmd/Ctrl + ,)
Go to "Extensions" โ "MCP"
Add server with command:
npx -y @leonardommello/copilot-mcp-server
๐ฎ Windsurf
Configuration Path: ~/.windsurf/mcp.json
{
"mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@leonardommello/copilot-mcp-server"]
}
}
}๐ Gemini CLI
Gemini CLI supports both project-wide and global MCP server installation.
Global Installation:
gemini mcp add copilot -- npx -y @leonardommello/copilot-mcp-serverProject-Specific:
# In your project directory
gemini mcp add --project copilot -- npx -y @leonardommello/copilot-mcp-serverVerify:
gemini mcp list๐จ JetBrains AI Assistant
For IntelliJ IDEA, PyCharm, WebStorm, etc.
Setup:
Open Settings (Cmd/Ctrl + ,)
Navigate to:
Tools โ AI Assistant โ Model Context Protocol (MCP)Click "+" to add new MCP server
Configure:
Name:
copilotCommand:
npxArguments:
-y @leonardommello/copilot-mcp-server
๐ Other MCP Clients
This server is compatible with any MCP-compliant client. Generic configuration:
{
"mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@leonardommello/copilot-mcp-server"]
}
}
}Additional Compatible Clients:
Amp - Configuration in
~/.amp/mcp.jsonAugment Code - MCP settings in IDE
Roo Code - Via settings panel
Qwen Coder - CLI:
qwen mcp add copilot
โ Compatibility Matrix
Client | Status | Installation Method | Notes |
โ Tested | JSON config | Most stable, recommended | |
โ Tested | CLI command | Fastest setup | |
โ Compatible | JSON / UI | Multiple setup options | |
โ Compatible | Extension settings | VS Code integration | |
โ Compatible | Native MCP support | Built-in UI | |
โ Compatible | JSON config | Simple setup | |
โ Compatible | CLI command | Project & global | |
โ Compatible | Settings UI | All JetBrains IDEs | |
Other MCP clients | โ Compatible | Standard MCP protocol | Universal support |
How It Works
This MCP server acts as a bridge between MCP clients and the GitHub Copilot CLI:
MCP Client (Claude Desktop) โ Calls tool via MCP protocol
MCP Server (This package) โ Translates to Copilot CLI command
GitHub Copilot CLI โ Processes request and returns response
MCP Server โ Returns formatted response to client
Benefits:
Use Copilot's AI models directly in Claude conversations
Maintain session history across interactions
Access specialized Copilot features (explain, debug, review, etc.)
No need to switch between tools
๐ฏ Real-World Use Cases
1. Code Explanation & Learning
Scenario: Understanding complex code patterns
// Ask Copilot to explain
const result = arr.map(x => x * 2).filter(x => x > 10);Response:
This code performs two operations on an array in sequence:
.map(x => x * 2)- Creates a new array by multiplying each element by 2
.filter(x => x > 10)- Filters that result to only keep values greater than 10For example, if
arr = [3, 5, 8], the result would be[16]
2. Debugging Assistance
Scenario: Finding bugs in your code
// Buggy code
function sum(arr) {
return arr.reduce((a) => a+b, 0);
}Error: ReferenceError: b is not defined
Copilot's Fix:
function sum(arr) {
return arr.reduce((a, b) => a+b, 0);
}The reduce callback needs both the accumulator and the current value.
3. Security Refactoring
Scenario: Fixing SQL injection vulnerabilities
// Vulnerable code
function getUserData(id) {
return db.query('SELECT * FROM users WHERE id = ' + id);
}Copilot's Secure Version:
async function getUserData(id) {
if (!id) return null;
// Use parameterized query to prevent SQL injection
const query = 'SELECT * FROM users WHERE id = ?';
const user = await db.query(query, [id]);
return user || null;
}Key improvements: Parameterized queries, input validation, async/await
4. Test Generation
Scenario: Generate comprehensive tests
function isPrime(n) {
if (n <= 1) return false;
for (let i = 2; i * i <= n; i++) {
if (n % i === 0) return false;
}
return true;
}Generated Jest Tests:
describe('isPrime', () => {
it('should return false for numbers <= 1', () => {
expect(isPrime(-5)).toBe(false);
expect(isPrime(0)).toBe(false);
expect(isPrime(1)).toBe(false);
});
it('should return true for prime numbers', () => {
expect(isPrime(2)).toBe(true);
expect(isPrime(3)).toBe(true);
expect(isPrime(97)).toBe(true);
});
it('should return false for composite numbers', () => {
expect(isPrime(4)).toBe(false);
expect(isPrime(100)).toBe(false);
});
});5. Code Modernization
Scenario: Update legacy JavaScript to modern ES6+
// Legacy code
function processData(data) {
var result = [];
for (var i = 0; i < data.length; i++) {
result.push(data[i] * 2);
}
return result;
}Modern Version:
function processData(data) {
return data.map(item => item * 2);
}Benefits: Cleaner, modern arrow function, immutable array operation
6. CLI Command Suggestions
Task: "List all files recursively and count them"
PowerShell:
(Get-ChildItem -Recurse -File).CountBash:
find . -type f | wc -l7. Multi-Model Support
Compare responses across AI models:
// Ask the same question to different models
// GPT-5: More detailed technical explanations
// Claude Sonnet 4.5: More concise, practical answers
// Claude Haiku 4.5: Faster responses for simple queriesExample:
Use ask-copilot with model="gpt-5" and prompt="Explain async/await"
Use ask-copilot with model="claude-sonnet-4.5" and prompt="Explain async/await"๐ Detailed Tool Examples
ask-copilot
General-purpose coding assistant
๐ Prompt: "Write a TypeScript function to debounce user input"
๐ค Response: Complete implementation with TypeScript types, error handling, and usage examplescopilot-explain
Code explanation and education
๐ Code to explain:
const memoize = fn => {
const cache = new Map();
return (...args) => {
const key = JSON.stringify(args);
return cache.has(key) ? cache.get(key) : cache.set(key, fn(...args)).get(key);
};
};
๐ค Explanation: "This is a memoization function that caches results..."copilot-suggest
Command-line suggestions
๐ Task: "Find all TypeScript files modified in the last 7 days"
๐ค Windows: Get-ChildItem -Recurse -Filter *.ts | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-7)}
๐ค Linux: find . -name "*.ts" -mtime -7copilot-debug
Bug identification and fixes
๐ Buggy async code:
async function fetchData() {
const data = await fetch('/api/data');
return data.json;
}
โ Error: "data.json is not a function"
โ
Fix: return data.json() // Add parenthesescopilot-refactor
Code quality improvements
๐ Goal: "Improve performance"
// Before
const result = array.filter(x => x > 0).map(x => x * 2);
// After
const result = array.reduce((acc, x) => {
if (x > 0) acc.push(x * 2);
return acc;
}, []);
๐ก Benefit: Single pass through array instead of twocopilot-test-generate
Automated test creation
๐ Framework: "jest"
๐งช Generates: Unit tests, edge cases, integration tests, mock data
๐ Coverage: Positive cases, negative cases, boundary conditionscopilot-review
Code review with focus areas
๐ Focus: ["security", "performance"]
๐ Reviews:
- SQL injection vulnerabilities
- XSS vulnerabilities
- N+1 query problems
- Memory leaks
- Inefficient algorithmscopilot-session-start / copilot-session-history
Conversation tracking
๐ Start session: Creates unique session ID
๐พ Track history: All prompts and responses saved
๐ View history: Retrieve past conversations
โป๏ธ Resume context: Continue previous discussions๐จ Quick Examples
Generate Code:
Use ask-copilot to write a Python function that validates email addressesExplain Code:
Use copilot-explain to explain this regex: /^[a-z0-9]+@[a-z0-9]+\.[a-z]{2,}$/iDebug:
Use copilot-debug with code="function sum(arr) { return arr.reduce((a) => a+b, 0); }" and error="ReferenceError: b is not defined"Generate Tests:
Use copilot-test-generate with code="function isPrime(n) { return n > 1 && ![...Array(n).keys()].slice(2).some(i => n % i === 0); }" and framework="jest"Review Code:
Use copilot-review with code="..." and focusAreas=["security", "performance"]Session Management:
Use copilot-session-start to begin a new tracked conversation
Use copilot-session-history to view conversation historyAI Models
Select from available models:
claude-sonnet-4.5(default)claude-sonnet-4claude-haiku-4.5gpt-5
Example:
Use ask-copilot with model="gpt-5" and prompt="Explain async/await"Requirements
System Requirements
Node.js: >= 22.0.0
npm: >= 10.0.0
GitHub Copilot
GitHub Copilot subscription: Required (Get Copilot)
GitHub Copilot CLI: Must be installed and authenticated
npm install -g @github/copilot copilot /login
Troubleshooting
Common Issues
โ "copilot command not found"
# Install GitHub Copilot CLI
npm install -g @github/copilot
# Verify installation
copilot --versionโ "Not authenticated"
# Login to GitHub Copilot
copilot /login
# Follow the authentication flow in your browserโ "Node.js version too old"
# Check your Node.js version
node --version # Must be >= 22.0.0
# Update Node.js
# Using nvm (recommended)
nvm install 22
nvm use 22
# Or download from nodejs.orgโ "MCP server not responding"
# Test the server directly
npx -y @leonardommello/copilot-mcp-server
# Check Claude Desktop logs
# macOS: ~/Library/Logs/Claude/
# Windows: %APPDATA%\Claude\logs\โ "Permission denied" on Windows
# Run as administrator or use npx without global install
npx -y @leonardommello/copilot-mcp-serverFAQ
Q: Do I need a GitHub Copilot subscription? A: Yes, this MCP server requires an active GitHub Copilot subscription and the Copilot CLI installed.
Q: Can I use this with Claude Desktop?
A: Yes! This is the primary use case. Just add the configuration to claude_desktop_config.json.
Q: Does this work with VS Code? A: Yes, through the Cline extension or any other MCP-compatible VS Code extension.
Q: What's the difference between this and using Copilot directly? A: This allows you to use Copilot's capabilities within Claude conversations, combining both AI assistants.
Q: Is my code sent to both GitHub and Anthropic? A: Code you share in conversations goes through Claude's MCP protocol to Copilot CLI, which processes it according to GitHub's privacy policy.
Q: Can I use this offline? A: No, both GitHub Copilot and MCP clients require internet connection.
Development
Building from Source
# Clone the repository
git clone https://github.com/leonardommello/copilot-mcp-server.git
cd copilot-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
# Run locally
npm start
# Run tests
npm testContributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
Project Structure
copilot-mcp-server/
โโโ src/
โ โโโ examples/
โ โ โโโ server/
โ โ โโโ copilotMcpServer.ts # Main MCP server implementation
โ โโโ ... # MCP SDK core files
โโโ dist/ # Compiled output
โโโ scripts/ # Build scripts
โโโ package.jsonWhat is MCP?
The Model Context Protocol (MCP) is an open protocol that enables AI applications to securely access data and tools from different sources. Think of it as a universal connector for AI assistants.
Key concepts:
Servers (like this package): Provide tools, resources, and prompts
Clients (like Claude Desktop): Use these capabilities in conversations
Tools: Actions the AI can perform (like calling GitHub Copilot)
Resources: Data the AI can access (like session history)
Prompts: Templates for common workflows
Learn more at modelcontextprotocol.io
Links
๐ฆ npm Package: https://www.npmjs.com/package/@leonardommello/copilot-mcp-server
๐ป GitHub Repository: https://github.com/leonardommello/copilot-mcp-server
๐ Report Issues: https://github.com/leonardommello/copilot-mcp-server/issues
๐ค GitHub Copilot: https://github.com/features/copilot
๐ Model Context Protocol: https://modelcontextprotocol.io
License
MIT License - see LICENSE file for details
Author
Created by Leonardo M. Mello (@leonardommello)
Built with โค๏ธ using the Model Context Protocol
If this project helped you, please consider giving it a โญ on GitHub!
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
GitHub Copilot MCP: code, repo, PR, workflow tools for AI assistants.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoโฆ
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseBqualityDmaintenanceIntegrates GitHub Copilot with MCP-compatible tools to provide AI-powered code assistance, including chat, code explanation, and reviews. It leverages existing GitHub CLI authentication to support multiple models like GPT-4o and Claude 3.5 Sonnet.42MIT
- AlicenseNot gradedqualityDmaintenanceIntegrates GitHub Copilot CLI with MCP clients to offer various coding assistance tools including asking questions, explaining code, suggesting commands, debugging, refactoring, generating tests, and reviewing code.28 npm8MIT
- AlicenseCqualityDmaintenanceConnects MCP-enabled editors to GitHub Copilot CLI for non-interactive code analysis, batch processing, and code review.1033 npm5MIT
- AlicenseBqualityBmaintenanceEnables MCP-compatible AI clients like Claude Code, Cursor, and Codex to invoke Google Antigravity's Gemini coding agent for repository-aware file operations, command execution, code review, test generation, and quota checks, while also providing a standalone dual-mode CLI.7MIT