MCP码云工具服务器添加福利群:解决AI开发者的「MCP实战痛点」让 AI 通过 MCP 为你操作 Gitee 仓库/Issues/Pull Requests
| 类别 | MCP 工具 | 描述 |
|---|---|---|
| 仓库操作 | create_repository |
创建一个 Gitee 仓库 |
fork_repository |
Fork 一个 Gitee 仓库 | |
| 分支操作 | create_branch |
在 Gitee 仓库中创建一个新的分支 |
list_branches |
列出 Gitee 仓库中的分支 | |
get_branch |
获取 Gitee 仓库中特定分支的详细信息 | |
| 文件操作 | get_file_contents |
获取 Gitee 仓库中文件或目录的内容 |
create_or_update_file |
在 Gitee 仓库中创建或更新文件 | |
push_files |
将多个文件推送到 Gitee 仓库 | |
| Issue 操作 | create_issue |
在 Gitee 仓库中创建一个 Issue |
list_issues |
列出 Gitee 仓库中的 Issues | |
get_issue |
获取 Gitee 仓库中特定 Issue 的详细信息 | |
update_issue |
更新 Gitee 仓库中的一个 Issue | |
add_issue_comment |
向 Gitee 仓库中的一个 Issue 添加评论 | |
| Pull Request 操作 | create_pull_request |
在 Gitee 仓库中创建一个 Pull Request |
list_pull_requests |
列出 Gitee 仓库中的 Pull Requests | |
get_pull_request |
获取 Gitee 仓库中特定 Pull Request 的详细信息 | |
update_pull_request |
更新 Gitee 仓库中的一个 Pull Request | |
merge_pull_request |
合并 Gitee 仓库中的一个 Pull Request | |
| 用户操作 | get_user |
获取 Gitee 用户信息 |
get_current_user |
获取已认证的 Gitee 用户信息 |
要通过 Smithery自动安装适用于 Claude Desktop 的 Gitee MCP Server:
npx -y @smithery/cli install @normal-coder/gitee-mcp-server --client claude
GITEE_API_BASE_URL: 可选,Gitee OpenAPI 端点,默认为 https://gitee.com/api/v5GITEE_PERSONAL_ACCESS_TOKEN: 必填,Gitee 账户个人访问令牌 (PAT),可以从 Gitee 账户设置中的 Personal Access Tokens 获取DEBUG: 可选,设置为 true 以启用调试日志,默认禁用{
"mcpServers": {
"Gitee": {
"command": "npx",
"args": [
"-y",
"gitee-mcp-server"
],
"env": {
"GITEE_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}

# Get from DockerHub
docker pull normalcoder/gitee-mcp-server
# Build locally
docker build -t normalcoder/gitee-mcp-server .

{
"mcpServers": {
"Gitee": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GITEE_PERSONAL_ACCESS_TOKEN",
"normalcoder/gitee-mcp-server"
],
"env": {
"GITEE_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}

npm install
npm run build
构建成功后,/dist 目录将包含可运行的 MCP 服务器。
npm start
MCP 服务器将在标准输入输出上运行,允许它被 MCP 客户端作为子进程使用。
您也可以使用 Docker 来运行服务器:
docker build -t normalcoder/gitee-mcp-server .
使用 Docker 运行 MCP 服务器:
docker run -e GITEE_PERSONAL_ACCESS_TOKEN=<YOUR_TOKEN> normalcoder/gitee-mcp-server
您可以使用 @modelcontextprotocol/inspector 进行调试:
在根目录下创建一个 .env 文件来设置环境变量:
GITEE_API_BASE_URL=https://gitee.com/api/v5 GITEE_PERSONAL_ACCESS_TOKEN=<YOUR_TOKEN>
运行调试工具以启动服务和 Web 调试界面:
npx @modelcontextprotocol/inspector npm run start --env-file=.env

项目中包含了一个 debug() 函数用于打印调试信息,用法如下:
import { debug } from './common/utils.js';
debug('Message to log');
debug('Message with data:', { key: 'value' });

只有当 DEBUG 环境变量被设置为 true 时才会打印调试日志。
@modelcontextprotocol/sdk: 用于实现服务器的 MCP SDKuniversal-user-agent: 用于生成用户代理字符串zod: 用于模式验证zod-to-json-schema: 用于将 Zod 模式转换为 JSON 模式本软件根据 MIT 许可证授权。您可以自由地使用、修改和分发该软件,但需遵守 MIT 许可证中的条款和条件。更多详情,请参见项目仓库中的 LICENSE 文件。