Skip to main content

Advanced GitHub MCP server — repo analysis, PR management, code review, CI/CD monitoring

Project description

🚀 mcp-github-advanced

PyPI License: MIT Python 3.10+ MCP

Advanced GitHub MCP server — repo analysis, PR management, automated code review, CI/CD monitoring via GitHub REST v3 + GraphQL v4 API.

Built for AI assistants and LangChain/LangGraph agents using the Model Context Protocol.


✨ Features

Category Tools Description
📁 Repo get_repo_info, get_file_content, list_repo_files, search_code Repository metadata, file contents, directory tree, code search
📝 Commit list_commits, get_commit_diff, get_contributor_stats Commit history, diffs, contributor statistics
🔀 PR list_pull_requests, get_pr_diff, create_pr_review PR management and AI-powered code reviews
🐛 Issue list_issues, create_issue Issue tracking and creation
⚙️ CI/CD get_workflow_runs, get_workflow_logs GitHub Actions monitoring and log analysis

14 tools in total, all with:

  • 🔒 Versioned API headers (X-GitHub-Api-Version: 2022-11-28)
  • ⚡ Redis caching with intelligent TTL strategy
  • 🔄 Automatic retry with exponential backoff
  • 📏 Output chunking for LLM token limits (8192 tokens)
  • 🔑 PAT + OAuth 2.0 authentication

📦 Installation

pip install mcp-github-advanced

Or with uvx (recommended for MCP):

uvx mcp-github-advanced

Development Install

git clone https://github.com/iamseyhmus7/mcp-github-advanced.git
cd mcp-github-advanced
pip install -e ".[dev]"

⚙️ Configuration

1. Environment Variables

Copy .env.example to .env and fill in your credentials:

cp .env.example .env
# GitHub Auth (at least one required)
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx      # Personal Access Token
GITHUB_CLIENT_ID=Ov23xxxxxxxxxxxxx         # OAuth App (optional)
GITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxx      # OAuth App (optional)

# Redis (optional — disables caching if unavailable)
REDIS_URL=redis://localhost:6379/0

# Server
MCP_SERVER_NAME=mcp-github-advanced
LOG_LEVEL=INFO

# LLM
GOOGLE_API_KEY=AIzaSyXXXXXXXXXXXXXXXXXXX

2. GitHub Token Scopes

For full functionality, your PAT needs these scopes:

  • repo — Access private repositories
  • read:user — Read user profile

3. MCP Client Configuration

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "github-advanced": {
      "command": "uvx",
      "args": ["mcp-github-advanced"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Cursor / VS Code

Add to .cursor/mcp.json or equivalent:

{
  "mcpServers": {
    "github-advanced": {
      "command": "uvx",
      "args": ["mcp-github-advanced"],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

🛠️ Usage Examples

Once connected to an MCP client, you can use natural language:

"Analyze the repository owner/repo — show me stars, language, and recent commits."

"List open pull requests in owner/repo and review PR #42."

"Check the latest CI/CD runs for owner/repo and show me failed job logs."

"Search for TODO comments in owner/repo."

"Create an issue titled 'Fix login bug' with label 'bug' in owner/repo."


🏗️ Architecture

┌──────────────────────────────────────────┐
│              server.py                    │
│         14 MCP Tools (list_tools)        │
│         call_tool() dispatcher           │
└──────────────┬───────────────────────────┘
               │
    ┌──────────┴──────────┐
    ▼                     ▼
┌───────────┐    ┌─────────────────┐
│ github.py │    │    auth.py       │
│ REST + GQL│    │ OAuth + PAT     │
│ Rate limit│    │ Token mgmt      │
└─────┬─────┘    └─────────────────┘
      │
      ▼
┌───────────────────────────────────┐
│          cache.py                  │
│  Redis — TTL-based caching        │
│  Graceful degradation             │
└───────────────────────────────────┘

🧪 Testing

All tests use respx mocks — no real GitHub API calls:

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run with coverage
pytest --cov=mcp_github_advanced

# Lint
ruff check src/ tests/

🌍 Deployment

PyPI

pip install mcp-github-advanced

Smithery.ai

Deploy via smithery.yaml:

npx @anthropic/smithery publish

📝 License

MIT License — see LICENSE for details.


🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feat/amazing-feature
  3. Commit: git commit -m 'feat: add amazing feature'
  4. Push: git push origin feat/amazing-feature
  5. Open a Pull Request

Follow the commit conventions defined in AGENTS.md.


👤 Author

Şeyhmus OK@iamseyhmus7

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_github_advanced-0.1.0.tar.gz (35.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_github_advanced-0.1.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_github_advanced-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_github_advanced-0.1.0.tar.gz
  • Upload date:
  • Size: 35.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for mcp_github_advanced-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eba72c804550aa2050b65e303f48005c15a0b5eea44a7bac7fd96b9451758118
MD5 c475554bce1bcc51418eb2f322f63c85
BLAKE2b-256 9803ed0070bc422c37b8eed5f18d38c5e43ec65d00a15900defc3154ee4121ca

See more details on using hashes here.

File details

Details for the file mcp_github_advanced-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_github_advanced-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dfb48301ec626607a6d5b97669359c8d91aad0eb8633a5f83411d431589e636
MD5 37a6466e2c557adc3cd1e2b6c05c5ecf
BLAKE2b-256 1c7618586d9804d1a7e354a8b3465117f2949b12b61251d170c50ac8f7f0ceee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page