GitHub MCP Server
Provides tools for interacting with GitHub's API, enabling triggering repository dispatch events, creating issues, and retrieving repository information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitHub MCP ServerTrigger a 'deploy-staging' repository dispatch on octo-org/website"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GitHub MCP Server
A Model Context Protocol (MCP) server that integrates with GitHub's API to provide tools for automation and workflow orchestration. This server enables triggering repository dispatch events, creating issues, and retrieving repository information.
Features
π― Repository Dispatch: Trigger GitHub
repository_dispatchevents with custom event types and JSON payloads (with full ζ₯ζ¬θͺ support)π Issue Creation: Create GitHub issues as a fallback mechanism
π Repository Information: Retrieve detailed repository metadata
π Secure Authentication: PAT-based authentication with environment variable management
π§ͺ Comprehensive Testing: Full pytest coverage with unit tests
π Japanese Language Support: Handle Japanese characters in payloads and metadata
Related MCP server: GitHub MCP Server
Prerequisites
Python 3.9+
A GitHub Personal Access Token (PAT) with
repoandworkflowscopesgitfor version control
Installation
From Source
git clone https://github.com/ai-info-x/github-mcp-server.git
cd github-mcp-server
pip install -e .With Development Dependencies
pip install -e ".[dev]"Authentication Setup
Step 1: Generate GitHub Personal Access Token
Click Generate new token (classic)
Give it a descriptive name:
github-mcp-serverSelect required scopes:
β
repo(full control of private repositories)β
workflow(update GitHub Action workflows)
Set expiration (90 days recommended)
Click Generate token and copy the token immediately
Step 2: Configure Environment
Option A: Using .env File (Recommended)
# Copy the template
cp .env.template .env
# Edit .env with your token
# GITHUB_TOKEN=ghp_your_token_hereOption B: Export Environment Variable
export GITHUB_TOKEN="ghp_your_token_here"Option C: System-wide Configuration
# Permanently set in ~/.bashrc or ~/.zshrc
echo 'export GITHUB_TOKEN="ghp_your_token_here"' >> ~/.bashrc
source ~/.bashrcβ οΈ Security Note: Never commit .env to version control. The .gitignore already excludes it.
Usage
Running the MCP Server
# With environment variable set
GITHUB_TOKEN=ghp_your_token_here python -m src.github_mcp_server
# Or with .env file
python -m src.github_mcp_serverAvailable Tools
1. trigger_repository_dispatch
Trigger a custom repository dispatch event.
Parameters:
owner(string, required): Repository owner (username or organization)repo(string, required): Repository nameevent_type(string, required): Event type identifier (e.g.,my-event,build-trigger)payload(object, optional): Event payload as JSON object
Example:
{
"owner": "ai-info-x",
"repo": "my-repo",
"event_type": "build-release",
"payload": {
"version": "v1.0.0",
"message": "Release build initiated",
"η°ε’": "ζ¬ηͺ" # Japanese characters supported
}
}Response:
{
"success": true,
"message": "Repository dispatch 'build-release' triggered successfully",
"owner": "ai-info-x",
"repo": "my-repo",
"event_type": "build-release",
"payload": {
"version": "v1.0.0",
"message": "Release build initiated",
"η°ε’": "ζ¬ηͺ"
}
}2. create_issue
Create a GitHub issue (useful as a fallback when dispatch fails).
Parameters:
owner(string, required): Repository ownerrepo(string, required): Repository nametitle(string, required): Issue titlebody(string, optional): Issue descriptionlabels(array, optional): Issue labels (e.g.,["bug", "urgent"])
Example:
{
"owner": "ai-info-x",
"repo": "my-repo",
"title": "Auto-generated notification",
"body": "This issue was created as a fallback notification",
"labels": ["automated", "notification"]
}Response:
{
"success": true,
"message": "Issue created successfully",
"issue_number": 42,
"issue_url": "https://github.com/ai-info-x/my-repo/issues/42",
"title": "Auto-generated notification"
}3. get_repository_info
Retrieve comprehensive repository information.
Parameters:
owner(string, required): Repository ownerrepo(string, required): Repository name
Example:
{
"owner": "ai-info-x",
"repo": "github-mcp-server"
}Response:
{
"success": true,
"name": "github-mcp-server",
"full_name": "ai-info-x/github-mcp-server",
"description": "MCP Server with GitHub repository_dispatch API integration",
"url": "https://github.com/ai-info-x/github-mcp-server",
"clone_url_https": "https://github.com/ai-info-x/github-mcp-server.git",
"clone_url_ssh": "git@github.com:ai-info-x/github-mcp-server.git",
"private": false,
"stars": 5,
"forks": 2,
"language": "Python",
"default_branch": "main"
}Testing
Run All Tests
pytestRun with Coverage
pytest --cov=src --cov-report=htmlRun Specific Test
pytest tests/test_github_mcp.py::TestTriggerRepositoryDispatch::test_trigger_dispatch_success -vProject Structure
github-mcp-server/
βββ src/
β βββ github_mcp_server.py # Main MCP server implementation
βββ tests/
β βββ test_github_mcp.py # Test suite
βββ README.md # This file
βββ .env.template # Environment template
βββ .gitignore # Git ignore rules
βββ pyproject.toml # Project configuration & dependencies
βββ .git/ # Git repositoryDevelopment
Setting Up Development Environment
# Clone and install
git clone https://github.com/ai-info-x/github-mcp-server.git
cd github-mcp-server
# Create virtual environment (optional)
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
# Install with dev dependencies
pip install -e ".[dev]"Code Style
This project uses black for code formatting and flake8 for linting.
# Format code
black src/ tests/
# Check linting
flake8 src/ tests/Type Checking
mypy src/Error Handling
All tools return consistent JSON responses with success flag and error information:
Success Response:
{
"success": true,
"message": "Operation successful",
...
}Error Response:
{
"success": false,
"error": "Error description",
"status": 404
}Common GitHub API errors:
404 Not Found: Repository or user doesn't exist
401 Unauthorized: Invalid or expired token
403 Forbidden: Insufficient permissions
422 Unprocessable Entity: Invalid payload or parameters
Troubleshooting
"GITHUB_TOKEN environment variable is required"
Ensure your token is set:
# Check if set
echo $GITHUB_TOKEN
# If not set, export it
export GITHUB_TOKEN="ghp_your_token_here""401 Unauthorized"
Your token may be invalid or expired:
Check token at https://github.com/settings/tokens
Regenerate if necessary
Update environment variable
"403 Forbidden"
Your token lacks required scopes:
Edit the token
Ensure
repoandworkflowscopes are enabled
"Repository not found"
Verify:
Repository exists and is accessible
Correct owner/repo names
Owner is username (not organization) if querying user repos
Repository URLs
Clone (HTTPS): https://github.com/ai-info-x/github-mcp-server.git
Clone (SSH): git@github.com:ai-info-x/github-mcp-server.git
License
MIT License - See LICENSE file for details
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch (
git checkout -b feature/your-feature)Commit changes with clear messages
Write/update tests for new functionality
Ensure all tests pass (
pytest)Push to your fork
Create a Pull Request
Support
For issues, questions, or suggestions:
Open an issue at https://github.com/ai-info-x/github-mcp-server/issues
Check existing issues for similar problems
Provide detailed reproduction steps
Changelog
v0.1.0 (Initial Release)
β¨ Repository dispatch event triggering
β¨ Issue creation with labels
β¨ Repository information retrieval
β¨ Japanese language support in payloads
β¨ Comprehensive test suite
π Complete documentation
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
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 Connectors
Manage repositories, users, releases, and automate GitHub workflows
Access the GitHub API, enabling file operations, repository management, search functionality, andβ¦
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
GitHub MCP β wraps the GitHub public REST API (no auth required for public endpoints)
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with GitHub repositories through the GitHub API, allowing file operations, repository management, issue tracking, and code search through natural language commands.33154MIT
- FlicenseNot gradedqualityCmaintenanceEnables access to GitHub repositories and data through the GitHub API. Supports retrieving repositories, issues, pull requests, and searching code across GitHub with authentication via personal access tokens.-
- FlicenseAqualityCmaintenanceEnables interaction with GitHub repositories, issues, pull requests, code search, branches, and GitHub Actions workflows.848-
- AlicenseNot gradedqualityDmaintenanceEnables interaction with GitHub API for repository management, commits, pushes, and pulls through natural language.4671ISC
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/ai-info-x/github-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server