MCP of perforce
Project description
MCP Perforce 服务器
Perforce的模型上下文协议(MCP)服务器实现
功能概述
MCP Perforce服务器提供以下功能:
- get-changelist-files-catalog - 通过Swarm API获取reviews目录中的文件列表
- get-file-details - 通过Swarm API获取目录中每个变更文件的详细内容
- 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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca1df1aef3bc0a101e222002373192dc6faf36d2410b28f8649f01fad1bce6e0
|
|
| MD5 |
4905e2ec0f6b5a941ff237238d16e3df
|
|
| BLAKE2b-256 |
eb5207e4c4aef904f79bff001e156afb427245dde4fef8759338817f025a5a6e
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
167a12e8cc88c6de78791f8dfe90c456e6cfdd577f16f6b6fa45216dd6380cf8
|
|
| MD5 |
9797154f1e42eff16c30a67a48f88313
|
|
| BLAKE2b-256 |
bd6e93972279453c5a212f0881825434bc2eebede506b547513a53697930867f
|