Copilot MCP Server
Utilizes the GitHub CLI and existing authentication to securely access Copilot services and manage organization-specific AI configurations.
Integrates with GitHub Copilot to provide AI-powered code assistance, including features for code explanation, natural language code suggestions, code reviews, and a programming-focused chat interface.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Copilot MCP Server explain how this function works"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Copilot MCP Server
A Model Context Protocol (MCP) server that integrates with GitHub Copilot to provide AI-powered code assistance directly to Claude Code and other MCP-compatible tools.
Features
Chat with Copilot: Get general programming assistance using GitHub Copilot's AI models
Code Explanation: Detailed explanations of code snippets
Code Suggestions: Generate code based on natural language descriptions
Code Review: Get feedback and improvement suggestions for your code
Multiple AI Models: Support for GPT-4o, Claude 3.5 Sonnet, and Gemini 2.0 Flash
Rate Limiting: Built-in rate limiting to respect API limits
Automatic Authentication: Works with your existing GitHub Copilot CLI setup
Related MCP server: copilot-mcp-server
Installation
Option 1: Using npx (Recommended)
npx @willianpaiva/copilot-mcp-serverOption 2: Manual Installation
Clone this repository:
git clone https://github.com/WillianPaiva/copilot-mcp.git
cd copilot-mcpInstall dependencies:
npm installBuild the project:
npm run buildConfiguration
No Configuration Needed!
The server works out of the box with your existing GitHub Copilot authentication.
Optional Configuration
Only needed for special use cases. Create a .env file:
cp .env.example .envOptional settings:
# Only if you want to override the detected organization
GITHUB_ORG=your_organization_name
# Optional debugging
LOG_LEVEL=info
DEBUG=false
MAX_REQUESTS_PER_MINUTE=60Setup Requirements
Prerequisites:
GitHub Copilot Subscription: You need an active GitHub Copilot subscription
GitHub Copilot CLI Installed: Install and authenticate GitHub Copilot CLI:
# Install GitHub CLI first brew install gh # or your preferred method # Install GitHub Copilot CLI extension gh extension install github/gh-copilot # Authenticate (this will save tokens to ~/.config/github-copilot/) gh auth login
Authentication
Automatic Authentication (Recommended)
The MCP server automatically detects your GitHub Copilot authentication from:
~/.config/github-copilot/hosts.json~/.config/github-copilot/apps.json
No manual configuration needed if you have GitHub Copilot CLI installed and authenticated!
Troubleshooting Authentication
If automatic detection fails, ensure you have GitHub Copilot CLI properly installed and authenticated:
gh extension install github/gh-copilot
gh auth loginUsage
With Claude Code
Add the following to your Claude Code MCP configuration:
Option 1: Using npx (Recommended)
{
"mcpServers": {
"copilot": {
"command": "npx",
"args": ["-y", "@willianpaiva/copilot-mcp-server"]
}
}
}Option 2: Manual Installation
{
"mcpServers": {
"copilot": {
"command": "node",
"args": ["/path/to/your/copilot-mcp/build/index.js"]
}
}
}That's it! No tokens or environment variables needed - the server automatically uses your existing GitHub Copilot authentication.
Available Tools
copilot_chat
General programming assistance and questions.
// Example usage in Claude Code
copilot_chat({
message: "How do I implement a binary search algorithm?",
model: "gpt-4o",
context: "I'm working on a JavaScript project"
})copilot_explain
Get detailed explanations of code.
copilot_explain({
code: "function fibonacci(n) { return n <= 1 ? n : fibonacci(n-1) + fibonacci(n-2); }",
language: "javascript"
})copilot_suggest
Generate code from natural language descriptions.
copilot_suggest({
prompt: "Create a React component for a user profile card",
language: "javascript",
maxSuggestions: 3
})copilot_review
Get code review and improvement suggestions.
copilot_review({
code: "your code here",
language: "python",
reviewType: "security"
})Available Resources
copilot://models
List of available AI models and their capabilities.
copilot://usage
Current usage statistics and rate limiting information.
Development
Run in Development Mode
npm run devBuild
npm run buildLint
npm run lintTest
npm testRate Limiting
The server implements rate limiting to respect GitHub's API limits:
Default: 60 requests per minute
Configurable via
MAX_REQUESTS_PER_MINUTEenvironment variableAutomatic reset every minute
Error Handling
The server includes comprehensive error handling for:
Authentication failures
Rate limit exceeded
Network issues
Invalid requests
API unavailability
Troubleshooting
Common Issues
Authentication Failed
Ensure GitHub Copilot CLI is installed:
gh extension install github/gh-copilotMake sure you're authenticated:
gh auth loginVerify you have access to GitHub Copilot
Rate Limit Exceeded
Wait for the rate limit to reset (1 minute)
Consider reducing the frequency of requests
API Not Available
Verify you have access to GitHub Copilot
Check GitHub's status page for outages
Debug Mode
Enable debug mode for verbose logging:
DEBUG=true
LOG_LEVEL=debugContributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
License
MIT License - see LICENSE file for details.
Security
The server uses your existing GitHub Copilot authentication
No tokens are stored or transmitted by this application
Authentication files are read-only from GitHub CLI's standard locations
Follow GitHub's security best practices for your main GitHub authentication
Support
For issues and questions:
Check the troubleshooting section
Search existing GitHub issues
Create a new issue with detailed information
Available Tools
4 toolscopilot_chatC
Chat with GitHub Copilot AI models for general programming assistance
Inputs: message (required), context, model, temperature.
copilot_explainC
Get detailed explanations of code from GitHub Copilot
Inputs: code (required), language, context.
copilot_reviewC
Get code review and improvement suggestions from GitHub Copilot
Inputs: code (required), language, reviewType.
copilot_suggestC
Get code suggestions and completions from GitHub Copilot
Inputs: prompt (required), language, context, maxSuggestions.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The tools have significant overlap in purpose, as all involve interacting with GitHub Copilot for code-related assistance. While the descriptions differentiate them slightly (e.g., 'chat' vs. 'suggest'), an agent could easily confuse them, especially since 'copilot_suggest' and 'copilot_chat' might both provide code suggestions. The boundaries are unclear, leading to potential misselection.
All tool names follow a consistent 'copilot_' prefix with a descriptive suffix (chat, explain, review, suggest). This verb_noun-like pattern is predictable and readable, making it easy for agents to understand the naming convention without confusion or deviation.
With 4 tools, the count is borderline for a server focused on GitHub Copilot interactions. It feels slightly thin, as it might lack coverage for other potential Copilot functionalities (e.g., debugging or documentation generation), but it's reasonable for basic assistance. However, the overlap in tools reduces the effective utility of having four distinct tools.
The tool surface covers key aspects of GitHub Copilot (chat, explanation, review, suggestions), but there are notable gaps. For example, it lacks tools for more advanced operations like code refactoring, debugging assistance, or integration with specific programming languages. While agents can work around this, the surface is not fully comprehensive for a general programming assistance domain.
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.
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
AI code review for GitHub PRs with an MCP autofix loop for Claude Code and Cursor
Related MCP Servers
- 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.27 npm8MIT
- AlicenseCqualityDmaintenanceConnects MCP-enabled editors to GitHub Copilot CLI for non-interactive code analysis, batch processing, and code review.1031 npm5MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-powered GitHub interactions including repository analysis, code search, PR reviews, and more through the MCP protocol.4MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with GitHub issues, pull requests, and Actions workflows through MCP tools.-