Logo di Gh MCP

Gh MCP

Community
shuymn

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.

Autoreshuymn
Repositorygh-mcp
LinguaGo
Fork
4
Stelle
51
Strumenti disponibili
0
Tipo di trasportostdio
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Gh MCP mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    51 stelle e 4 fork nel repository collegato.

gh-mcp

A GitHub CLI extension that seamlessly runs the github-mcp-server as a bundled binary using your existing gh authentication.

Overview

gh-mcp eliminates the manual setup of GitHub Personal Access Tokens for MCP (Model Context Protocol) servers. It automatically retrieves your GitHub credentials from the gh CLI and launches a bundled github-mcp-server binary with proper authentication.

Prerequisites

Platform Support

gh-mcp runtime support is limited to platforms where bundled github-mcp-server archives are available:

  • darwin/amd64
  • darwin/arm64
  • linux/386
  • linux/amd64
  • linux/arm64
  • windows/386
  • windows/amd64
  • windows/arm64

Release assets may still include additional targets produced by cli/gh-extension-precompile (for example freebsd-* and linux/arm), but those targets are not supported by gh-mcp runtime because no bundled github-mcp-server binary is available for them.

Installation

bash
gh extension install shuymn/gh-mcp

Updating

To update the extension to the latest version:

bash
gh extension upgrade mcp

Usage

MCP Configuration

Add this to your MCP client configuration:

json
{
  "github": {
    "command": "gh",
    "args": ["mcp"]
  }
}

With environment variables:

json
{
  "github": {
    "command": "gh",
    "args": ["mcp"],
    "env": {
      "GITHUB_TOOLSETS": "repos,issues,pull_requests",
      "GITHUB_READ_ONLY": "1"
    }
  }
}

Using with Claude Code

To add this as an MCP server to Claude Code:

bash
claude mcp add-json github '{"command":"gh","args":["mcp"]}'

With environment variables:

bash
claude mcp add-json github '{"command":"gh","args":["mcp"],"env":{"GITHUB_TOOLSETS":"repos,issues","GITHUB_READ_ONLY":"1"}}'

Running Directly

You can also run the server directly:

bash
gh mcp

This will:

  1. 🔐 Retrieve your GitHub credentials from gh CLI
  2. 📦 Extract and verify the bundled MCP server binary
  3. 🚀 Start the MCP server with your credentials
  4. Stream I/O between your terminal and the server process

Press Ctrl+C to gracefully shut down the server.

Configuration

The extension passes through several environment variables to configure the MCP server:

Process Environment Trust Model

gh-mcp starts github-mcp-server with a minimal child-process environment:

  • Required GITHUB_* variables are set by gh-mcp
  • Only a fixed allowlist from the parent process is forwarded (PATH, temp-dir vars, proxy/cert vars)

Proxy variables are intentionally forwarded to support enterprise networks. If you run gh mcp from an untrusted wrapper process, clear proxy/certificate variables before launch.

Toolsets

Control which GitHub API toolsets are available:

bash
# Enable specific toolsets
GITHUB_TOOLSETS="repos,issues,pull_requests" gh mcp

# Enable all toolsets
GITHUB_TOOLSETS="all" gh mcp

Dynamic Toolset Discovery

Enable dynamic toolset discovery (beta feature):

bash
GITHUB_DYNAMIC_TOOLSETS=1 gh mcp

Read-Only Mode

Run the server in read-only mode to prevent modifications:

bash
GITHUB_READ_ONLY=1 gh mcp

Combining Options

You can combine multiple options:

bash
GITHUB_READ_ONLY=1 GITHUB_TOOLSETS="repos,issues" gh mcp

How It Works

  1. The extension retrieves your GitHub credentials from your existing gh CLI authentication
  2. It validates the bundled archive against a pinned SHA256 and extracts the github-mcp-server binary for your platform
  3. Your credentials are securely passed to the server process
  4. The temporary extracted binary is automatically removed when you exit

Troubleshooting

"Not logged in to GitHub"

Run gh auth login to authenticate with GitHub first.

"failed to get default host"

No default GitHub host is configured in gh. Run gh auth status and authenticate/select a default account.

"no bundled github-mcp-server for platform"

Your OS/architecture is not supported by bundled runtime assets. Check Platform Support and use a supported target.

"Bundled binary checksum mismatch"

The bundled binary did not pass integrity verification. Reinstall or upgrade the extension.

"bundled temp parent directory is insecure"

The cache parent directory for extracted binaries failed ownership/permission checks. On Unix-like systems, ensure your user owns the cache path and that permissions are private (for example, 0700).

"server exited with non-zero status: <code>"

The bundled github-mcp-server started but returned an error. Check MCP client configuration and GITHUB_* environment values.

"invalid server environment value"

One of the forwarded environment values contains a line break or NUL byte. Remove control characters from GITHUB_* values before running gh mcp.

Security

  • Your GitHub token is never stored by this extension
  • Credentials are passed to the server process via environment variables
  • Runtime integrity: bundled archives are verified with embedded SHA256 before execution
  • Supply-chain integrity: release update scripts verify GitHub release attestations before pinning SHA256 values in source
  • Trust model note: runtime does not re-run attestation checks; it relies on pinned hashes generated during release asset preparation
  • No data persists after the session ends

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

For development information, see CONTRIBUTING.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Related Projects

Usa MCP Gh MCP con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Gh MCP, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Gh MCP come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Gh MCP.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "gh-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Gh MCP, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Gh MCP.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Gh MCP per aiutarmi con questa attività?
Gh MCP
Certo. Ho letto.
Ecco cosa ho trovato con Gh MCP.

Domande frequenti

A cosa serve il server MCP Gh MCP?

Gh MCP è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Gh MCP MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Gh MCP con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Gh MCP con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Gh MCP, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Gh MCP MCP a TypingMind?

Gh MCP funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Gh MCP MCP in TypingMind?

Gh MCP mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Gh MCP MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Gh MCP richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