npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@willianpaiva/copilot-mcp-server

v1.0.13

Published

MCP server that integrates with GitHub Cbuildopilot to provide code assistance

Readme

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

Installation

Option 1: Using npx (Recommended)

npx @willianpaiva/copilot-mcp-server

Option 2: Manual Installation

  1. Clone this repository:
git clone https://github.com/WillianPaiva/copilot-mcp.git
cd copilot-mcp
  1. Install dependencies:
npm install
  1. Build the project:
npm run build

Configuration

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 .env

Optional 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=60

Setup Requirements

Prerequisites:

  1. GitHub Copilot Subscription: You need an active GitHub Copilot subscription
  2. 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:

  1. ~/.config/github-copilot/hosts.json
  2. ~/.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 login

Usage

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 dev

Build

npm run build

Lint

npm run lint

Test

npm test

Rate Limiting

The server implements rate limiting to respect GitHub's API limits:

  • Default: 60 requests per minute
  • Configurable via MAX_REQUESTS_PER_MINUTE environment variable
  • Automatic 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

  1. Authentication Failed

    • Ensure GitHub Copilot CLI is installed: gh extension install github/gh-copilot
    • Make sure you're authenticated: gh auth login
    • Verify you have access to GitHub Copilot
  2. Rate Limit Exceeded

    • Wait for the rate limit to reset (1 minute)
    • Consider reducing the frequency of requests
  3. 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=debug

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. 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:

  1. Check the troubleshooting section
  2. Search existing GitHub issues
  3. Create a new issue with detailed information