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 client the 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.0.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.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mcp_github_cli-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 e1e4f37a7adc8d4c25550cc1fbe444a0fb58d04a95ae4abb43f4caab9cf547a1
MD5 ea1271684a36c379ca9ae8888d82c237
BLAKE2b-256 cf56a964ad7cbbf084feba9308a2c873e393a13d3d58a3bd6593f5e2bb59df44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mcp_github_cli-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bb4543011999c141254ab5893277df4e24da4797294c0c0429557b3d6e83087f
MD5 359a8e6ba24f89fa6a65a5f3359ec918
BLAKE2b-256 8455fded8fa92cb4186612695af014e78614835463526c314fdfdbf34bedfc2d

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