GitHub MCP Server
Enables comprehensive interaction with GitHub repositories, including code management, issues, pull requests, and full GitHub Actions workflow control with triggering, monitoring, and artifact management capabilities.
README
GitHub MCP Server
A comprehensive Model Context Protocol server for GitHub integration, providing access to repositories, issues, pull requests, commits, releases, and GitHub Actions workflows.
🔒 Publishing-Safe Setup
This MCP is designed to be safely published without exposing sensitive credentials.
Environment Configuration
DO NOT store your GitHub token in the MCP directory. Instead, use one of these secure methods:
Method 1: External Environment File (Recommended)
Store your environment file outside the project:
# Create secure environment directory
mkdir -p ~/.config/mcp-environments
# Create GitHub environment file
cat > ~/.config/mcp-environments/github.env << EOF
GITHUB_TOKEN=your_personal_access_token
GITHUB_OWNER=your_github_username
EOF
Method 2: Claude Desktop Config (Most Secure)
Store credentials directly in your Claude Desktop configuration (recommended for production).
Features
Repository Management
- List repositories with filtering and sorting
- Get detailed repository information
- Browse branches and file contents
- Search code across repositories
Issue Management
- List issues with filtering by state, labels, assignee
- Get detailed issue information
- Create new issues with labels and assignees
Pull Request Management
- List pull requests with filtering
- Get detailed PR information including stats
- Track PR status and mergeability
Commit & Release Tracking
- List commits with filtering by date, path, branch
- Get detailed commit information with file changes
- List releases and get latest release info
🔄 GitHub Actions & Workflows (NEW!)
- Workflow Management: List all workflows in repositories
- Run Monitoring: Track workflow runs with real-time status updates
- Job Details: Get detailed information about individual jobs
- Execution Control: Cancel, re-run, or re-run failed jobs
- Workflow Dispatch: Trigger workflows with custom inputs
- Artifact Management: List and download workflow artifacts
- Usage Analytics: Get workflow usage statistics and billing info
- Status Tracking: Monitor CI/CD pipeline health with status emojis
User Information
- Get authenticated user details
- Look up other user profiles
Setup
1. Install Dependencies
cd github-actions-mcp-server
npm install
2. Create GitHub Personal Access Token
- Go to GitHub → Settings → Developer Settings → Personal Access Tokens → Tokens (classic)
- Create new token with these scopes:
- repo - Full repository access
- actions:read - Read workflow information
- actions:write - Trigger and manage workflows
- read:user - Read user profile data
- read:org - Read organization data (if using organization)
3. Configure Environment
Secure Method: External Environment File
# Create environment file outside project
cat > ~/.config/mcp-environments/github.env << EOF
GITHUB_TOKEN=your_personal_access_token
GITHUB_OWNER=your_github_username
EOF
Most Secure: Claude Desktop Config Only
Add directly to Claude Desktop config with no environment files.
Claude Desktop Configuration
Method 1: External Environment File
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["tsx", "/path/to/github-actions-mcp-server/src/index.ts"],
"envFile": "~/.config/mcp-environments/github.env"
}
}
}
Method 2: Direct Environment Variables (Most Secure)
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["tsx", "/path/to/github-actions-mcp-server/src/index.ts"],
"env": {
"GITHUB_TOKEN": "your_personal_access_token",
"GITHUB_OWNER": "your_github_username"
}
}
}
}
Usage Examples
Once configured, you can ask Claude things like:
Repository & Code Management
- "List my repositories sorted by last updated"
- "Show me the open issues in my project-name repository"
- "Get the content of README.md from my repo"
- "What are the recent commits in the main branch?"
- "Create an issue titled 'Bug fix needed' in my repo"
- "Search for 'authentication' across all my repositories"
🔄 GitHub Actions & Workflows
- "Show me all workflows in my repository"
- "What are the recent workflow runs for my project?"
- "Check the status of workflow run #123"
- "Show me failed GitHub Actions runs"
- "Cancel the currently running workflow"
- "Re-run the failed jobs in the last workflow"
- "Trigger the deployment workflow with production environment"
- "List artifacts from the latest build"
- "How much GitHub Actions usage have I consumed this month?"
Available Tools
Core Repository Tools
list_repositories- List repositories with filtering/sortingget_repository- Get detailed repository infoget_file_content- Get file/directory contentsearch_code- Search code across reposlist_issues- List issues with filteringcreate_issue- Create new issueslist_pull_requests- List PRs with filteringlist_commits- List commits with filteringget_user_info- Get user profile information
🔄 GitHub Actions Tools
list_workflows- List all workflows in a repositoryget_workflow- Get details of a specific workflowlist_workflow_runs- List workflow runs with status filteringget_workflow_run- Get detailed information about a specific runget_workflow_run_jobs- Get jobs for a workflow runcancel_workflow_run- Cancel a running workflowrerun_workflow- Re-run an entire workflowrerun_failed_jobs- Re-run only failed jobstrigger_workflow_dispatch- Trigger workflows with custom inputslist_workflow_artifacts- List artifacts from workflow runsdownload_artifact- Get artifact download informationget_workflow_usage- Get workflow usage statistics
🔄 Workflow Examples
Monitor CI/CD Pipeline
# Check all recent workflow runs
"Show me the status of recent workflow runs"
# Get detailed information about a specific run
"Get details for workflow run #142"
# Check which jobs failed
"Show me the jobs for workflow run #142"
Automate Deployments
# Trigger a deployment workflow
"Trigger the deploy workflow for production environment"
# With custom inputs
"Run the deploy workflow with version=1.2.3 and environment=staging"
# Monitor deployment progress
"Check the status of the latest deployment workflow"
Troubleshoot Failed Builds
# Find failed runs
"Show me failed workflow runs from the last week"
# Get job details
"What jobs failed in workflow run #140?"
# Re-run failed jobs
"Re-run the failed jobs in workflow #140"
Manage Artifacts
# List available artifacts
"Show me artifacts from the latest build"
# Download specific artifacts
"Get download info for artifact #12345"
Security Notes
- ✅ Publishing Safe: No sensitive data stored in code repository
- ✅ Environment Isolation: Credentials stored outside project directory
- ✅ .gitignore Protection: Comprehensive ignore patterns prevent accidental commits
- ✅ Minimal Permissions: Only request necessary GitHub scopes
- ✅ External Storage: Use
~/.config/mcp-environments/for credentials - ✅ Actions Security: Workflow triggers respect repository permissions
Publishing Checklist
Before publishing this MCP:
- ✅ No
.envfiles in the repository - ✅ No hardcoded tokens or credentials
- ✅
.gitignoreincludes comprehensive patterns - ✅ README documents secure setup methods
- ✅ Example configurations use placeholders
Troubleshooting
Common Issues
-
Authentication Failed
- Verify your PAT is correct and has required scopes
- For workflows: ensure token has
actions:readandactions:writescopes - Check that GITHUB_OWNER matches your username/org
-
Environment File Not Found
- Ensure the environment file path in Claude config is correct
- Check file permissions on the environment file
-
Rate Limiting
- GitHub API has rate limits (5000 requests/hour for authenticated users)
- The MCP will show rate limit errors if exceeded
-
Workflow Dispatch Failed
- Ensure the workflow file has
workflow_dispatchtrigger configured - Verify workflow inputs match the schema defined in the workflow file
- Check that the branch/ref exists
- Ensure the workflow file has
-
Cannot Cancel/Re-run Workflows
- Verify your token has
actions:writepermission - Ensure you have push access to the repository
- Some workflows may not be cancellable if they're already completed
- Verify your token has
Version History
- v0.2.0 - Added comprehensive GitHub Actions and workflow support
- v0.1.0 - Initial release with repository, issues, and PR management
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。