PyGithub MCP Server

PyGithub MCP Server

pygithub-mcp-server•byastromined

A Model Context Protocol server that provides tools for interacting with the GitHub API through PyGithub, enabling AI assistants to manage issues, repositories, and pull requests.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides complete GitHub issue management including creating and updating issues, retrieving details, and listing repository issues.
  • •Supports adding, listing, updating, and deleting comments on issues, plus managing issue labels, assignees, and milestones.
  • •Offers configurable tool groups that can be enabled or disabled via a configuration file or environment variables.
  • •Handles pagination and rate limiting for GitHub API operations.

BEST FOR

  • •Automating GitHub issue creation and updates with assignees, labels, and milestones through an AI assistant.
  • •Managing issue comments and labels from an AI client.

ABOUT PYGITHUB-MCP-SERVER

PyGithub MCP Server is cataloged as an MCP server attributed to astromined. A Model Context Protocol server that provides tools for interacting with the GitHub API through PyGithub, enabling AI assistants to manage issues, repositories, and pull requests. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for PyGithub MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can the set of enabled GitHub tool groups be customized?

Yes, tool groups such as issues, repositories, pull requests, discussions, and search can be enabled or disabled via a JSON configuration file or environment variables.

How does authentication to GitHub work?

The server authenticates using a GitHub personal access token supplied through the GITHUB_PERSONAL_ACCESS_TOKEN environment variable.

Which tool group is enabled by default?

By default, only the issues tool group is enabled.

Upstream README

View this exact version on GitHub

README.md · 58fc57d226ce · Fetched 2026-11-13 10:56:27 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

PyGithub MCP Server

A Model Context Protocol server that provides tools for interacting with the GitHub API through PyGithub. This server enables AI assistants to perform GitHub operations like managing issues, repositories, and pull requests.

Features

  • Modular Tool Architecture:

    • Configurable tool groups that can be enabled/disabled
    • Domain-specific organization (issues, repositories, etc.)
    • Flexible configuration via file or environment variables
    • Clear separation of concerns with modular design
    • Easy extension with consistent patterns
  • Complete GitHub Issue Management:

    • Create and update issues
    • Get issue details and list repository issues
    • Add, list, update, and delete comments
    • Manage issue labels
    • Handle assignees and milestones
  • Smart Parameter Handling:

    • Dynamic kwargs building for optional parameters
    • Proper type conversion for GitHub objects
    • Validation for all input parameters
    • Clear error messages for invalid inputs
  • Robust Implementation:

    • Object-oriented GitHub API interactions via PyGithub
    • Centralized GitHub client management
    • Proper error handling and rate limiting
    • Clean API abstraction through MCP tools
    • Comprehensive pagination support
    • Detailed logging for debugging

Documentation

Comprehensive guides are available in the docs/guides directory:

  • error-handling.md: Error types, handling patterns, and best practices
  • security.md: Authentication, access control, and content security
  • tool-reference.md: Detailed tool documentation with examples

See these guides for detailed information about using the PyGithub MCP Server.

Usage Examples

Issue Operations

  1. Creating an Issue
{
  "owner": "username",
  "repo": "repository",
  "title": "Issue Title",
  "body": "Issue description",
  "assignees": ["username1", "username2"],
  "labels": ["bug", "help wanted"],
  "milestone": 1
}
  1. Getting Issue Details
{
  "owner": "username",
  "repo": "repository",
  "issue_number": 1
}
  1. Updating an Issue
{
  "owner": "username",
  "repo": "repository",
  "issue_number": 1,
  "title": "Updated Title",
  "body": "Updated description",
  "state": "closed",
  "labels": ["bug", "wontfix"]
}

Comment Operations

  1. Adding a Comment
{
  "owner": "username",
  "repo": "repository",
  "issue_number": 1,
  "body": "This is a comment"
}
  1. Listing Comments
{
  "owner": "username",
  "repo": "repository",
  "issue_number": 1,
  "per_page": 10
}
  1. Updating a Comment
{
  "owner": "username",
  "repo": "repository",
  "issue_number": 1,
  "comment_id": 123456789,
  "body": "Updated comment text"
}

Label Operations

  1. Adding Labels
{
  "owner": "username",
  "repo": "repository",
  "issue_number": 1,
  "labels": ["enhancement", "help wanted"]
}
  1. Removing a Label
{
  "owner": "username",
  "repo": "repository",
  "issue_number": 1,
  "label": "enhancement"
}

All operations handle optional parameters intelligently:

  • Only includes provided parameters in API calls
  • Converts primitive types to GitHub objects (e.g., milestone number to Milestone object)
  • Provides clear error messages for invalid parameters
  • Handles pagination automatically where applicable

