Skip to main content

GitHub CLI extension for MCP that wraps the gh command-line tool.

Project description

mcp-github-cli

MCP server to give ability to interact with GitHub through the GitHub CLI (gh). Provides tools for working with repositories, issues, pull requests, and more. This is conceptually ported over from the official github MCP server - the official one uses personal access tokens which is not ideal in most situations where you can have oauth or github cli available.

Usage

uvx mcp-github-cli

Will run from pypi. This can be used in goose or claude.

Prerequisites

  1. Install the GitHub CLI (gh) if not already installed:

    • macOS: brew install gh
    • Linux: sudo apt install gh
    • Windows: winget install GitHub.cli
  2. Authenticate with GitHub:

    gh auth login
    

Test

uv run python main.py --test

Usage from source

Running from cli (Goose, or to try it)

uv --directory /path/to/mcp-github-cli run python main.py

Features

  • User Management: Get information about the authenticated user
  • Issues: Create, read, update, and comment on issues
  • Pull Requests: Create, list, merge, and manage pull requests
  • Repositories: Create, fork, search, and manage repository content
  • Search: Search repositories, code, issues, and users

Example Tools

Here are some examples of the tools available:

Issues

  • get_issue(owner_repo, issue_number): Get details of an issue
  • create_issue(owner_repo, title, body, assignees, labels): Create a new issue
  • add_issue_comment(owner_repo, issue_number, body): Add a comment to an issue

Pull Requests

  • get_pull_request(owner_repo, pull_number): Get details of a pull request
  • create_pull_request(owner_repo, title, body, head, base, draft): Create a new pull request
  • merge_pull_request(owner_repo, pull_number, merge_method, delete_branch): Merge a pull request

Repositories

  • get_file_contents(owner_repo, path, ref): Get contents of a file
  • create_or_update_file(owner_repo, branch, file_path, content, commit_message): Create or update a file
  • list_branches(owner_repo): List branches in a repository

Building and Publishing

  1. Update version in pyproject.toml:
[project]
version = "x.y.z"  # Update this
  1. Build the package:
# Clean previous builds
rm -rf dist/*

# Or build in a clean environment using uv
uv venv .venv
source .venv/bin/activate
uv pip install build
python -m build
  1. Publish to PyPI:
# Install twine if needed
uv pip install twine

# Upload to PyPI
python -m twine upload dist/*

License

MIT

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_cli-0.1.1.tar.gz (8.4 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_cli-0.1.1-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_github_cli-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_github_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for mcp_github_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 99c45830fd5e79ce473d3c6bda66b3d15e4f57b905f12f83b5ef1b0e7b01fc31
MD5 59dfb5be9638912cff370c977243c245
BLAKE2b-256 0cd3e573aeb5b3d2c4f76bad38c2eee6a4645cb3e51c943dbd931ef00c0b41a3

See more details on using hashes here.

File details

Details for the file mcp_github_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_github_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for mcp_github_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2dddbdc7dc558e8d5fb55db1ec56fe3547f8e542af4f75576b61d02a6db70f33
MD5 44d4eb83446f076b9b5a5397dbda6cf4
BLAKE2b-256 fe53ee008f2cb1eb6c2a44c1005dea818789a97084b39fc4cdc468b69a5b760e

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