Token导航 LogoToken导航TokenDH.com
MCP GitHub CLI logo
开发工具stdio官方级别未说明来源级核验

MCP GitHub CLI

MCP Server

a MCP server for github using the GH cli under the covers

工具数

14

提示词数

0

GitHub Stars

3

资源数

0
API集成GitHub工具PythonClaude开发工具Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

michaelneale

提供方

michaelneale

最后核验

2026/5/18 03:27

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uvx mcp-github-cli

详细介绍

mcp github客户端

MCP服务器,提供重点GraphQL和RESTneneneba API工具,用于与GitHub交互。该服务器提供了一套精简的强大工具,利用GitHub的API提供丰富的数据和功能。

用法

uvx mcp-github-cli

将从PyPI运行。这可用于 gooseclaude.

先决条件

  1. 安装GitHub CLI(gh)如果尚未安装:

- macOS: brew install gh - Linux: sudo apt install gh - 窗户: winget install GitHub.cli

  1. 通过GitHub进行身份验证:
   gh auth login

测试

uv run python main.py --test

这将运行一个全面的测试套件,验证:

  • GitHub的身份验证状态
  • 用户信息检索(gh_get_me)
  • GraphQL查询功能(查看器信息)
  • REST API存储库搜索
  • GraphQL存储库信息检索
  • REST API分支列表

测试输出很好地展示了不同工具的功能。

来源使用

从CLI运行(Goose,或尝试一下)

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

特性

此MCP服务器专注于提供强大、专注的工具,利用GitHub的GraphQL和REST API:

用户信息

  • gh_get_me():获取已验证用户的详细信息

GraphQL工具

GraphQL工具在单个请求中提供丰富的嵌套数据:

  • gh_graphql_repo_info(owner_repo):获取全面的存储库信息
  • gh_graphql_user_profile(username):获取详细的用户配置文件数据
  • gh_graphql_pull_requests(owner_repo, limit, state):获取带有审阅者和状态的拉取请求
  • gh_graphql_issues(owner_repo, limit, state, labels):获取评论和标签问题
  • gh_graphql_repo_contributors(owner_repo, limit):获取存储库贡献者及其提交
  • gh_custom_graphql(query, variables):执行自定义GraphQL查询

REST API工具

REST工具为常见操作提供特定功能:

  • gh_rest_search_repos(query, limit):搜索存储库
  • gh_rest_repo_contents(owner_repo, path, ref):获取存储库内容
  • gh_rest_create_issue(owner_repo, title, body, labels):创建问题
  • gh_rest_create_pr(owner_repo, title, body, head, base, draft):创建pull请求
  • gh_rest_branches(owner_repo):列出存储库分支
  • gh_rest_commits(owner_repo, branch, limit):列出存储库提交
  • gh_rest_api(endpoint, method, data, query_params):执行自定义REST API请求

例子

以下是使用这些工具的示例:

用户信息

# Get authenticated user information
gh_get_me()

GraphQL示例

# Get repository information
gh_graphql_repo_info("block/goose")

# Get user profile
gh_graphql_user_profile("octocat")

# Get open pull requests
gh_graphql_pull_requests("block/goose", 5, "OPEN")

# Get issues with specific labels
gh_graphql_issues("block/goose", 10, "OPEN", ["bug", "help wanted"])

# Custom GraphQL query
gh_custom_graphql("""
query {
  viewer {
    login
    name
  }
}
""")

REST API示例

# Search for repositories
gh_rest_search_repos("language:python stars:>1000", 5)

# Get file contents
gh_rest_repo_contents("block/goose", "README.md")

# Create an issue
gh_rest_create_issue("your-username/your-repo", "Bug report", "There's a bug", ["bug"])

# List branches
gh_rest_branches("block/goose")

# Custom REST API request
gh_rest_api("repos/block/goose", "GET", query_params={"sort": "updated"})

建筑与出版

  1. 更新版本 pyproject.toml:
[project]
version = "x.y.z"  # Update this
  1. 构建包:
# 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. 发布到PyPI:
# Install twine if needed
uv pip install twine

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

许可证

麻省理工学院

目录标签

目录标签

API集成GitHub工具PythonClaude开发工具developer-tools本地部署GraphQLRESTAPI

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

14

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP