github-mcp
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 buildSmoke-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 smokeGitHub-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:githubOpenCode-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_statusgithub_pull_maingithub_create_feature_branchgithub_push_feature_branchgithub_create_pull_requestgithub_prepare_feature_workflow
Sicherheitshinweise
Repositories müssen sich innerhalb von
GITHUB_MCP_ALLOWED_ROOTSbefinden.Es wird kein generisches Shell-Ausführungstool bereitgestellt.
Direkte Pushes auf
mainodermasterwerden 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 --branchvalidiert.
Maintenance
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
- FlicenseNot gradedqualityDmaintenanceStandalone MCP server for GitHub that enables repository management, branch operations, pull request handling, and commit retrieval via tools listed in the README.1
- AlicenseBqualityBmaintenanceSimple MCP server for GitHub operations, currently supports creating repositories.5111MIT
- AlicenseNot gradedqualityDmaintenanceA 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
- FlicenseBqualityBmaintenanceA lightweight MCP server that acts as a secure proxy for AI assistants to run local Git operations and GitHub API macros simultaneously.1
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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