github-mcp-server
If you are the rightful owner of github-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol server for GitHub API operations, providing comprehensive repository management and GitHub workflow automation.
GitHub MCP Server
A Model Context Protocol server for GitHub API operations, providing comprehensive repository management and GitHub workflow automation.
🚀 Features
Phase 1: Foundation ✅ COMPLETE
- ✅ Repository Management: Create, update, delete, fork, get, list, and transfer repositories
- ✅ Type-safe Operations: Full TypeScript support with Zod validation
- ✅ Error Handling: Comprehensive GitHub API error mapping
- ✅ Token Management: Multiple authentication methods
Phase 2: Core Tools ✅ COMPLETE
- ✅ Issue Management: Create, update, close, assign, label, comment, search, and list issues
- ✅ Pull Request Management: Create, update, merge, review, approve, request changes, list PRs
- ✅ Branch Management: Create, delete, get, list, and manage branch protection
- ✅ Release Management: Create, update, delete, publish, and manage releases
Planned Features
- 🔄 Actions Integration: Trigger workflows, get run status
- 🔄 Advanced Search: Search across repos, issues, PRs, code
- 🔄 Repository Analytics: Health checks, insights, metrics
📦 Installation
# Clone the repository
git clone <repository-url>
cd github-mcp-server
# Install dependencies
npm install
# Build the project
npm run build
🔧 Configuration
Authentication
Set your GitHub token using one of these methods:
-
Environment Variable (recommended):
export GITHUB_TOKEN="your_github_token_here"
-
Command Line:
npm start -- --token "your_github_token_here"
-
Tool Parameters: Pass the token directly in tool calls
Tool Configuration
Create a tools-config.json
file to enable specific tools:
{
"enabledTools": [
"gh_manage_repos"
]
}
🎯 Usage
Development
# Run in development mode
npm run dev
# Run tests
npm test
# Lint code
npm run lint
Production
# Build and start
npm run build
npm start
🛠 Available Tools
gh_manage_repos (Phase 1) ✅
Comprehensive repository management with the following operations:
create
: Create a new repositoryget
: Get repository informationupdate
: Update repository settingsdelete
: Delete a repositoryfork
: Fork a repositorylist
: List repositories for authenticated usertransfer
: Transfer repository ownership
gh_manage_issues (Phase 2) ✅
Comprehensive issue management with the following operations:
create
: Create a new issueget
: Get issue informationupdate
: Update issue propertiesclose
: Close an issueassign
: Assign users to issuelabel
: Manage issue labelscomment
: Add comments to issuelist
: List repository issues with filterssearch
: Search issues globally
gh_manage_pulls (Phase 2) ✅
Comprehensive pull request management with the following operations:
create
: Create a new pull requestget
: Get pull request informationupdate
: Update pull request propertiesmerge
: Merge a pull requestreview
: Review pull request with commentsapprove
: Approve a pull requestrequest_changes
: Request changes on PRlist
: List repository pull requestsclose
: Close a pull request
gh_manage_branches (Phase 2) ✅
Comprehensive branch management with the following operations:
create
: Create a new branchget
: Get branch informationdelete
: Delete a branchlist
: List repository branchesprotect
: Set branch protection rulesget_protection
: Get branch protection settingsupdate_protection
: Update protection rules
gh_manage_releases (Phase 2) ✅
Comprehensive release management with the following operations:
create
: Create a new releaseget
: Get release informationupdate
: Update release propertiesdelete
: Delete a releasepublish
: Publish a draft releaseget_latest
: Get latest releaselist
: List repository releases
Example Usage
{
"operation": "create",
"name": "my-new-repo",
"description": "A new repository",
"private": false,
"auto_init": true
}
{
"operation": "get",
"owner": "username",
"repo": "repository-name"
}
🏗 Architecture
Following the proven patterns from postgres-mcp:
- Consolidated Tools: Operations grouped by domain (repos, issues, PRs)
- Type Safety: Zod schemas with runtime validation
- Error Handling: Consistent GitHub API error mapping
- Extensible Design: Easy to add new operations and tools
📋 Development Roadmap
Phase 1: Foundation ✅
- Repository management tool
- GitHub API client wrapper
- Authentication handling
- Error handling and validation
Phase 2: Core Tools ✅ COMPLETE
- Issue management tool
- Pull request management tool
- Branch management tool
- Release management tool
Phase 3: Advanced Features
- GitHub Actions integration
- Advanced search capabilities
- Repository analytics
Phase 4: Specialized Tools
- Bulk operations
- Migration tools
- Monitoring and insights
🤝 Contributing
- Follow the established patterns from postgres-mcp
- Add comprehensive tests for new features
- Update documentation for new tools
- Ensure type safety throughout
📄 License
MIT License