github-copilot-cli-mcp-server
Wraps GitHub Copilot CLI as an MCP server, allowing AI agents to run Copilot conversations, resume sessions, list sessions, and respond to permission prompts for code generation, modification, and analysis tasks.
Click on "Install 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., "@github-copilot-cli-mcp-serverFix the bug in src/main.ts"
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.
github-copilot-cli-mcp-server
⚠️ ALPHA VERSION — This project is experimental and in early development. Testing across different environments is limited. Use at your own risk and expect breaking changes.
A Node.js/TypeScript project that wraps GitHub Copilot CLI as a Model Context Protocol (MCP) server.
Use Copilot CLI as a tool from any MCP-compatible client (VSCode, OpenClaw, Claude Desktop, etc.).
Features
Complete Copilot conversations in a single MCP call: Send a prompt → receive results in one tool call
Session resumption: Continue previous conversations using session IDs
Permission mode selection: Interactive (user confirmation) / Autonomous (auto-approve)
Model selection: Use any model supported by Copilot
Working directory specification: Set cwd for tasks that require file access
Related MCP server: mcp-cli-gemini
Prerequisites
Node.js 20.0.0 or higher
GitHub Copilot CLI installed and authenticated
npm install -g @github/copilot-cliGitHub Copilot subscription (Individual, Business, or Enterprise)
Installation
From source
git clone https://github.com/slcwahn/github-copilot-cli-mcp-server.git
cd github-copilot-cli-mcp-server
npm install
npm run buildQuick start
npm run devMCP Tools
run_copilot_conversation
Runs a Copilot CLI conversation with a prompt.
Parameters:
Name | Type | Required | Description |
| string | ✅ | Prompt to send to Copilot |
| string | AI model (e.g., | |
| string | Working directory | |
| string[] | List of tools to allow | |
| string[] | Additional directories to grant access | |
| number | Timeout (default: 300000ms = 5 minutes) | |
| string | Permission mode: |
Example:
{
"name": "run_copilot_conversation",
"arguments": {
"prompt": "Fix the bug in src/main.ts",
"cwd": "/path/to/project",
"model": "claude-sonnet-4"
}
}resume_copilot_session
Resumes a previous session to continue the conversation.
Parameters:
Name | Type | Required | Description |
| string | ✅ | Session ID (UUID) |
| string | ✅ | Follow-up prompt |
| string | AI model | |
| string | Working directory | |
| number | Timeout |
Example:
{
"name": "resume_copilot_session",
"arguments": {
"session_id": "abc12345-1234-5678-9abc-def012345678",
"prompt": "Now add tests for those changes"
}
}list_copilot_sessions
Lists resumable Copilot CLI sessions.
respond_to_copilot
Responds to Copilot's permission prompts in Interactive mode.
Parameters:
Name | Type | Required | Description |
| string | ✅ | Pending session ID |
| string | ✅ | Response ( |
Configuration
VSCode
Add the following to your .vscode/mcp.json file:
{
"servers": {
"github-copilot-cli": {
"type": "stdio",
"command": "node",
"args": ["/path/to/github-copilot-cli-mcp-server/dist/index.js"],
"env": {
"COPILOT_PERMISSION_MODE": "interactive"
}
}
}
}Or use the Command Palette: MCP: Add Server → stdio → enter the configuration above.
Tip: Use
${workspaceFolder}to specify relative paths based on your workspace.
For global configuration, use the Command Palette: MCP: Open User Configuration to add it to your user profile.
OpenClaw (mcporter)
OpenClaw supports MCP servers through the mcporter skill.
Register via mcporter CLI
# Register the server
mcporter config add github-copilot-cli \
--command node \
--arg /path/to/github-copilot-cli-mcp-server/dist/index.js \
--env COPILOT_PERMISSION_MODE=autonomous
# Verify registration
mcporter list
# Check tool schema
mcporter list github-copilot-cli --schema
# Call a tool directly
mcporter call github-copilot-cli.run_copilot_conversation prompt="Fix the bug in main.ts"Edit mcporter config file directly
~/.mcporter/mcporter.json or project-level config/mcporter.json:
{
"servers": {
"github-copilot-cli": {
"transport": "stdio",
"command": "node",
"args": ["/path/to/github-copilot-cli-mcp-server/dist/index.js"],
"env": {
"COPILOT_PERMISSION_MODE": "autonomous"
}
}
}
}Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"github-copilot-cli": {
"command": "node",
"args": ["/path/to/github-copilot-cli-mcp-server/dist/index.js"]
}
}
}Environment Variables
Variable | Default | Description |
| (auto-detect) | Path to Copilot CLI binary |
|
| Permission mode: |
Permission Handling
Copilot CLI may request user approval for file modifications, shell command execution, and other actions. This MCP server supports two permission modes:
Autonomous Mode (default)
COPILOT_PERMISSION_MODE=autonomousRuns Copilot CLI with
--allow-all-tools --no-ask-userflagsAuto-approves all permissions and completes without user prompts
Best for: Trusted tasks, automation pipelines, CI/CD
Interactive Mode
COPILOT_PERMISSION_MODE=interactiveRuns Copilot CLI with PTY for interactive I/O
Returns
needsInput: truein the MCP response when a permission prompt is detectedThe MCP client (user or agent) responds via the
respond_to_copilottool
Interactive Mode Flow:
MCP Client MCP Server Copilot CLI
│ │ │
│ run_copilot_conversation │ │
├─────────────────────────────►│ spawn (PTY) │
│ ├───────────────────────────►│
│ │ │
│ │ "Modify this file?" │
│ │◄───────────────────────────┤
│ { needsInput: true, │ │
│ question: "Modify..." } │ │
│◄─────────────────────────────┤ │
│ │ │
│ respond_to_copilot("yes") │ │
├─────────────────────────────►│ write "yes\n" │
│ ├───────────────────────────►│
│ │ │
│ │ (complete) │
│ │◄───────────────────────────┤
│ { output: "..." } │ │
│◄─────────────────────────────┤ │Note: Interactive mode requires
node-pty(optional dependency). If not installed, it automatically falls back to autonomous mode.
Architecture
MCP Client (VSCode / OpenClaw / Claude Desktop)
│
│ stdio (JSON-RPC)
▼
┌──────────────────────────────────────────────┐
│ github-copilot-cli-mcp-server │
│ │
│ ┌────────────────────────────────────────┐ │
│ │ MCP Server (stdio) │ │
│ │ - run_copilot_conversation │ │
│ │ - resume_copilot_session │ │
│ │ - list_copilot_sessions │ │
│ │ - respond_to_copilot │ │
│ └──────────────┬─────────────────────────┘ │
│ │ │
│ ┌──────────────▼─────────────────────────┐ │
│ │ Permission Handler │ │
│ │ (autonomous / interactive) │ │
│ └──────────────┬─────────────────────────┘ │
│ │ │
│ ┌──────────────▼─────────────────────────┐ │
│ │ Copilot Runner │ │
│ │ (spawn / PTY) │ │
│ └──────────────┬─────────────────────────┘ │
│ │ │
│ ┌──────────────▼─────────────────────────┐ │
│ │ Session Manager │ │
│ │ (session metadata + pending input) │ │
│ └────────────────────────────────────────┘ │
└──────────────────────────────────────────────┘
│
│ spawn / PTY
▼
copilot -p "prompt" -s [--allow-all-tools | interactive]Development
# Development mode
npm run dev
# Build
npm run build
# Type check
npm run typecheck
# Test
npm testHow It Works
The MCP client calls the
run_copilot_conversationtoolDepending on the permission mode:
Autonomous: Runs
copilot -p "<prompt>" -s --allow-all-tools --no-ask-userInteractive: Runs with PTY, forwarding permission prompts to the MCP client
Copilot CLI performs the task (code generation, modification, analysis, etc.)
Returns the output as an MCP response upon completion
If a session ID is available, the session can be resumed via
resume_copilot_session
Copilot CLI Options Used
Flag | Purpose |
| Run prompt in non-interactive mode |
| Silent mode (response only, no stats) |
| Auto-approve all tools (autonomous mode) |
| Autonomous operation without prompts (autonomous mode) |
| Ignore AGENTS.md and similar files |
| Disable ANSI colors |
| Disable terminal alternate screen |
| Resume a session |
| Select a model |
| Grant access to additional directories |
License
MIT
References
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/slcwahn/github-copilot-cli-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server