copilot-mcp-server

copilot-mcp-server

Connects MCP-enabled editors to GitHub Copilot CLI for non-interactive code analysis, batch processing, and code review.

Category
访问服务器

README

Copilot MCP Tool

<div align="center">

GitHub Release npm version npm downloads License: MIT Open Source

</div>

Copilot MCP Tool is an open‑source Model Context Protocol (MCP) server that connects your IDE or AI assistant (Claude, Cursor, etc.) to GitHub Copilot CLI. It enables non‑interactive automation, safe tool execution with permissions, and large‑scale code analysis via @ file references. Built for reliability and speed, it streams progress updates, and integrates cleanly with standard MCP clients for code review, refactoring, documentation, and CI automation.

  • Primary: Ask GitHub Copilot CLI questions from your MCP client, with comprehensive tool management
  • Advanced: Batch processing, code review, and brainstorming capabilities

<a href="https://glama.ai/mcp/servers/@trishchuk/copilot-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@trishchuk/copilot-mcp-server/badge" alt="Copilot MCP server" /> </a>

TLDR: Claude + GitHub Copilot CLI

Goal: Use GitHub Copilot CLI directly from your MCP-enabled editor to analyze and edit code efficiently.

Prerequisites

Before using this tool, ensure you have:

  1. Node.js (v18.0.0 or higher)
  2. GitHub Copilot CLI - Required

One-Line Setup

claude mcp add copilot-cli -- npx -y @trishchuk/copilot-mcp-server

Verify Installation

Type /mcp inside Claude Code to verify the Copilot MCP is active.


Alternative: Import from Claude Desktop

If you already have it configured in Claude Desktop:

  1. Add to your Claude Desktop config:
"copilot-cli": {
  "command": "npx",
  "args": ["-y", "@trishchuk/copilot-mcp-server"]
}
  1. Import to Claude Code:
claude mcp add-from-claude-desktop

Configuration

Register the MCP server with your MCP client:

For NPX Usage (Recommended)

Add this configuration to your Claude Desktop config file:

{
  "mcpServers": {
    "copilot-cli": {
      "command": "npx",
      "args": ["-y", "@trishchuk/copilot-mcp-server"],
      "env": {
        "COPILOT_MODEL": "claude-sonnet-4.5"
      }
    }
  }
}

For Global Installation

If you installed globally, use this configuration instead:

{
  "mcpServers": {
    "copilot-cli": {
      "command": "copilot-mcp",
      "env": {
        "COPILOT_MODEL": "claude-sonnet-4.5"
      }
    }
  }
}

Configuration File Locations:

  • Claude Desktop:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • Linux: ~/.config/claude/claude_desktop_config.json

After updating the configuration, restart your terminal session.

Environment Variables

Configure default behavior with environment variables:

COPILOT_MODEL - Default AI Model

Method 1: In MCP Configuration (Recommended)

Add the env field to your MCP server configuration:

{
  "mcpServers": {
    "copilot-cli": {
      "command": "npx",
      "args": ["-y", "@trishchuk/copilot-mcp-server"],
      "env": {
        "COPILOT_MODEL": "claude-sonnet-4.5"
      }
    }
  }
}

Method 2: System Environment Variable

# Set for current session
export COPILOT_MODEL=claude-sonnet-4.5

# Permanently (add to ~/.bashrc or ~/.zshrc)
echo 'export COPILOT_MODEL=claude-sonnet-4.5' >> ~/.zshrc

Available models:

  • claude-sonnet-4.5 - Default, best for code generation
  • claude-sonnet-4 - Faster version
  • gpt-5 - OpenAI GPT-5

Priority: model parameter > COPILOT_MODEL env > Copilot CLI default (claude-sonnet-4.5)

Override in requests:

# Uses COPILOT_MODEL
Use ask tool to analyze @src/

# Overrides with gpt-5
Use ask tool with model gpt-5 to analyze @src/

COPILOT_MCP_CWD - Working Directory

Purpose: Sets the working directory for Copilot CLI command execution. This is especially important when the MCP server starts from a different directory than your project (e.g., from home directory in IDE integrations).

Method 1: In MCP Configuration (Recommended for IDE)

{
  "mcpServers": {
    "copilot-cli": {
      "command": "npx",
      "args": ["-y", "@trishchuk/copilot-mcp-server"],
      "env": {
        "COPILOT_MCP_CWD": "/absolute/path/to/your/project"
      }
    }
  }
}

Method 2: System Environment Variable

# Set for current session
export COPILOT_MCP_CWD=/path/to/your/project

# Permanently (add to ~/.bashrc or ~/.zshrc)
echo 'export COPILOT_MCP_CWD=/path/to/your/project' >> ~/.zshrc

Resolution Priority:

  1. workingDir parameter in request (highest)
  2. COPILOT_MCP_CWD env variable
  3. PWD or INIT_CWD env variables
  4. Auto-inferred from @path in prompt
  5. process.cwd() (lowest)

Override in requests:

# Use explicit workingDir parameter
Use ask tool with workingDir "/path/to/project" to analyze the codebase

For IntelliJ IDEA / IDE Users: If Copilot CLI cannot find your project files, set COPILOT_MCP_CWD in your MCP server configuration to point to your project directory.

