gh-mcp
A thin wrapper around the gh CLI that enables executing any gh command via MCP. It passes commands directly to gh without filtering, leveraging your GitHub authentication.
README
gh-mcp
This is a very thin wrapper around the gh CLI.
Security
This server passes any command directly to gh without filtering. It can do anything your authenticated GitHub token allows.
To control what the server can do, scope your token:
- Recommended: Create a fine-grained personal access token with only the repository access and permissions your AI tool needs.
- Alternatively: Use a classic PAT with the minimum required scopes.
The server prevents shell injection by design — commands are passed as argument arrays to Bun.spawn, never interpolated into a shell string.
Installation
1. Install the GitHub CLI
Download the GitHub CLI. Or use brew install gh. Verify your installation.
gh --version
2. Install bun
This project uses bun for package management. Verify your installation.
bun --version
3. Clone the repo and install dependencies
git clone https://github.com/jarrettmeyer/gh-mcp.git
cd gh-mcp
bun install
4. Add the server to your MCP client
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Note: bun installs to ~/.bun/bin/, which is not on the default PATH. Use the full path to the bun executable.
{
"mcpServers": {
"gh": {
"command": "/Users/your-username/.bun/bin/bun",
"args": ["run", "/path/to/gh-mcp/src/index.ts"]
}
}
}
Restart Claude Desktop.
Claude Code
Install from your terminal:
claude mcp add gh -- bun run /path/to/gh-mcp/src/index.ts
If gh is in a non-standard location, pass GH_PATH via --env:
claude mcp add gh --env GH_PATH=/opt/homebrew/bin/gh -- bun run /path/to/gh-mcp/src/index.ts
Usage
send_command
Execute a gh CLI command. Pass everything that would follow gh on the command line as the command string.
| Parameter | Type | Description |
|---|---|---|
command |
string | The gh subcommand and arguments to run |
Examples:
List open pull requests in a repo:
command: "pr list --repo owner/repo"
View an issue:
command: "issue view 42 --repo owner/repo"
Check the authenticated user:
command: "auth status"
This tool works with any MCP-compatible client, including Claude Desktop, Claude Code, and Cursor.
Additional Configuration
GH_PATH
By default, the server resolves gh from your PATH. If gh is installed in a non-standard location (e.g. Homebrew on Apple Silicon), set GH_PATH to its absolute path:
{
"mcpServers": {
"gh": {
"command": "/Users/your-username/.bun/bin/bun",
"args": ["run", "/path/to/gh-mcp/src/index.ts"],
"env": {
"GH_PATH": "/opt/homebrew/bin/gh"
}
}
}
}
Resources
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.