Skip to main content
Glama

Gitee MCP 服务器

让 AI 通过 MCP 为您操作 Gitee 仓库/Issues/Pull Requests

NPM 版本Docker拉取Docker 镜像版本


支持的AI操作

类别MCP 工具描述
存储库操作create_repository创建 Gitee 存储库
fork_repository派生一个 Gitee 存储库
分支机构运营create_branch在 Gitee 存储库中创建新分支
list_branches列出 Gitee 存储库中的分支
get_branch获取 Gitee 存储库中特定分支的详细信息
文件操作get_file_contents获取 Gitee 存储库中文件或目录的内容
create_or_update_file在 Gitee 存储库中创建或更新文件
push_files将多个文件推送到 Gitee 存储库
发行操作create_issue在 Gitee 仓库中创建问题
list_issues列出 Gitee 存储库中的问题
get_issue获取 Gitee 存储库中特定问题的详细信息
update_issue更新 Gitee 存储库中的问题
add_issue_comment向 Gitee 存储库中的问题添加评论
拉取请求操作create_pull_request在 Gitee 存储库中创建 Pull 请求
list_pull_requests列出 Gitee 存储库中的 Pull 请求
get_pull_request获取 Gitee 存储库中特定 Pull 请求的详细信息
update_pull_request更新 Gitee 存储库中的 Pull 请求
merge_pull_request在 Gitee 存储库中合并拉取请求
用户操作get_user获取Gitee用户信息
get_current_user获取已认证的Gitee用户信息

用法

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Gitee MCP 服务器:

npx -y @smithery/cli install @normal-coder/gitee-mcp-server --client claude

配置

  • GITEE_API_BASE_URL :可选,Gitee OpenAPI Endpoint,默认为https://gitee.com/api/v5
  • GITEE_PERSONAL_ACCESS_TOKEN :必需,Gitee 帐户个人访问令牌(PAT),可从 Gitee 帐户设置个人访问令牌中获取
  • DEBUG :可选,设置为true以启用调试日志记录,默认为禁用

通过 NPX 运行 MCP 服务器

{ "mcpServers": { "Gitee": { "command": "npx", "args": [ "-y", "gitee-mcp-server" ], "env": { "GITEE_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>" } } } }

通过 Docker 容器运行 MCP 服务器

  1. 获取 Docker 镜像
# Get from DockerHub docker pull normalcoder/gitee-mcp-server # Build locally docker build -t normalcoder/gitee-mcp-server .
  1. 配置 MCP 服务器
{ "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 服务器将在 stdio 上运行,允许 MCP 客户端将其用作子进程。

构建 Docker 镜像

您还可以使用 Docker 运行服务器:

docker build -t normalcoder/gitee-mcp-server .

使用 Docker 运行 MCP 服务器:

docker run -e GITEE_PERSONAL_ACCESS_TOKEN=<YOUR_TOKEN> normalcoder/gitee-mcp-server

调试 MCP 服务器

您可以使用@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 SDK
  • universal-user-agent :用于生成用户代理字符串
  • zod :用于模式验证
  • zod-to-json-schema :用于将 Zod 模式转换为 JSON 模式

执照

本软件遵循 MIT 许可证。您可以自由使用、修改和分发本软件,但须遵守 MIT 许可证的条款和条件。更多详情,请参阅项目代码库中的LICENSE文件。

相关链接

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Gitee 的 MCP 工具服务器,支持存储库文件/分支、问题和拉取请求的管理。

  1. 支持的AI操作
    1. 用法
      1. 通过 Smithery 安装
      2. 配置
      3. 通过 NPX 运行 MCP 服务器
      4. 通过 Docker 容器运行 MCP 服务器
    2. 开发指南
      1. 安装依赖项
      2. 建造
      3. 运行服务器
      4. 构建 Docker 镜像
      5. 调试 MCP 服务器
    3. 依赖项
      1. 执照
        1. 相关链接

          Related MCP Servers

          • A
            security
            F
            license
            A
            quality
            MCP 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 -
            18
            4
            3
            TypeScript
            • Linux
            • Apple
          • -
            security
            A
            license
            -
            quality
            A specialized MCP server for in-depth analysis of git repositories, offering tools for branch overview, time period analysis, file changes, and merge recommendations.
            Last updated -
            4
            1
            JavaScript
            Apache 2.0
          • A
            security
            F
            license
            A
            quality
            MCP server for managing Git operations on local repositories, allowing users to list repositories, get and create tags, list commits, push tags, and refresh repositories through a standardized interface.
            Last updated -
            6
            Python
          • -
            security
            A
            license
            -
            quality
            Gitee API integration, repository, issue, and pull request management, and more.
            Last updated -
            25
            Go
            MIT License
            • Linux
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/normal-coder/gitee-mcp-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server