mcp-go-github

scopweb/mcp-go-github

3.2

If you are the rightful owner of mcp-go-github and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The GitHub MCP Server is a Go-based server that integrates GitHub with Claude Desktop, allowing users to perform repository operations directly from Claude's interface.

Tools
12
Resources
0
Prompts
0

GitHub MCP Server v3.0

Go-based MCP server that connects GitHub to Claude Desktop, enabling direct repository operations from Claude's interface.

Tools: 82 (with Git) | 48 (without Git) | Architecture: Hybrid (Local Git + GitHub API + Admin Controls)

What's New in v3.0

  • 22 Administrative Tools: Repository settings, branch protection, webhooks, collaborators, teams
  • 4-Tier Safety System: Risk classification (LOW/MEDIUM/HIGH/CRITICAL) with confirmation tokens
  • Git-Free File Operations: Clone, pull, download repos via GitHub API (no Git required)
  • Smart Git Detection: Auto-detects Git availability, filters tools accordingly
  • Audit Logging: JSON-based operation tracking with automatic rotation

Token Permissions Required

Minimum Required:

repo        - Full control of private repositories (essential)

Optional (for full functionality):

delete_repo      - For github_delete_repository
workflow         - For re-running GitHub Actions workflows
security_events  - For dismissing security alerts
admin:repo_hook  - Enhanced webhook management (v3.0)
admin:org        - For team management in organizations (v3.0)

Generate Token:

  1. Go to: GitHub Settings > Personal Access Tokens
  2. Click "Generate new token (classic)"
  3. Select the required scopes
  4. Copy the generated token

Installation

# Install dependencies
go mod tidy

# Compile (using included script)
.\compile.bat          # Windows
./build-mac.bat        # macOS/Linux

# Or compile manually
go build -o mcp-go-github.exe ./cmd/github-mcp-server/

Testing

# Run all tests
go test ./...

# Run tests with verbose output
go test ./... -v

# Run tests for a specific package
go test ./pkg/git/ -v
go test ./pkg/safety/ -v

Claude Desktop Configuration

Multi-profile (Recommended)

{
  "mcpServers": {
    "github-personal": {
      "command": "C:\\path\\to\\mcp-go-github.exe",
      "args": ["--profile", "personal"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_personal_token"
      }
    },
    "github-work": {
      "command": "C:\\path\\to\\mcp-go-github.exe",
      "args": ["--profile", "work"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_work_token"
      }
    }
  }
}

Basic Configuration (Single token)

{
  "mcpServers": {
    "github-mcp": {
      "command": "C:\\path\\to\\mcp-go-github.exe",
      "args": [],
      "env": {
        "GITHUB_TOKEN": "your_token_here"
      }
    }
  }
}

Available Tools (82 Tools)

Git Information (8)

ToolDescriptionTokens
git_statusLocal Git repository status0
git_list_filesList all files in repository0
git_get_file_contentGet file content from Git0
git_get_file_shaGet SHA of specific file0
git_get_last_commitGet last commit SHA0
git_get_changed_filesList modified files0
git_validate_repoValidate if directory is a valid Git repo0
git_contextAuto-detect Git context0

Basic Git Operations (6)

ToolDescriptionTokens
git_set_workspaceSet working directory0
git_addAdd files to staging area0
git_commitCommit changes0
git_pushPush changes to remote0
git_pullPull changes from remote0
git_checkoutSwitch branch or create new0

Git Analysis & Management (7)

ToolDescriptionTokens
git_log_analysisCommit history analysis0
git_diff_filesShow modified files with statistics0
git_branch_listList branches with detailed info0
git_stashStash operations0
git_remoteRemote repository management0
git_tagTag management0
git_cleanClean untracked files0

Advanced Git Operations (7)

ToolDescriptionTokens
git_checkout_remoteCheckout remote branch with tracking0
git_mergeMerge branches with validation0
git_rebaseRebase with specified branch0
git_pull_with_strategyPull with strategies0
git_force_pushPush with --force-with-lease0
git_push_upstreamPush setting upstream0
git_sync_with_remoteSynchronize with remote branch0

Conflict Management (6)

ToolDescriptionTokens
git_safe_mergeSafe merge with backup0
git_conflict_statusConflict status0
git_resolve_conflictsAutomatic resolution0
git_validate_clean_stateValidate clean working directory0
git_detect_conflictsDetect potential conflicts0
git_create_backupCreate backup of current state0

Hybrid Operations (2)

ToolDescriptionTokens
create_fileCreate file (local Git, API fallback)0*
update_fileUpdate file (local Git, API fallback)0*

GitHub API (4)

ToolDescription
github_list_reposList user repositories
github_create_repoCreate new repository
github_list_prsList pull requests
github_create_prCreate new pull request

File Operations - Git-Free (4) [NEW v3.0]

