Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Wraps GitHub Copilot CLI as an MCP server, enabling MCP clients to run Copilot conversations for code tasks with support for session resumption and permission modes.

README.md

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

Prerequisites

  • Node.js 20.0.0 or higher
  • GitHub Copilot CLI installed and authenticated
  npm install -g @github/copilot-cli
  • GitHub 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 build

Quick start

npm run dev

MCP Tools

run_copilot_conversation

Runs a Copilot CLI conversation with a prompt.

Parameters:

| Name | Type | Required | Description | |------|------|----------|-------------| | prompt | string | ✅ | Prompt to send to Copilot | | model | string | | AI model (e.g., claude-sonnet-4, gpt-4.1) | | cwd | string | | Working directory | | allow_tools | string[] | | List of tools to allow | | add_dirs | string[] | | Additional directories to grant access | | timeout_ms | number | | Timeout (default: 300000ms = 5 minutes) | | permission_mode | string | | Permission mode: "autonomous" (default) or "interactive" |

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 | |------|------|----------|-------------| | session_id | string | ✅ | Session ID (UUID) | | prompt | string | ✅ | Follow-up prompt | | model | string | | AI model | | cwd | string | | Working directory | | timeout_ms | 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 | |------|------|----------|-------------| | session_id | string | ✅ | Pending session ID | | response | string | ✅ | Response ("yes", "no", or free text) |

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 Serverstdio → 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 | |----------|---------|-------------| | COPILOT_CLI_PATH | (auto-detect) | Path to Copilot CLI binary | | COPILOT_PERMISSION_MODE | autonomous | Permission mode: autonomous or interactive |

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=autonomous
  • Runs Copilot CLI with --allow-all-tools --no-ask-user flags
  • Auto-approves all permissions and completes without user prompts
  • Best for: Trusted tasks, automation pipelines, CI/CD

Interactive Mode

COPILOT_PERMISSION_MODE=interactive
  • Runs Copilot CLI with PTY for interactive I/O
  • Returns needsInput: true in the MCP response when a permission prompt is detected
  • The MCP client (user or agent) responds via the respond_to_copilot tool

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 test

How It Works

  1. The MCP client calls the run_copilot_conversation tool
  2. Depending on the permission mode:
  • Autonomous: Runs copilot -p "<prompt>" -s --allow-all-tools --no-ask-user
  • Interactive: Runs with PTY, forwarding permission prompts to the MCP client
  1. Copilot CLI performs the task (code generation, modification, analysis, etc.)
  2. Returns the output as an MCP response upon completion
  3. If a session ID is available, the session can be resumed via resume_copilot_session

Copilot CLI Options Used

| Flag | Purpose | |------|---------| | -p <prompt> | Run prompt in non-interactive mode | | -s | Silent mode (response only, no stats) | | --allow-all-tools | Auto-approve all tools (autonomous mode) | | --no-ask-user | Autonomous operation without prompts (autonomous mode) | | --no-custom-instructions | Ignore AGENTS.md and similar files | | --no-color | Disable ANSI colors | | --no-alt-screen | Disable terminal alternate screen | | --resume <id> | Resume a session | | --model <model> | Select a model | | --add-dir <dir> | Grant access to additional directories |

License

MIT

References

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Developer Tools servers.