Copilot Server
The Copilot MCP bridge wraps the copilot -p CLI, exposing it as an MCP server with two tools: ask and code_review.
Tools
ask
Ask GitHub Copilot a freeform question.
Tool: ask
Input:
question: string (required, max 500KB)
Output:
string (text response)
code_review
Send a diff for review.
Tool: code_review
Input:
diff: string (required, max 500KB)
context: string (optional)
Output:
JSON or text (JSON when parseable)
How It Works
- Receives an MCP tool call
- Spawns
copilot -p --output-format jsonas a subprocess - Parses the JSONL output stream (one JSON object per line)
- Extracts the final assistant message
- Attempts to parse the response as structured JSON; falls back to raw text
Configuration
See Environment Variables for all options.
COPILOT_REVIEW_MODEL= # Model override
COPILOT_MCP_HTTP_PORT=8945 # HTTP proxy port