代码拉取完成,页面将自动刷新
Gitee MCP 服务器是一个用于 Gitee 的模型上下文协议(Model Context Protocol,MCP)服务器实现。它提供了一系列与 Gitee API 交互的工具,使 AI 助手能够管理仓库、问题、拉取请求等。
克隆仓库:
git clone https://gitee.com/oschina/mcp-gitee.git
cd mcp-gitee
构建项目:
make build
将 ./bin/mcp-gitee 移动至系统环境变量
go install gitee.com/oschina/mcp-gitee@latest
检查 mcp-gitee 版本:
mcp-gitee --version
配置示例:点击查看更多应用配置
{
"mcpServers": {
"gitee": {
"command": "npx",
"args": [
"-y",
"@gitee/mcp-gitee@latest"
],
"env": {
"GITEE_API_BASE": "https://gitee.com/api/v5",
"GITEE_ACCESS_TOKEN": "<your personal access token>"
}
}
}
}
{
"mcpServers": {
"gitee": {
"command": "mcp-gitee",
"env": {
"GITEE_API_BASE": "https://gitee.com/api/v5",
"GITEE_ACCESS_TOKEN": "<your personal access token>"
}
}
}
}
--token
:Gitee 访问令牌--api-base
:Gitee API 基础 URL(默认:https://gitee.com/api/v5)--version
:显示版本信息--transport
:传输类型(stdio 或 sse,默认:stdio)--sse-address
:启动 SSE 服务器的主机和端口(默认:localhost:8000)--enabled-toolsets
: 逗号分隔的要启用的工具列表(如果指定,则只启用这些工具)--disabled-toolsets
: 逗号分隔的要禁用的工具列表您也可以使用环境变量配置服务器:
GITEE_ACCESS_TOKEN
:Gitee 访问令牌GITEE_API_BASE
:Gitee API 基础 URLENABLED_TOOLSETS
: 逗号分隔的要启用的工具列表DISABLED_TOOLSETS
: 逗号分隔的要禁用的工具列表工具集管理支持两种模式:
启用指定工具(白名单模式):
--enabled-toolsets
参数或 ENABLED_TOOLSETS
环境变量--enabled-toolsets="update_enterprise_issue,list_enterprise_repositories"
禁用指定工具(黑名单模式):
--disabled-toolsets
参数或 DISABLED_TOOLSETS
环境变量--disabled-toolsets="update_enterprise_issue,list_enterprise_repositories"
注意:
enabled-toolsets
和 disabled-toolsets
,则 enabled-toolsets
优先本项目采用 MIT 许可证。有关更多详细信息,请参阅 LICENSE 文件。
服务器提供了各种与 Gitee 交互的工具:
工具 | 类别 | 描述 |
---|---|---|
list_user_repos | 仓库 | 列出用户授权的仓库 |
get_file_content | 仓库 | 获取仓库中文件的内容 |
create_user_repo | 仓库 | 创建用户仓库 |
create_org_repo | 仓库 | 创建组织仓库 |
create_enter_repo | 仓库 | 创建企业仓库 |
fork_repository | 仓库 | Fork 仓库 |
create_release | 仓库 | 为仓库创建发行版 |
list_releases | 仓库 | 列出仓库发行版 |
search_open_source_repositories | 仓库 | 搜索开源仓库 |
list_repo_pulls | Pull Request | 列出仓库中的拉取请求 |
merge_pull | Pull Request | 合并拉取请求 |
create_pull | Pull Request | 创建拉取请求 |
update_pull | Pull Request | 更新拉取请求 |
get_pull_detail | Pull Request | 获取拉取请求的详细信息 |
comment_pull | Pull Request | 评论拉取请求 |
list_pull_comments | Pull Request | 列出拉取请求的所有评论 |
create_issue | Issue | 创建 Issue |
update_issue | Issue | 更新 Issue |
get_repo_issue_detail | Issue | 获取仓库 Issue 的详细信息 |
list_repo_issues | Issue | 列出仓库 Issue |
comment_issue | Issue | 评论 Issue |
list_issue_comments | Issue | 列出 Issue 的评论 |
get_user_info | 用户 | 获取当前认证用户信息 |
search_users | 用户 | 搜索用户 |
list_user_notifications | 通知 | 列出用户通知 |
我们欢迎开源社区的贡献!如果您想为这个项目做出贡献,请按照以下指南操作:
更多信息,请参阅 CONTRIBUTING 文件。
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型