npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@iflow-mcp/gitee-mcp-server

v0.1.1

Published

MCP Server for using the Gitee API

Readme

Gitee MCP Server

通过 MCP,让 AI 代你操作 Gitee 上的仓库 / Issue / Pull Request

Node Version NPM Version Docker Pulls Docker Image Version LICENSE smithery badge


当前支持 AI 调度的能力

| 工具分类 | MCP Tool 工具名称 | 能力描述 | |:----:|:----|:----| | 仓库操作 | 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 用户信息 |

用法

配置项

  • 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 镜像
# 从 DockerHub 获取
docker pull normalcoder/gitee-mcp-server

# 自行构建
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('要记录的消息');
debug('带有数据的消息:', { key: 'value' });

调试日志仅在环境变量 DEBUG 设置为 true 时才会输出。

依赖

  • @modelcontextprotocol/sdk:MCP SDK 用于服务器实现
  • universal-user-agent:用于生成用户代理字符串
  • zod:用于模式验证
  • zod-to-json-schema:用于将 Zod 模式转换为 JSON 模式

许可

基于 MIT 许可证授权。你可以自由使用、修改和分发软件,必须遵守 MIT 许可证的条款和条件。有关更多详细信息,请参阅项目仓库中的 LICENSE 文件。

相关链接