ToolDescription
github_list_repo_contentsList files and directories via API
github_download_fileDownload individual file
github_download_repoClone complete repository via API
github_pull_repoUpdate local directory via API

Dashboard (7)

ToolDescription
github_dashboardGeneral activity panel
github_notificationsPending notifications
github_assigned_issuesAssigned issues
github_prs_to_reviewPRs pending review
github_security_alertsSecurity alerts
github_failed_workflowsFailed workflows
github_mark_notification_readMark notification as read

Response (3)

ToolDescription
github_comment_issueComment on issue
github_comment_prComment on pull request
github_review_prCreate PR review (APPROVE/REQUEST_CHANGES/COMMENT)

Repair (6)

ToolDescription
github_close_issueClose issue
github_merge_prMerge pull request
github_rerun_workflowRe-run workflow
github_dismiss_dependabot_alertDismiss Dependabot alert
github_dismiss_code_alertDismiss Code Scanning alert
github_dismiss_secret_alertDismiss Secret Scanning alert

Repository Admin (4) [NEW v3.0]

ToolRiskDescription
github_get_repo_settingsLOWView repository configuration
github_update_repo_settingsMEDIUMModify name, description, visibility
github_archive_repositoryCRITICALArchive repository (read-only)
github_delete_repositoryCRITICALDelete repository PERMANENTLY

Branch Protection (3) [NEW v3.0]

ToolRiskDescription
github_get_branch_protectionLOWView protection rules
github_update_branch_protectionHIGHConfigure protection rules
github_delete_branch_protectionCRITICALRemove branch protection

Webhooks (5) [NEW v3.0]

ToolRiskDescription
github_list_webhooksLOWList repository webhooks
github_create_webhookMEDIUMCreate webhook
github_update_webhookMEDIUMModify webhook
github_delete_webhookHIGHDelete webhook
github_test_webhookLOWSend test delivery

Collaborators (8) [NEW v3.0]

ToolRiskDescription
github_list_collaboratorsLOWList collaborators
github_check_collaboratorLOWVerify access
github_add_collaboratorMEDIUMInvite with permissions
github_update_collaborator_permissionMEDIUMChange access level
github_remove_collaboratorHIGHRevoke access
github_list_invitationsLOWView pending invitations
github_accept_invitationMEDIUMAccept invitation
github_cancel_invitationMEDIUMCancel invitation

Teams (2) [NEW v3.0]

ToolRiskDescription
github_list_repo_teamsLOWList teams with access
github_add_repo_teamMEDIUMGrant team access

Safety System (v3.0)

4 Risk Levels

LevelDescriptionBehavior (moderate mode)
LOWRead-onlyDirect execution
MEDIUMReversible changesOptional dry-run
HIGHImpacts collaborationRequires confirmation token
CRITICALIrreversibleToken + backup recommendation

Safety Modes

ModeConfirms fromRecommended use
strictMEDIUM+Critical production environments
moderateHIGH+General use (default)
permissiveCRITICALLocal development
disabledNeverNot recommended

Safety Configuration

Create safety.json next to the executable (optional):

{
  "mode": "moderate",
  "enable_audit_log": true,
  "require_confirmation_above": 3,
  "audit_log_path": "./mcp-admin-audit.log",
  "audit_log_max_size_mb": 10,
  "audit_log_max_backups": 5
}

If safety.json doesn't exist, defaults to moderate mode with audit logging enabled.

See safety.json.example for complete configuration reference.

Git-Free Mode (v3.0)

On systems without Git installed (e.g., Mac without Xcode Command Line Tools), the server:

  1. Automatically detects Git absence
  2. Filters git_ tools from listing
  3. Keeps operational all API, admin, dashboard, file operation tools
  4. Returns friendly error if a Git tool is attempted

The 4 File Operations tools (github_list_repo_contents, github_download_file, github_download_repo, github_pull_repo) allow cloning and updating repositories using only the GitHub API, without Git.

Security

  • Prevention of argument injection in Git commands
  • Path Traversal defense
  • Strict user input validation
  • SSRF prevention in webhook URLs (v3.0)
  • Cryptographic confirmation tokens for destructive operations (v3.0)
  • Audit logging of administrative operations (v3.0)

System Requirements

  • Go: 1.25.0 or higher
  • Git: Optional (auto-detected, 48 tools work without Git)
  • github.com/google/go-github: v81.0.0
  • golang.org/x/oauth2: v0.34.0
  • GitHub Token: Minimum repo permission

Project Status

  • 82 operational MCP tools (48 without Git)
  • Hybrid local Git + GitHub API system
  • 22 administrative tools with safety layer
  • 4 Git-free file tools
  • Multi-profile support
  • Complete testing with real repository
  • Production ready (v3.0)

Changelog: See for complete change history

Contributing

We welcome contributions! Please see for guidelines.

License

MIT License - see file for details.

Security

For security issues, please see our .