GitHub Copilot CLI

Wraps the GitHub Copilot CLI to provide MCP-compatible command suggestions, explanations, aliases, and configuration via STDIO or SSE transports.
  • python

0

GitHub Stars

python

Language

7 months ago

First Indexed

3 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "wminson-copilot-mcp-server": {
      "command": "python",
      "args": [
        "server.py"
      ],
      "env": {
        "MCP_SERVER_HOST": "0.0.0.0",
        "MCP_SERVER_PORT": "8602"
      }
    }
  }
}

You can run and use the GitHub Copilot CLI MCP Server to access Copilot-powered command suggestions, explanations, and aliases through a simple MCP interface. It supports both local STDIO and network SSE transports, making it easy to integrate Copilot capabilities into your development workflows.

How to use

Start by running the server locally for use with an MCP client that connects via STDIO, or run the SSE variant to expose a network endpoint you can query from remote clients. You can request command suggestions for shells, Git, or GitHub CLI, ask for explanations of complex commands, and generate shell aliases or Copilot configuration views.

How to install

Prerequisites you need to have installed before running the server include the following.

  • Python 3.10 or newer
  • GitHub CLI (gh) installed
  • GitHub Copilot extension for gh installed via gh extension install github/gh-copilot
  • A GitHub Copilot subscription (Individual, Business, or Enterprise)

Option 1: Install from source

cd /home/ward/MCP/copilot_mcp_server
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Option 2: Install with pip
pip install -e .

Usage for local and network transports is shown below. Choose the command that matches your deployment preference.

Configuration and environment

Environment variables control where the SSE server binds and which port it listens on. The default values are:

  • MCP_SERVER_HOST: 0.0.0.0
  • MCP_SERVER_PORT: 8602

You can override these when starting the SSE server, for example with: MCP_SERVER_HOST=0.0.0.0 MCP_SERVER_PORT=8602 python server_sse.py.

Examples

Get a shell command suggestion for a task

copilot_suggest_shell(prompt="Find all files larger than 100MB")

Explain a complex command to understand what it does

copilot_explain(command="find . -name '*.log' -mtime +30 -delete")

Systemd Service (Optional)

If you want to run the SSE server as a systemd user service, you can create a unit like the following.

[Unit]
Description=GitHub Copilot MCP Server
After=network.target

[Service]
Type=simple
WorkingDirectory=/home/ward/MCP/copilot_mcp_server
ExecStart=/home/ward/MCP/copilot_mcp_server/venv/bin/python server_sse.py
Restart=always
RestartSec=5
Environment=MCP_SERVER_PORT=8602

[Install]
WantedBy=default.target

Tools and capabilities

The server exposes several tools that you can call from an MCP client. These tools cover generation of command suggestions, explanations, and shell aliases.

Notes and tips

If you prefer local development, running the STDIO variant keeps all processing on your machine. If you need to access the server from other machines or services, use the SSE variant and expose the port you configured.

Troubleshooting

If you encounter connection issues, verify that the server process is running and listening on the configured host/port. Check that Python 3.10+ is active in your virtual environment and that the Copilot CLI extension is installed and functioning.

Security considerations

Limit network exposure for the SSE server to trusted networks, use firewalls or reverse proxies as needed, and manage access at the client level. Keep dependencies up to date to mitigate security risks.

Available tools

copilot_suggest

Return a command suggestion from GitHub Copilot based on a natural language prompt and a target type (shell, gh, or git).

copilot_suggest_shell

Provide a shell command suggestion for a natural language prompt.

copilot_suggest_git

Offer a git command suggestion based on a natural language prompt.

copilot_suggest_gh

Offer a GitHub CLI command suggestion based on a natural language prompt.

copilot_explain

Explain what a given command does using Copilot's guidance.

copilot_version

Return version information for the Copilot CLI.

copilot_help

Provide help information for Copilot commands; optionally for a specific command.

copilot_config_get

Retrieve GitHub Copilot CLI configuration values.

copilot_alias

Generate shell aliases to simplify Copilot-related commands.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational