Skip to main content
Glama

GitHub MCP-Server

Lokaler OpenCode MCP-Server für sichere GitHub-Entwickler-Workflows: main abrufen, einen Feature-Branch erstellen, diesen pushen und einen Pull Request öffnen, der bereit zur Überprüfung ist.

Umgebung

Setzen Sie diese Variablen in Ihrer Shell. Committen Sie keine echten Geheimnisse.

export GH_TOKEN="your_github_token_here"
export GITHUB_MCP_ALLOWED_ROOTS="/Users/matiasbinagora/Projects"
export GITHUB_MCP_DEFAULT_BASE_BRANCH="main"
export GITHUB_MCP_DEFAULT_REMOTE="origin"
export GITHUB_MCP_REQUIRE_CLEAN_WORKTREE="true"

GH_TOKEN wird empfohlen. Wenn es nicht gesetzt ist, kann der Server dennoch funktionieren, wenn gh bereits lokal authentifiziert ist.

Related MCP server: GitHub MCP Server

Build

npm install
npm run build

Smoke-Test

Dies erstellt ein temporäres lokales Bare-Repo, ruft main ab, erstellt einen Test-Branch, committet eine Datei, pusht den Branch und überprüft, ob der Remote-Branch existiert.

npm run smoke

GitHub-Integrationstest

Dies erstellt einen echten Branch und einen PR, der bereit zur Überprüfung ist, im konfigurierten Test-Repo.

export GITHUB_MCP_SMOKE_REPO_PATH="/Users/matiasbinagora/Projects/binagora"
npm run smoke:github

OpenCode-Konfiguration

Fügen Sie dies zur globalen OpenCode-Konfiguration unter ~/.config/opencode/opencode.json hinzu.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "github": {
      "type": "local",
      "command": ["node", "/Users/matiasbinagora/Projects/github-mcp/dist/index.js"],
      "enabled": true,
      "environment": {
        "GH_TOKEN": "{env:GH_TOKEN}",
        "GITHUB_MCP_ALLOWED_ROOTS": "/Users/matiasbinagora/Projects",
        "GITHUB_MCP_DEFAULT_BASE_BRANCH": "main",
        "GITHUB_MCP_DEFAULT_REMOTE": "origin",
        "GITHUB_MCP_REQUIRE_CLEAN_WORKTREE": "true"
      }
    }
  }
}

Wenn OpenCode gestartet wird, bevor Ihre Shell GH_TOKEN exportiert, verwenden Sie stattdessen diesen Befehl, damit der MCP-Server ~/.zshrc vor dem Start lädt:

"command": [
  "zsh",
  "-lc",
  "source \"$HOME/.zshrc\" >/dev/null 2>&1; exec node \"/Users/matiasbinagora/Projects/github-mcp/dist/index.js\""
]

Tools

  • github_repo_status

  • github_pull_main

  • github_create_feature_branch

  • github_push_feature_branch

  • github_create_pull_request

  • github_prepare_feature_workflow

Sicherheitshinweise

  • Repositories müssen sich innerhalb von GITHUB_MCP_ALLOWED_ROOTS befinden.

  • Es wird kein generisches Shell-Ausführungstool bereitgestellt.

  • Direkte Pushes auf main oder master werden verweigert.

  • Force-Pushes und das Löschen von Branches sind nicht implementiert.

  • Ein sauberer Worktree ist standardmäßig erforderlich, bevor Pulls, Branch-Erstellungen und PR-Erstellungen durchgeführt werden.

  • Branch-Namen werden mit git check-ref-format --branch validiert.

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Standalone MCP server for GitHub that enables repository management, branch operations, pull request handling, and commit retrieval via tools listed in the README.
    1
  • A
    license
    Not graded
    quality
    D
    maintenance
    A lightweight MCP server that handles git operations on behalf of AI coding assistants, running as a local HTTP service without external network exposure by default.
    MIT
  • F
    license
    B
    quality
    B
    maintenance
    A lightweight MCP server that acts as a secure proxy for AI assistants to run local Git operations and GitHub API macros simultaneously.
    1

View all related MCP servers

Related MCP Connectors

  • A MCP server built for developers enabling Git based project management with project and personal…

  • An MCP server that gives your AI access to the source code and docs of all public github repos

  • MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/matiasnjacob/github-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server