Get the FREE Ultimate OpenClaw Setup Guide →

gh

A GitHub CLI extension that seamlessly runs the github-mcp-server using your existing gh authentication. Eliminates manual PAT setup by automatically retrieving GitHub credentials and launching the MCP server with proper authentication.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio shuymn-gh-mcp gh mcp

How to use

gh-mcp is a GitHub CLI extension that bundles and runs the github-mcp-server using your existing gh authentication. It eliminates the need to manually generate or manage GitHub Personal Access Tokens for MCP by retrieving your credentials from gh and launching a bundled github-mcp-server binary on your current platform. The server then exposes MCP capabilities (via the MCP client) using the credentials obtained from gh, enabling toolsets to query and interact with GitHub data through the MCP protocol.

To use it, install the extension and start the server either directly or by configuring your MCP client to point at the gh mcp server. You can run the server directly with gh mcp, which will automatically handle credential extraction, integrity checks for the bundled binary, and process I/O streaming. For Claude Code or other MCP clients, add the server via your MCP configuration by specifying command: "gh" and args: ["mcp"], with optional environment variables to tailor toolsets (for example enabling repos, issues, and pull_requests) or to enable read-only mode.

How to install

Prerequisites:

  • GitHub CLI (gh) installed and authenticated (gh auth login)
  • This extension package repo released assets containing a bundled github-mcp-server binary for your platform

Installation steps:

  1. Install the extension from the GitHub CLI extension registry:
gh extension install shuymn/gh-mcp
  1. Verify installation:
gh mcp --help
  1. (Optional) Update to the latest version when available:
gh extension upgrade gh-mcp

Notes:

  • The extension fetches and verifies a pinned SHA256 of the bundled server binary before execution.
  • It forwards only a minimal set of environment variables to the server (authentication-related GITHUB_* vars plus a controlled allowlist from the parent process).
  • If your platform is not supported by the bundled binaries, you will see an appropriate error message and should use a supported target or build from source if available.

Additional notes

  • Platform support is limited to architectures where bundled github-mcp-server binaries exist (darwin/amd64, darwin/arm64, linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, windows/arm64).
  • If you encounter "Not logged in to GitHub" ensure you have run gh auth login and that gh can access a default host.
  • Read-Only mode and dynamic toolset discovery are configurable via GITHUB_READ_ONLY, GITHUB_TOOLSETS, and GITHUB_DYNAMIC_TOOLSETS environment variables when starting the server.
  • If you see "no bundled github-mcp-server for platform", this indicates the current platform target is not supported by the bundled assets; use a supported platform or compile a compatible binary if available.

Related MCP Servers

Sponsor this space

Reach thousands of developers