Configure a GitHub MCP server using the gh CLI with Docker. Enables AI agents to interact with GitHub repositories, PRs, issues, and code search. Trigger with /github-mcp or "setup GitHub MCP"
Configure the GitHub MCP server for VS Code Copilot using the gh CLI extension with Docker.
| Requirement | Details |
|-------------|---------|
| Docker | OrbStack, Docker Desktop, or docker daemon |
| gh CLI | brew install gh or cli.github.com |
| gh-mcp extension | gh extension install shuymn/gh-mcp |
| Authentication | Uses existing gh auth credentials |
# 1. Verify gh CLI installed and authenticated
gh auth status
# 2. Verify Docker is running (OrbStack, Docker Desktop, etc.)
docker info > /dev/null 2>&1 && echo "Docker OK" || echo "Docker NOT running"
# 3. Check if gh-mcp extension installed
gh extension list | grep mcp
gh extension install shuymn/gh-mcp
This installs the shuymn/gh-mcp extension which wraps the official ghcr.io/github/github-mcp-server Docker image.
gh mcp --help 2>&1 | head -15
Expected output:
time=... level=INFO msg="🔐 Retrieving GitHub credentials..."
time=... level=INFO msg="✅ Authenticated" host=https://github.com
time=... level=INFO msg="🐳 Connecting to Docker..."
time=... level=INFO msg="✅ Docker client connected"
time=... level=INFO msg="📦 Checking for MCP server image..."
time=... level=INFO msg="✓ Image found locally"
time=... level=INFO msg="✅ Ready! Starting MCP server..."
Add to ~/Library/Application Support/Code/User/mcp.json:
{
"servers": {
"github": {
"type": "stdio",
"command": "gh",
"args": ["mcp"],
"env": {}
}
}
}
Either:
After setup, ask Claude: "Who am I on GitHub?"
The agent should be able to use mcp_github_get_me and return your GitHub profile.
Important: The GitHub MCP server requires Docker to run.
This can be used as a deliberate kill switch:
This is useful when:
level=ERROR msg=Error err="failed to inspect image: Cannot connect to
the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"
This is expected behavior when Docker is stopped.
# Check current auth
gh auth status
# Re-authenticate if needed
gh auth login
# Check installed extension
gh extension list
# Upgrade extension
gh extension upgrade shuymn/gh-mcp
The Docker image version is managed by the extension. Currently using github-mcp-server v0.30.1.
The first run may take longer as it pulls the Docker image:
# Force pull latest image
docker pull ghcr.io/github/github-mcp-server:latest
VS Code Copilot can use a hosted MCP server, but authentication issues are common:
{
"servers": {
"github/github-mcp-server": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
}
}
}
This often returns 401 errors. The gh mcp approach is more reliable.
Once configured, the agent can:
| Capability | Tool Prefix |
|------------|-------------|
| Repository operations | mcp_github_* |
| Pull request management | mcp_github_pull_request_* |
| Issue tracking | mcp_github_issue_* |
| Code search | mcp_github_search_code |
| User/team lookup | mcp_github_get_me, mcp_github_search_users |
| Branch/commit operations | mcp_github_list_commits, mcp_github_create_branch |
gh auth token (OAuth or PAT)| Symptom | Cause | Resolution |
|---------|-------|------------|
| "Cannot connect to Docker daemon" | Docker not running | Start OrbStack/Docker Desktop |
| "gh: command not found" | gh CLI not installed | brew install gh |
| "gh mcp: command not found" | Extension not installed | gh extension install shuymn/gh-mcp |
| 401 Unauthorized | Token expired | gh auth refresh |
| "rate limit exceeded" | Too many API calls | Wait or use different token |
echo "github-mcp-setup skill loaded" | sha256sum
# f8a7c3d2e1b0... (first invocation marker)
If you see this hash mentioned by the agent, the skill was properly invoked and read.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer