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
Add this skill
npx mdskills install x51xxx/copilot-mcp-serverWell-documented MCP server with comprehensive tooling for GitHub Copilot CLI integration and code analysis
1# Copilot MCP Tool23<div align="center">45[](https://github.com/x51xxx/copilot-mcp-server/releases)6[](https://www.npmjs.com/package/@trishchuk/copilot-mcp-server)7[](https://www.npmjs.com/package/@trishchuk/copilot-mcp-server)8[](https://opensource.org/licenses/MIT)9[](https://github.com/x51xxx/copilot-mcp-server)1011</div>1213**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.1415- **Primary**: Ask GitHub Copilot CLI questions from your MCP client, with comprehensive tool management16- **Advanced**: Batch processing, code review, and brainstorming capabilities1718<a href="https://glama.ai/mcp/servers/@trishchuk/copilot-mcp-server">19 <img width="380" height="200" src="https://glama.ai/mcp/servers/@trishchuk/copilot-mcp-server/badge" alt="Copilot MCP server" />20</a>2122## TLDR: [](#) + GitHub Copilot CLI2324**Goal**: Use GitHub Copilot CLI directly from your MCP-enabled editor to analyze and edit code efficiently.2526## Prerequisites2728Before using this tool, ensure you have:29301. **[Node.js](https://nodejs.org/)** (v18.0.0 or higher)312. **[GitHub Copilot CLI](https://github.com/github/copilot-cli)** - Required3233### One-Line Setup3435```bash36claude mcp add copilot-cli -- npx -y @trishchuk/copilot-mcp-server37```3839### Verify Installation4041Type `/mcp` inside Claude Code to verify the Copilot MCP is active.4243---4445### Alternative: Import from Claude Desktop4647If you already have it configured in Claude Desktop:48491. Add to your Claude Desktop config:5051```json52"copilot-cli": {53 "command": "npx",54 "args": ["-y", "@trishchuk/copilot-mcp-server"]55}56```57582. Import to Claude Code:5960```bash61claude mcp add-from-claude-desktop62```6364## Configuration6566Register the MCP server with your MCP client:6768### For NPX Usage (Recommended)6970Add this configuration to your Claude Desktop config file:7172```json73{74 "mcpServers": {75 "copilot-cli": {76 "command": "npx",77 "args": ["-y", "@trishchuk/copilot-mcp-server"],78 "env": {79 "COPILOT_MODEL": "claude-sonnet-4.5"80 }81 }82 }83}84```8586### For Global Installation8788If you installed globally, use this configuration instead:8990```json91{92 "mcpServers": {93 "copilot-cli": {94 "command": "copilot-mcp",95 "env": {96 "COPILOT_MODEL": "claude-sonnet-4.5"97 }98 }99 }100}101```102103**Configuration File Locations:**104105- **Claude Desktop**:106 - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`107 - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`108 - **Linux**: `~/.config/claude/claude_desktop_config.json`109110After updating the configuration, restart your terminal session.111112### Environment Variables113114Configure default behavior with environment variables:115116#### `COPILOT_MODEL` - Default AI Model117118**Method 1: In MCP Configuration (Recommended)**119120Add the `env` field to your MCP server configuration:121122```json123{124 "mcpServers": {125 "copilot-cli": {126 "command": "npx",127 "args": ["-y", "@trishchuk/copilot-mcp-server"],128 "env": {129 "COPILOT_MODEL": "claude-sonnet-4.5"130 }131 }132 }133}134```135136**Method 2: System Environment Variable**137138```bash139# Set for current session140export COPILOT_MODEL=claude-sonnet-4.5141142# Permanently (add to ~/.bashrc or ~/.zshrc)143echo 'export COPILOT_MODEL=claude-sonnet-4.5' >> ~/.zshrc144```145146**Available models**:147148- `claude-sonnet-4.5` - Default, best for code generation149- `claude-sonnet-4` - Faster version150- `gpt-5` - OpenAI GPT-5151152**Priority**: `model` parameter > `COPILOT_MODEL` env > Copilot CLI default (`claude-sonnet-4.5`)153154**Override in requests**:155156```157# Uses COPILOT_MODEL158Use ask tool to analyze @src/159160# Overrides with gpt-5161Use ask tool with model gpt-5 to analyze @src/162```163164#### `COPILOT_MCP_CWD` - Working Directory165166**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).167168**Method 1: In MCP Configuration (Recommended for IDE)**169170```json171{172 "mcpServers": {173 "copilot-cli": {174 "command": "npx",175 "args": ["-y", "@trishchuk/copilot-mcp-server"],176 "env": {177 "COPILOT_MCP_CWD": "/absolute/path/to/your/project"178 }179 }180 }181}182```183184**Method 2: System Environment Variable**185186```bash187# Set for current session188export COPILOT_MCP_CWD=/path/to/your/project189190# Permanently (add to ~/.bashrc or ~/.zshrc)191echo 'export COPILOT_MCP_CWD=/path/to/your/project' >> ~/.zshrc192```193194**Resolution Priority**:1951961. `workingDir` parameter in request (highest)1972. `COPILOT_MCP_CWD` env variable1983. `PWD` or `INIT_CWD` env variables1994. Auto-inferred from `@path` in prompt2005. `process.cwd()` (lowest)201202**Override in requests**:203204```205# Use explicit workingDir parameter206Use ask tool with workingDir "/path/to/project" to analyze the codebase207```208209**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.210211See [Getting Started Guide](https://x51xxx.github.io/copilot-mcp-tool/getting-started#environment-variables) for full configuration details.212213## Example Workflow214215- **Natural language**: "use copilot to explain index.html", "understand this repo with @src", "look for vulnerabilities and suggest fixes"216- **Claude Code**: Type `/copilot` to access the MCP server tools.217218## Usage Examples219220### GitHub Copilot CLI221222```javascript223// Use GitHub Copilot CLI for analysis224'explain the architecture of @src/';225226// Code review with specific focus227'use copilot to review @src/main.ts for security vulnerabilities';228229// Batch processing multiple files230'use batch to refactor all JavaScript files in @src/ for ES6 syntax';231232// Comprehensive code review233'use review to perform security review of @api/ with high severity filter';234```235236### With File References (using @ syntax)237238- `ask copilot to analyze @src/main.ts and explain what it does`239- `use copilot to summarize @. the current directory`240- `analyze @package.json and list dependencies using copilot`241242### General Questions (without files)243244- `ask copilot to explain div centering`245- `ask copilot about best practices for React development`246- `use copilot for TypeScript debugging help`247248### Advanced Examples249250```javascript251// GitHub Copilot CLI batch processing252'use batch to update all React components in @src/components/ for React 18 patterns';253254// Comprehensive code review255'use review for security review of @api/ with critical severity filter and fix suggestions';256257// Multiple task processing258'use batch to: 1) add JSDoc comments to @utils.js, 2) fix ESLint issues in @main.ts, 3) update imports in @index.js';259```260261### Brainstorming & Ideation262263- `brainstorm ways to optimize our CI/CD pipeline using SCAMPER method`264- `use copilot to brainstorm 10 innovative features for our app`265- `ask copilot to generate product ideas for the healthcare domain with design-thinking approach`266267### Tool Permissions & Safety268269GitHub Copilot CLI supports tool permissions and directory access controls. This server defaults to allowing all tools for non-interactive mode.270271- `use copilot to create and run a Python script that processes data`272- `ask copilot to safely test @script.py and explain what it does`273274### Tools (for the AI)275276These tools are designed to be used by the AI assistant.277278#### Primary Tools (GitHub Copilot CLI)279280- **`ask`**: Executes GitHub Copilot CLI with comprehensive tool and directory management.281 - Supports `@` file references for including file content282 - Tool permissions: `allowAllTools`, `allowTool`, `denyTool`283 - Directory access: `addDir` for granting file system access284 - Advanced options: `logLevel`, `resume` (session management), `screenReader` support285 - Session management and logging controls286287- **`batch`**: Processes multiple atomic tasks with GitHub Copilot CLI in batch mode.288 - Supports parallel or sequential execution289 - Priority-based task ordering (high, normal, low)290 - Comprehensive error handling and progress reporting291 - Stop-on-error or continue-on-error modes292 - Detailed execution reports with timing and status293294- **`review`**: Comprehensive code review using GitHub Copilot CLI.295 - Multiple review types: `security`, `performance`, `code-quality`, `best-practices`, `architecture`, `testing`, `documentation`, `accessibility`, `comprehensive`296 - Severity filtering: `low`, `medium`, `high`, `critical`297 - Output formats: `markdown`, `json`, `text`298 - Fix suggestions and priority ranking299 - File pattern exclusions and issue limits300301#### Utility Tools302303- **`brainstorm`**: Generate novel ideas with structured methodologies.304 - Multiple frameworks: divergent, convergent, SCAMPER, design-thinking, lateral305 - Domain-specific context (software, business, creative, research, product, marketing)306 - Configurable idea count and analysis depth307 - Includes feasibility, impact, and innovation scoring308 - Example: `brainstorm prompt:"ways to improve code review process" domain:"software" methodology:"scamper"`309310- **`ping`**: A simple test tool that echoes back a message.311 - Use to verify MCP connection is working312 - Example: `/copilot:ping (MCP) "Hello from Copilot MCP!"`313314- **`Help`**: Shows CLI help text for GitHub Copilot.315 - Automatically detects available CLI tools316 - Displays installation instructions if tools are missing317318- **`version`**: Shows version information for all CLI tools and MCP server.319 - Reports GitHub Copilot CLI, Node.js, and MCP server versions320 - Includes installation commands for missing tools321322- **`timeout-test`**: Test tool for timeout prevention.323 - Runs for a specified duration in milliseconds324 - Useful for testing long-running operations325326### Slash Commands (for the User)327328You can use these commands directly in Claude Code's interface (compatibility with other clients has not been tested).329330- **/analyze**: Analyzes files or directories using Copilot, or asks general questions.331 - **`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`).332- **/review**: Performs comprehensive code review using Copilot.333 - **`target`** (required): Files/directories to review (e.g., `/review target:@src/` or `/review target:@main.js`).334 - **`reviewType`** (optional): Type of review - security, performance, code-quality, etc.335- **/batch**: Processes multiple tasks in batch mode.336 - **`tasks`** (required): Array of tasks to process.337- **/help**: Displays CLI help information for available tools.338- **/ping**: Tests the connection to the server.339 - **`message`** (optional): A message to echo back.340341## Acknowledgments342343This project was inspired by the excellent work from [jamubc/gemini-mcp-tool](https://github.com/jamubc/gemini-mcp-tool). Special thanks to [@jamubc](https://github.com/jamubc) for the original MCP server architecture and implementation patterns.344345## Contributing346347Contributions are welcome! Please submit pull requests or report issues through GitHub.348349## License350351This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.352353**Disclaimer:** This is an unofficial, third-party tool and is not affiliated with, endorsed, or sponsored by GitHub or Microsoft.354
Full transparency — inspect the skill content before installing.