Get the FREE Ultimate OpenClaw Setup Guide →

copilot -tool

MCP server that enables AI assistants to interact with Github Copilot cli, leveraging copilot massive token window for large file analysis and codebase understanding

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio poorgramer-zack-copilot-mcp-tool npx -y @aykahshi/copilot-mcp-server

How to use

This MCP server exposes GitHub Copilot as an MCP-compliant service that can be consumed by MCP clients (such as Claude Desktop, Claude Code, Cline, Cursor, and others). It leverages the Copilot CLI under the hood to provide interactive coding assistance across multiple tools (e.g., ask-copilot, copilot-explain, copilot-suggest, copilot-debug, copilot-refactor, copilot-test-generate, copilot-review) with model preferences and per-tool customization. By configuring the server in your MCP client, you can request code generation, explanations, suggestions, debugging help, refactoring ideas, tests, and code reviews through a consistent, MCP-compatible interface. The server also supports session management and quick commands to streamline your workflow across tools.

How to install

Prerequisites:

  • Node.js v22 or newer
  • npm (comes with Node.js)
  • GitHub Copilot CLI installed and authenticated

Step-by-step installation:

# 1. Install the MCP server package (NPX usage)
npm install -g @aykahshi/copilot-mcp-server

# Alternatively, you can run directly via NPX without global install
# 2. Start the MCP server using NPX
npx -y @aykahshi/copilot-mcp-server

Configure your MCP client to connect to the server. Example configuration (as shown in the repository):

{
  "mcpServers": {
    "copilot": {
      "command": "npx",
      "args": ["-y", "@aykahshi/copilot-mcp-server"]
    }
  }
}

If you prefer a permanent installation, you can install globally and run the server with:

npm install -g @aykahshi/copilot-mcp-server
{
  "mcpServers": {
    "copilot": {
      "command": "copilot-mcp-server"
    }
  }
}

Once installed, restart your MCP client and verify that the server named "copilot" appears in your connected servers list.

Additional notes

Notes and tips:

  • You can set per-tool model preferences using the --prefer flag (claude, gpt, or gemini). Defaults favor GPT models unless overridden.
  • Ensure GitHub Copilot CLI is authenticated (copilot login) so Copilot can be invoked by the MCP server.
  • The server supports multiple tools (ask-copilot, copilot-explain, copilot-suggest, etc.). You can tailor tool usage by passing parameters such as prompt, code, model, task, etc., per tool in your MCP client.
  • If you run into connectivity issues, verify your MCP client’s config points to the correct npm/npx invocation and that Node.js version requirements are met. Check that your environment allows running NPX/npm global installs.
  • You can mix NPX-based and local server references in your client config as needed; the canonical example uses npx with -y to fetch the latest server release.

Related MCP Servers

Sponsor this space

Reach thousands of developers