Skip to main content
Glama
ohaiibuzzle

Copilot MCP Server

by ohaiibuzzle
README.md
# Copilot MCP Server

This (horrible horrible) project provides MCP servers that wrap the `copilot` CLI so third-party MCP clients can invoke Copilot through tools.

## Exposed tools

- `copilot_prompt`: Runs `copilot -p "<prompt>"` in non-interactive mode.
  - Supports session continuity:
    - `session_id` -> `--session-id <id>`
    - `resume_session` -> `--resume=<id-or-name>`
    - `continue_session=true` -> `--continue`
  - Exactly one session mode can be selected per call.
- `copilot_command`: Runs general `copilot ...` commands (interactive/server flags are blocked).

Tool return structured output with:

- `ok`
- `command`
- `exit_code` (when executed)
- `stdout`
- `stderr`

## Requirements

- `copilot` CLI installed and authenticated
- Python 3.10+ (for Python server)

Optionally set `COPILOT_BIN` if `copilot` is not in PATH.

## Python setup

```bash
git clone ...
uv init .
uv --directory . run copilot_mcp_server.py 
```

Run:

```bash
copilot-mcp-server
```

## Example MCP client config

Python server:

```json
{
  "mcpServers": {
    "copilot-as-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "~/Copilot-as-MCP",
        "run",
        "copilot_mcp_server.py"
      ]
    }
  }
}
```

## Session examples

- Continue with a known session ID:
  - `copilot_prompt(prompt="Refine the previous answer", session_id="...")`
- Resume by session/task identifier:
  - `copilot_prompt(prompt="Continue this task", resume_session="...")`
- Continue most recent session:
  - `copilot_prompt(prompt="Continue", continue_session=true)`

TDQS

B3.4/5.0

Scored across 2 tools

Disambiguation2/5

copilot_prompt and copilot_command overlap significantly since copilot_command can also run prompts, making it unclear which tool to use for a prompt task. The descriptions provide some clarity but do not fully resolve the boundary.

Naming Consistency5/5

Both tool names follow a consistent 'copilot_<mode>' pattern with snake_case, which is predictable and easy to remember. The naming is uniform and well-aligned with the server's purpose.

Tool Count3/5

With only 2 tools, the server is minimal but matches the narrow scope of wrapping the Copilot CLI. However, the presence of a general command makes the prompt-specific tool feel somewhat redundant, and the count is at the low end of reasonable.

Completeness3/5

The general copilot_command covers all CLI operations, avoiding dead ends, but the server lacks specialized tools for common Copilot workflows such as auth, session management, or structured prompt handling. The surface is functional yet sparse.

Maintenance

ActivitySlowing
ResponsivenessNo issues