GitHub 项目 V2 MCP 服务器
一个模型上下文协议 (MCP) 服务器,提供通过 Claude 和其他 MCP 客户端管理 GitHub Projects V2 的工具。该服务器使用 GitHub GraphQL API 与 GitHub Projects V2 进行交互。
特征
- 列出并查看用户和组织的 GitHub 项目 V2
- 获取项目字段和项目(问题、PR、草稿问题)
- 创建问题并将其添加到项目中
- 直接在项目中创建草稿问题
- 更新项目项字段值
- 从项目中删除项目
用法
此服务器可与任何 MCP 客户端(例如 Claude Desktop)一起使用。请将其添加到您的 MCP 客户端配置中(例如claude_desktop_config.json
)。
选项 1:使用已发布的包
以下是使用uvx
作为命令运行器的示例配置:
确保将your_pat_here
替换为您的实际 GitHub 个人访问令牌。
选项 2:从源代码
要直接从源代码运行项目,请按照以下步骤操作:
设置
- 克隆存储库:
- 创建并激活虚拟环境:
- 安装依赖项:
- 将您的 GitHub 令牌设置为环境变量:创建 GitHub 个人访问令牌并赋予其必要的权限。所需权限包括:
repo
、project
和read:org
。运行此命令后将令牌添加到您的.env
文件中:然后将以下内容添加到您的.env
文件中:
源代码中的用法
从源代码使用时,请按如下方式配置您的 MCP 客户端:
确保将/path/to/github-projects-mcp
和your_pat_here
替换为您的实际存储库路径和 GitHub 个人访问令牌。
可用工具
list_projects
:列出给定组织或用户的 GitHub Projects V2get_project_fields
:获取 GitHub Project V2 中可用的字段get_project_items
:获取 GitHub Project V2 中的项目(支持按状态或自定义单选字段进行过滤)create_issue
:创建一个新的 GitHub 问题add_issue_to_project
:将现有的 GitHub 问题添加到项目 V2update_project_item_field
:更新项目项的字段值create_draft_issue
:直接在 GitHub Project V2 中创建草稿问题delete_project_item
:从 GitHub 项目 V2 中删除一个项目
有关详细使用信息,请参阅服务器代码中的工具文档。
发展
该项目结构如下:
src/github_projects_mcp/
:主包目录server.py
:带有工具定义的 MCP 服务器实现github_client.py
:用于 GitHub API 交互的 GraphQL 客户端
为了做出贡献,请确保:
- 为所有 GraphQL 操作添加适当的错误处理
- 为所有函数和参数添加类型注释
- 添加新工具或功能时更新文档
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
github-projects-mcp
Related MCP Servers
- AsecurityFlicenseAqualityMCP Server for the GitHub API, providing features for file operations, repository management, and advanced search, with automatic branch creation and comprehensive error handling.Last updated -1843TypeScript
- AsecurityAlicenseAqualityMCP Tool Server for Gitee, supporting the management of repository files/branches, Issues, and Pull Requests.Last updated -20104TypeScriptMIT License
- -securityFlicense-qualityProvides tools for interacting with GitHub's API through the MCP protocol, allowing users to create repositories, push content, and retrieve user information.Last updated -JavaScript
- -securityAlicense-qualityA free, open-source service that transforms GitHub projects into MCP endpoints, enabling AI assistants to access and understand project documentation without any setup.Last updated -2,823TypeScriptApache 2.0