See Getting Started Guide for full configuration details.

Example Workflow

  • Natural language: "use copilot to explain index.html", "understand this repo with @src", "look for vulnerabilities and suggest fixes"
  • Claude Code: Type /copilot to access the MCP server tools.

Usage Examples

GitHub Copilot CLI

// Use GitHub Copilot CLI for analysis
'explain the architecture of @src/';

// Code review with specific focus
'use copilot to review @src/main.ts for security vulnerabilities';

// Batch processing multiple files
'use batch to refactor all JavaScript files in @src/ for ES6 syntax';

// Comprehensive code review
'use review to perform security review of @api/ with high severity filter';

With File References (using @ syntax)

  • ask copilot to analyze @src/main.ts and explain what it does
  • use copilot to summarize @. the current directory
  • analyze @package.json and list dependencies using copilot

General Questions (without files)

  • ask copilot to explain div centering
  • ask copilot about best practices for React development
  • use copilot for TypeScript debugging help

Advanced Examples

// GitHub Copilot CLI batch processing
'use batch to update all React components in @src/components/ for React 18 patterns';

// Comprehensive code review
'use review for security review of @api/ with critical severity filter and fix suggestions';

// Multiple task processing
'use batch to: 1) add JSDoc comments to @utils.js, 2) fix ESLint issues in @main.ts, 3) update imports in @index.js';

Brainstorming & Ideation

  • brainstorm ways to optimize our CI/CD pipeline using SCAMPER method
  • use copilot to brainstorm 10 innovative features for our app
  • ask copilot to generate product ideas for the healthcare domain with design-thinking approach

Tool Permissions & Safety

GitHub Copilot CLI supports tool permissions and directory access controls. This server defaults to allowing all tools for non-interactive mode.

  • use copilot to create and run a Python script that processes data
  • ask copilot to safely test @script.py and explain what it does

Tools (for the AI)

These tools are designed to be used by the AI assistant.

Primary Tools (GitHub Copilot CLI)

  • ask: Executes GitHub Copilot CLI with comprehensive tool and directory management.

    • Supports @ file references for including file content
    • Tool permissions: allowAllTools, allowTool, denyTool
    • Directory access: addDir for granting file system access
    • Advanced options: logLevel, resume (session management), screenReader support
    • Session management and logging controls
  • batch: Processes multiple atomic tasks with GitHub Copilot CLI in batch mode.

    • Supports parallel or sequential execution
    • Priority-based task ordering (high, normal, low)
    • Comprehensive error handling and progress reporting
    • Stop-on-error or continue-on-error modes
    • Detailed execution reports with timing and status
  • review: Comprehensive code review using GitHub Copilot CLI.

    • Multiple review types: security, performance, code-quality, best-practices, architecture, testing, documentation, accessibility, comprehensive
    • Severity filtering: low, medium, high, critical
    • Output formats: markdown, json, text
    • Fix suggestions and priority ranking
    • File pattern exclusions and issue limits

Utility Tools

  • brainstorm: Generate novel ideas with structured methodologies.

    • Multiple frameworks: divergent, convergent, SCAMPER, design-thinking, lateral
    • Domain-specific context (software, business, creative, research, product, marketing)
    • Configurable idea count and analysis depth
    • Includes feasibility, impact, and innovation scoring
    • Example: brainstorm prompt:"ways to improve code review process" domain:"software" methodology:"scamper"
  • ping: A simple test tool that echoes back a message.

    • Use to verify MCP connection is working
    • Example: /copilot:ping (MCP) "Hello from Copilot MCP!"
  • Help: Shows CLI help text for GitHub Copilot.

    • Automatically detects available CLI tools
    • Displays installation instructions if tools are missing
  • version: Shows version information for all CLI tools and MCP server.

    • Reports GitHub Copilot CLI, Node.js, and MCP server versions
    • Includes installation commands for missing tools
  • timeout-test: Test tool for timeout prevention.

    • Runs for a specified duration in milliseconds
    • Useful for testing long-running operations

Slash Commands (for the User)

You can use these commands directly in Claude Code's interface (compatibility with other clients has not been tested).

  • /analyze: Analyzes files or directories using Copilot, or asks general questions.
    • prompt (required): The analysis prompt. Use @ syntax to include files (e.g., /analyze prompt:@src/ summarize this directory) or ask general questions (e.g., /analyze prompt:Please use a web search to find the latest news stories).
  • /review: Performs comprehensive code review using Copilot.
    • target (required): Files/directories to review (e.g., /review target:@src/ or /review target:@main.js).
    • reviewType (optional): Type of review - security, performance, code-quality, etc.
  • /batch: Processes multiple tasks in batch mode.
    • tasks (required): Array of tasks to process.
  • /help: Displays CLI help information for available tools.
  • /ping: Tests the connection to the server.
    • message (optional): A message to echo back.

Acknowledgments

This project was inspired by the excellent work from jamubc/gemini-mcp-tool. Special thanks to @jamubc for the original MCP server architecture and implementation patterns.

Contributing

Contributions are welcome! Please submit pull requests or report issues through GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Disclaimer: This is an unofficial, third-party tool and is not affiliated with, endorsed, or sponsored by GitHub or Microsoft.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选