Token导航 LogoToken导航

MCP Server · 办公协作

Gitee Pull Request

一个用于在Gitee上创建和管理拉取请求的服务器,支持多实例和自动化工作流。

stdio官方级别未说明来源级核验工具 0@liangshanli/mcp-server-gitee-pull-request
代码管理版本控制JavaScriptCursor工作流自动化

快速开始

作者 / 组织
liliangshan
提供方
liliangshan
运行时
Node.js

工具数量

0

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

Gitee Pull Request 属于办公协作类 MCP Server,公开资料标注 0 个工具,通过stdio 本地进程接入,适配 Cursor,有可以直接复制的安装命令;接入前要先准备 OAuth 授权。

分类

办公协作

传输方式

stdio

认证方式

OAuth 授权

部署方式

公开资料未说明

安装与配置

安装命令

npx @liangshanli/mcp-server-gitee-pull-request

客户端配置示例

{
  "mcpServers": {
    "mcp-server-gitee-pull-request": {
      "command": "npx",
      "args": [
        "@liangshanli/mcp-server-gitee-pull-request"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 0 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

MCP Gitee拉取请求服务器

一个MCP服务器,用于在Gitee上创建Pull Requests,支持多实例。

特性

  • ✅ 通过API在Gitee上创建Pull请求
  • ✅ 具有存储库名称隔离的多实例支持
  • ✅ 可配置的审阅者(指定人员和测试人员)
  • ✅ 标签支持验证
  • ✅ PR支持草案
  • ✅ 自动审查、测试和合并工作流
  • ✅ 操作日志
  • ✅ 错误处理和恢复

安装

全局安装(推荐)

npm install -g @liangshanli/mcp-server-gitee-pull-request

本地安装

npm install @liangshanli/mcp-server-gitee-pull-request

来源

git clone https://github.com/liliangshan/mcp-server-gitee-pull-request.git
cd mcp-server-gitee-pull-request
npm install

配置

设置环境变量:

# Required: Gitee account credentials (with scope_ prefix to avoid system env conflicts)
export scope_username="your-email@example.com"
export scope_password="your-password"

# Required: OAuth application credentials
# Create an OAuth application at: https://gitee.com/oauth/applications
export scope_client_id="your_client_id"
export scope_client_secret="your_client_secret"

# Note: OAuth scope is hardcoded as "user_info pull_requests enterprises"

# Required: Repository owner (organization or user path)
export owner="your-username-or-org"

# Required: Repository name
export repo="your-repo-name"

# Required: Source branch (the branch to merge from)
# You can input just the branch name (e.g., "dev") and it will be auto-formatted to "branch (dev)"
export head="dev"

# Required: Target branch (the branch to merge into)
# You can input just the branch name (e.g., "main") and it will be auto-formatted to "branch (main)"
export base="main"

# Optional: Reviewers (comma-separated usernames)
export assignees="username1,username2"

# Optional: Testers (comma-separated usernames)
# Note: This option is invalid if reviewers are assigned in repository settings
export testers="tester1,tester2"

# Optional: Default labels (comma-separated)
# Each label must be 2-20 characters and contain only alphanumeric characters, underscores, or Chinese characters
# Example: "bug,performance,enhancement"
# If labels are provided in the tool call, they will override this environment variable
export labels="bug,performance"

# Optional: Project name for multi-instance support
# REPO_NAME is auto-generated from repo name
export PROJECT_NAME="custom-mgit"

# Optional: Automatic workflow flags (default: false)
# AUTO_REVIEW: Automatically review PR after creation (returns 204 No Content on success)
export AUTO_REVIEW="false"

# AUTO_TEST: Automatically test PR after review (returns 204 No Content on success)
export AUTO_TEST="false"

# AUTO_MERGE: Automatically merge PR after test succeeds (only merges if AUTO_TEST is false or test succeeds)
export AUTO_MERGE="false"

获取OAuth应用程序凭据

  1. 首选 Gitee OAuth应用程序 创建您的应用程序
  2. Click "创建应用" (Create Application)
  3. 填写申请详情:

- 应用程序名称:您的应用程序名称 - 应用程序URL:您的应用程序URL(可以是任何有效的URL) - 应用程序描述:您的应用程序描述

  1. 创建后,您将获得 client_id 和 client_secret
  2. 将它们与您的Gitee帐户凭据一起设置为环境变量

注: 访问令牌在需要时使用OAuth自动获得。您还可以使用 token 手动检索令牌的工具。

用法

1.直接运行(全局安装)

mcp-server-gitee-pull-request

2.使用npx(推荐)

npx @liangshanli/mcp-server-gitee-pull-request

3.直接启动(源安装)

npm start

4.管理启动(建议用于生产)

npm run start-managed

IDE配置

光标/VS代码

添加到MCP设置(.cursor/mcp.json 或VS代码设置):

{
  "mcpServers": {
    "gitee-pr": {
      "command": "npx",
      "args": [
        "-y",
        "@liangshanli/mcp-server-gitee-pull-request"
      ],
      "env": {
        "scope_username": "your-email@example.com",
        "scope_password": "your-password",
        "scope_client_id": "your_client_id",
        "scope_client_secret": "your_client_secret",
        "owner": "your-username-or-org",
        "repo": "your-repo-name",
        "head": "dev",
        "base": "main",
        "assignees": "username1,username2",
        "testers": "tester1,tester2",
        "labels": "bug,performance",
        "PROJECT_NAME": "custom-mgit",
        "AUTO_REVIEW": "false",
        "AUTO_TEST": "false",
        "AUTO_MERGE": "false"
      }
    }
  }
}

多实例配置

您可以为不同的存储库运行多个实例。这 REPO_NAME 由自动生成 repo 名字。使用 PROJECT_NAME 为了区分不同的实例:

{
  "mcpServers": {
    "gitee-pr-repo1": {
      "command": "npx",
      "args": ["-y", "@liangshanli/mcp-server-gitee-pull-request"],
      "env": {
        "scope_username": "your-email@example.com",
        "scope_password": "your-password",
        "scope_client_id": "your_client_id",
        "scope_client_secret": "your_client_secret",
        "owner": "org1",
        "repo": "repo1",
        "head": "dev",
        "base": "main",
        "PROJECT_NAME": "custom-mgit",
        "AUTO_REVIEW": "true",
        "AUTO_TEST": "true",
        "AUTO_MERGE": "true"
      }
    },
    "gitee-pr-repo2": {
      "command": "npx",
      "args": ["-y", "@liangshanli/mcp-server-gitee-pull-request"],
      "env": {
        "scope_username": "your-email@example.com",
        "scope_password": "your-password",
        "scope_client_id": "your_client_id",
        "scope_client_secret": "your_client_secret",
        "owner": "org2",
        "repo": "repo2",
        "head": "dev",
        "base": "master",
        "PROJECT_NAME": "custom-mgit"
      }
    }
  }
}

可用工具

pr

在Gitee上创建Pull Request。

参数:

  • title (必填):拉取请求标题
  • body (可选):Pull Request描述/正文
  • draft (可选):这是否是PR草案(默认值: false)

注: 标签可以通过以下方式配置 labels 环境变量。如果设置,它们将自动添加到此工具创建的所有Pull Request中。

自动工作流:

  • 如果 AUTO_REVIEW=true,PR创建后将自动审核
  • 如果 AUTO_TEST=true,PR将在审核后自动测试(如果禁用审核,则在创建后自动测试)
  • 如果 AUTO_MERGE=true,PR将在测试成功后自动合并(如果测试被禁用,则在创建后自动合并)

工作流顺序:

  1. 创建PR
  2. 自动审查(如果 AUTO_REVIEW=true)
  3. 自动测试(如果 AUTO_TEST=true)
  4. 自动合并(如果 AUTO_MERGE=true 测试成功或测试被禁用)

例子:

{
  "title": "Add new feature",
  "body": "This PR adds a new feature to improve performance.",
  "labels": "enhancement,performance",
  "draft": false
}

答复:

{
  "success": true,
  "pull_request": {
    "id": 12345,
    "number": 42,
    "title": "Add new feature",
    "html_url": "https://gitee.com/owner/repo/pulls/42",
    ...
  },
  "url": "https://gitee.com/owner/repo/pulls/42",
  "number": 42,
  "message": "Pull Request created successfully. PR #42: Add new feature",
  "auto_review": {
    "success": true,
    "review": null,
    "message": "Auto review completed for PR #42"
  },
  "auto_test": {
    "success": true,
    "test": null,
    "message": "Auto test completed for PR #42"
  },
  "auto_merge": {
    "success": true,
    "merge": {
      "sha": "...",
      "merged": true,
      "message": "Pull Request 已成功合并"
    },
    "message": "Auto merge completed for PR #42"
  }
}

注: 这 auto_review, auto_test,以及 auto_merge 仅当启用并成功执行相应的自动工作流时,才会包含字段。审核和测试API成功后返回204 No Content,因此 review 和 test 字段将是 null 当成功时。

token

使用OAuth获取Gitee访问令牌。

该工具使用配置的凭据从Gitee OAuth API检索访问令牌。令牌缓存在内存中,需要时会自动刷新。

参数: 无

例子:

{}

答复:

{
  "success": true,
  "access_token": "your_access_token_here",
  "expires_at": "2025-11-26T12:00:00.000Z",
  "message": "Access token retrieved successfully"
}

注: 创建Pull Requests时会自动使用令牌,因此您通常不需要手动调用此工具。

logs

获取调试和监控的操作日志。

参数:

  • limit (可选):限制计数,默认50,最大1000
  • offset (可选):偏移,默认值为0

例子:

{
  "limit": 10,
  "offset": 0
}

多实例支持

此服务器通过以下方式支持多个实例 REPO_NAME 它是由以下内容自动生成的 repo 名字。工具名称以存储库名称作为前缀,以避免冲突。

注: PROJECT_NAME 是可选的,仅用于工具描述品牌。它不会影响工具命名。

例子:

  • 随着 repo="mcp-server-gitee-pull-request":工具名称为 mcp-server-gitee-pull-request_pr
  • 随着 repo="my-project":工具名称为 my-project_pr

这允许您同时为不同的存储库运行多个实例。

日志记录

所有操作都记录到文件中,以便调试和监控:

  • 日志目录: .setting/ 或 .setting./ (可通过以下方式配置 MCP_LOG_DIR)
  • 日志文件: mcp-gitee-pr.log (可通过以下方式配置 MCP_LOG_FILE)

日志包括:

  • 请求参数
  • 响应数据
  • 错误消息
  • 时间戳

api参考

此服务器使用Gitee API v5:

  • 端点: POST https://gitee.com/api/v5/repos/{owner}/{repo}/pulls
  • 内容类型: application/json;charset=UTF-8
  • 认证:通过查询参数访问令牌

有关更多信息,请参见 Gitee API文档.

错误处理

服务器处理各种错误情况:

  • 缺少必要参数:返回明确的错误消息
  • 标签无效:验证标签格式(2-20个字符,仅限字母数字/下划线/中文)
  • API错误:返回带有状态代码的Gitee API错误消息
  • 网络错误:优雅地处理连接失败

故障排除

常见问题

  1. 401未经授权:检查您的 access_token 有效且具有所需范围
  2. 404未找到:验证 owner 和 repo 是正确的
  3. 422不可处理实体:检查分支名称(head 和 base)存在且有效
  4. 标签无效:确保标签为2-20个字符,并且只包含允许的字符

调试模式

通过检查中的日志文件启用详细日志记录 .setting/ 目录。

许可证

麻省理工学院

作者

李亮山

仓库

https://github.com/liliangshan/mcp-server-gitee-pull-request

工具与能力

工具数量

0

资源数量

0

提示词数量

0

能力标签

代码管理JavaScript本地部署自动化工作流Gitee集成版本控制团队协作

支持客户端

Cursor

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

消息与邮件处理

把群消息、邮件接进助手,按规则汇总和回复。

工单与任务流转

在对话里建单、改状态,少切换系统。

团队信息同步

把会议纪要和文档更新同步到协作工具。

选择建议

值得选的地方

  • 只提供 0 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 公开说明写得比较完整,接入前能看清能力边界。

先想清楚的地方

  • stdio 方式要求本地装好 Node.js,换机器要重新装一遍。
  • 需要自备OAuth 授权,没有凭据没法直接试。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。

更适合

  • 需要在办公协作场景里让模型直接调用外部能力的人。
  • 已经在用 Cursor 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到OAuth 授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Gitee Pull Request

MCP World · 本页

0stdio有1 个2026-05-17
Karakeep MCP

MCP World

0未说明未标注1 个2026-05-17
Excalidraw MCP App

MCP World

0未说明未标注1 个2026-05-17
Slack MCP

MCP.so

18stdio有4 个2026-05-17
HiveChat MCP

MCP World

0HTTP未标注2 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Gitee Pull Request 怎么安装?

公开资料给出的安装命令是 npx @liangshanli/mcp-server-gitee-pull-request,运行环境为 Node.js。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Gitee Pull Request 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Node.js;保存后完全退出客户端再打开,配置才会生效。

Gitee Pull Request 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Gitee Pull Request 需要 API Key 吗?

公开资料标注的认证方式是OAuth 授权,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

Gitee Pull Request 支持哪些客户端?

公开资料标注支持 Cursor;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP