Skip to main content

MCP of perforce

Project description

MCP Perforce 服务器

Perforce的模型上下文协议(MCP)服务器实现

功能概述

MCP Perforce服务器提供以下功能:

  1. get-changelist-files-catalog - 通过Swarm API获取reviews目录中的文件列表
  2. get-file-details - 通过Swarm API获取目录中每个变更文件的详细内容
  3. get-changelist-diff-native - 使用P4原生命令获取CL中的变更文件列表和文件差异
    • 使用 p4 describe -s -S <CL号> 获取变更文件列表
    • 使用 p4 diff2 <文件路径> <文件路径>@=<CL号> 获取每个文件的差异

配置说明

cursor MCP 配置说明

{
    "mcpServers": {
      "code review": {
          "command": "uvx",
          "args": [
              "mcp-perforce",
              "--p4config",
              "./path/to/your/p4config.json"
          ]
      }
  }      
}  

p4config.json说明

{
  "swarm_username": "your_swarm_username",
  "swarm_password": "your_swarm_password",
  "swarm_base_url": "https://your_swarm_server",
  "swarm_api_url": "https://your_swarm_server/api/v10",
  "skip_file_extensions": [".pb.go", ".cs"]
}

配置项说明

配置项 必填 说明
swarm_username Swarm登录用户名
swarm_password Swarm登录密码
swarm_base_url Swarm服务器基础URL
swarm_api_url Swarm API URL
skip_file_extensions 需要跳过的文件扩展名列表,默认为 [".pb.go", ".cs"]

使用说明

cursor agent 模式中输入

帮我review一下3280706

cursor将自动使用mcp-perforce拉取reviews中的文件列表进行review。

更新记录

  • 0.2.6 - 新增 skip_file_extensions 配置项,支持自定义跳过的文件扩展名
  • 0.2.5 - 新增 get-changelist-diff-native 工具,支持使用P4原生命令获取CL差异
  • 0.2.4 - 修复代码提交后,无法获取reviews中的差异信息的BUG

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_perforce-0.2.6.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_perforce-0.2.6-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file mcp_perforce-0.2.6.tar.gz.

File metadata

  • Download URL: mcp_perforce-0.2.6.tar.gz
  • Upload date:
  • Size: 44.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for mcp_perforce-0.2.6.tar.gz
Algorithm Hash digest
SHA256 ca1df1aef3bc0a101e222002373192dc6faf36d2410b28f8649f01fad1bce6e0
MD5 4905e2ec0f6b5a941ff237238d16e3df
BLAKE2b-256 eb5207e4c4aef904f79bff001e156afb427245dde4fef8759338817f025a5a6e

See more details on using hashes here.

File details

Details for the file mcp_perforce-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: mcp_perforce-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.9

File hashes

Hashes for mcp_perforce-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 167a12e8cc88c6de78791f8dfe90c456e6cfdd577f16f6b6fa45216dd6380cf8
MD5 9797154f1e42eff16c30a67a48f88313
BLAKE2b-256 bd6e93972279453c5a212f0881825434bc2eebede506b547513a53697930867f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page