Installation

  1. Create and activate a virtual environment:
uv venv
source .venv/bin/activate
  1. Install dependencies:
uv pip install -e .

Configuration

Basic Configuration

Add the server to your MCP settings (e.g., claude_desktop_config.json or cline_mcp_settings.json):

{
  "mcpServers": {
    "github": {
      "command": "/path/to/repo/.venv/bin/python",
      "args": ["-m", "pygithub_mcp_server"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
      }
    }
  }
}

Tool Group Configuration

The server supports selectively enabling or disabling tool groups through configuration. You can configure this in two ways:

1. Configuration File

Create a JSON configuration file (e.g., pygithub_mcp_config.json):

{
  "tool_groups": {
    "issues": {"enabled": true},
    "repositories": {"enabled": true},
    "pull_requests": {"enabled": false},
    "discussions": {"enabled": false},
    "search": {"enabled": true}
  }
}

Then specify this file in your environment:

export PYGITHUB_MCP_CONFIG=/path/to/pygithub_mcp_config.json

2. Environment Variables

Alternatively, use environment variables to configure tool groups:

export PYGITHUB_ENABLE_ISSUES=true
export PYGITHUB_ENABLE_REPOSITORIES=true
export PYGITHUB_ENABLE_PULL_REQUESTS=false

By default, only the issues tool group is enabled. See README.config.md for more detailed configuration options.

Development

Testing

The project includes a comprehensive test suite:

# Run all tests
pytest

# Run tests with coverage report
pytest --cov

# Run specific test file
pytest tests/test_operations/test_issues.py

# Run tests matching a pattern
pytest -k "test_create_issue"

Note: Many tests are currently failing and under investigation. This is a known issue being actively worked on.

Testing with MCP Inspector

Test MCP tools during development using the MCP Inspector:

source .venv/bin/activate  # Ensure venv is activated
npx @modelcontextprotocol/inspector -e GITHUB_PERSONAL_ACCESS_TOKEN=your-token-here uv run pygithub-mcp-server

Use the MCP Inspector's Web UI to:

  • Experiment with available tools
  • Test with real GitHub repositories
  • Verify success and error cases
  • Document working payloads

Project Structure

tests/
├── unit/                # Fast tests without external dependencies
│   ├── config/          # Configuration tests
│   ├── tools/           # Tool registration tests
│   └── ...              # Other unit tests
└── integration/         # Tests with real GitHub API
    ├── issues/          # Issue tools tests
    └── ...              # Other integration tests
src/
└── pygithub_mcp_server/
    ├── __init__.py
    ├── __main__.py
    ├── server.py        # Server factory (create_server)
    ├── version.py
    ├── config/          # Configuration system
    │   ├── __init__.py
    │   └── settings.py  # Configuration management
    ├── tools/           # Modular tool system
    │   ├── __init__.py  # Tool registration framework
    │   └── issues/      # Issue tools
    │       ├── __init__.py
    │       └── tools.py # Issue tool implementations
    ├── client/          # GitHub client functionality
    │   ├── __init__.py
    │   ├── client.py    # Core GitHub client
    │   └── rate_limit.py # Rate limit handling
    ├── converters/      # Data transformation
    │   ├── __init__.py
    │   ├── parameters.py # Parameter formatting
    │   ├── responses.py # Response formatting
    │   ├── common/      # Common converters
    │   ├── issues/      # Issue-related converters
    │   ├── repositories/ # Repository converters
    │   └── users/       # User-related converters
    ├── errors/          # Error handling
    │   ├── __init__.py
    │   └── exceptions.py # Custom exceptions
    ├── operations/      # GitHub operations
    │   ├── __init__.py
    │   └── issues.py
    ├── schemas/         # Data models
    │   ├── __init__.py
    │   ├── base.py
    │   ├── issues.py
    │   └── ...
    └── utils/           # General utilities
        ├── __init__.py
        └── environment.py # Environment utilities

Troubleshooting

  1. Server fails to start:

    • Verify venv Python path in MCP settings
    • Ensure all requirements are installed in venv
    • Check GITHUB_PERSONAL_ACCESS_TOKEN is set and valid
  2. Build errors:

    • Use --no-build-isolation flag with uv build
    • Ensure Python 3.10+ is being used
    • Verify all dependencies are installed
  3. GitHub API errors:

    • Check token permissions and validity
    • Review pygithub_mcp_server.log for detailed error traces
    • Verify rate limits haven't been exceeded

Dependencies

  • Python 3.10+
  • MCP Python SDK
  • Pydantic
  • PyGithub
  • UV package manager

License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for PyGithub MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/pygithub-mcp-server)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools