发泡器- mcp
一个 MCP(示范背景议定书) 将 Phabricator 的 Conduit API 包裹起来的服务器,使 MCP 客户端能够与 Phabricator 任务,代码审查,寄存器等交互.
恒星历史
安装
克劳德代码( CLI)
claude mcp add --scope user phabricator -- npx @freelancercom/phabricator-mcp@latest
或环境变量(如果不使用 ~/.arcrc:
claude mcp add --scope user phabricator \
-e PHABRICATOR_URL=https://phabricator.example.com \
-e PHABRICATOR_API_TOKEN=api-xxxxx \
-- npx @freelancercom/phabricator-mcp@latest
这个 --scope user 旗帜在全球安装服务器,使其在所有项目中都可以使用.
代码( OpenAI CLI)
添加到您的 Codex 配置( T)~/.codex/config.json:
{
"mcpServers": {
"phabricator": {
"command": "npx",
"args": ["@freelancercom/phabricator-mcp@latest"],
"env": {
"PHABRICATOR_URL": "https://phabricator.example.com",
"PHABRICATOR_API_TOKEN": "api-xxxxxxxxxxxxx"
}
}
}
}
打开代码
添加到您的打开代码配置( N)~/.config/opencode/config.json:
{
"mcp": {
"servers": {
"phabricator": {
"command": "npx",
"args": ["@freelancercom/phabricator-mcp@latest"],
"env": {
"PHABRICATOR_URL": "https://phabricator.example.com",
"PHABRICATOR_API_TOKEN": "api-xxxxxxxxxxxxx"
}
}
}
}
}
带有 Claude 扩展的 VS 代码
添加到您的 VS 代码 settings.json数字 :
{
"claude.mcpServers": {
"phabricator": {
"command": "npx",
"args": ["@freelancercom/phabricator-mcp@latest"],
"env": {
"PHABRICATOR_URL": "https://phabricator.example.com",
"PHABRICATOR_API_TOKEN": "api-xxxxxxxxxxxxx"
}
}
}
}
光标
添加到您的光标 MCP 配置( T)~/.cursor/mcp.json:
{
"mcpServers": {
"phabricator": {
"command": "npx",
"args": ["@freelancercom/phabricator-mcp@latest"],
"env": {
"PHABRICATOR_URL": "https://phabricator.example.com",
"PHABRICATOR_API_TOKEN": "api-xxxxxxxxxxxxx"
}
}
}
}
GitHub 副驾驶( VS 代码)
添加到您的 VS 代码 settings.json数字 :
{
"github.copilot.chat.mcp.servers": {
"phabricator": {
"command": "npx",
"args": ["@freelancercom/phabricator-mcp@latest"],
"env": {
"PHABRICATOR_URL": "https://phabricator.example.com",
"PHABRICATOR_API_TOKEN": "api-xxxxxxxxxxxxx"
}
}
}
}
升级
默认安装使用 @freelancercom/phabricator-mcp@latest,它告诉 npx 检查每次运行的更新。 无需采取行动.
如果按下特定版本(例如:. @freelancercom/[email protected])或省略了版本后缀,npx缓存了软件包而不会取出新版本. 要升级 :
npx clear-npx-cache
然后重新启动您的 MCP 客户端 .
从 github:freelancer/phabricator-mcp
如果您先前使用 GitHub URL 安装, 请更新您的配置以使用 npm 软件包 :
# Remove old server
claude mcp remove phabricator -s user
# Add new one
claude mcp add --scope user phabricator -- npx @freelancercom/phabricator-mcp@latest
JSON配置,替换 ["github:freelancer/phabricator-mcp"] 与 ["@freelancercom/phabricator-mcp@latest"] 在你的词.
配置
服务器自动读取配置 ~/.arcrc (创建者: 建筑学) (中文(简体) ). 已经设置的配置不需要额外的配置 arc。 。 。 .
或者设置环境变量(优先于 .arcrc:
PHABRICATOR_URL- Phabricator 实例 URLPHABRICATOR_API_TOKEN- 管道API 信号
您可以从 Phabricator 实例中获取 API 令牌 : 设置 > 管道 API 键
建议: 允许只读工具权限
默认情况下,Claude Code每次调用 Phabricator 工具时都会提示您许可. 建议允许将只读工具列表,使其运行而不提示,同时将写入操作(创建,编辑,评论)保存在一个确认步骤后.
添加到您的 ~/.claude/settings.json数字 :
{
"permissions": {
"allow": [
"mcp__phabricator__phabricator_task_search",
"mcp__phabricator__phabricator_task_status_search",
"mcp__phabricator__phabricator_task_priority_search",
"mcp__phabricator__phabricator_revision_search",
"mcp__phabricator__phabricator_diff_search",
"mcp__phabricator__phabricator_diff_raw",
"mcp__phabricator__phabricator_revision_paths",
"mcp__phabricator__phabricator_revision_inline_search",
"mcp__phabricator__phabricator_repository_search",
"mcp__phabricator__phabricator_commit_search",
"mcp__phabricator__phabricator_repository_browse",
"mcp__phabricator__phabricator_repository_file_content",
"mcp__phabricator__phabricator_branch_search",
"mcp__phabricator__phabricator_tag_search",
"mcp__phabricator__phabricator_repository_file_history",
"mcp__phabricator__phabricator_repository_code_search",
"mcp__phabricator__phabricator_user_whoami",
"mcp__phabricator__phabricator_user_search",
"mcp__phabricator__phabricator_project_search",
"mcp__phabricator__phabricator_column_search",
"mcp__phabricator__phabricator_paste_search",
"mcp__phabricator__phabricator_document_search",
"mcp__phabricator__phabricator_blog_search",
"mcp__phabricator__phabricator_blog_post_search",
"mcp__phabricator__phabricator_file_search",
"mcp__phabricator__phabricator_file_info",
"mcp__phabricator__phabricator_buildable_search",
"mcp__phabricator__phabricator_build_search",
"mcp__phabricator__phabricator_build_target_search",
"mcp__phabricator__phabricator_build_log_search",
"mcp__phabricator__phabricator_build_plan_search",
"mcp__phabricator__phabricator_owners_search",
"mcp__phabricator__phabricator_feed_query",
"mcp__phabricator__phabricator_conpherence_read",
"mcp__phabricator__phabricator_audit_query",
"mcp__phabricator__phabricator_phid_lookup",
"mcp__phabricator__phabricator_phid_query",
"mcp__phabricator__phabricator_transaction_search",
"mcp__phabricator__phabricator_version"
]
}
}
允许列表所有工具,包括写操作,使用 "mcp__phabricator__*" 换句话说.
可用工具
服务器会隐藏Phabricator无法服务的工具,例如Conference没有安装时的Conference工具. 它学会了Conduit从哪一种模式提供实例 conduit.query 并缓存列表 ~/.cache/phabricator-mcp/,所以以后开始 不要等Phabricator。 每个开始刷新背景中的缓存,如果列表有变化,例如升级后,服务器会告诉客户端其工具列表有变化. 在第一次启动时,服务器最多等待5秒的列表;如果得不到答案,每个工具都会被列出.
任务管理( 管理器)
| 工具 | 说明 |
|---|---|
phabricator_task_search | 带有过滤器的搜索任务( 状态、 受让人、 项目等) |
phabricator_task_create | 创建新任务 |
phabricator_task_edit | 编辑现有任务,包括其到期日 |
phabricator_task_add_comment | 在任务中添加注释 |
phabricator_task_status_search | 列出实例上所有可用的任务状态 |
phabricator_task_priority_search | 列出实例中所有可用的任务优先级 |
phabricator_task_edit是因为 dueDate 设置 Freelancer 的 Phabricator 扩展的截止日期域( )maniphest:deadline 内 phabricator_task_search(单位:千美元) YYYY-MM-DD 与全年相接的日期,在您的 Phabricator 时区中读作当天的开始; null 将取去. 也接受一个时代,但只复制一个从 maniphest:deadline.epoch:计算出来的一天很容易在另一个时区被淘汰. 一个没有这个字段的Phabricator,或者带有无法通过Conduit设置的扩展版本,拒绝整个编辑(Phabricator)has invalid type "maniphest:deadline"),而改变无.
代码审查( 差异)
| 工具 | 说明 |
|---|---|
phabricator_revision_search | 搜索代码审查修订 |
phabricator_revision_edit | 编辑修订(接受、仅接受选定的审查者、拒绝、放弃、增加审查者、评论等) |
phabricator_revision_inline_comment | 创建一个线条或字符范围的内置注释草案,可选择使用建议编辑,或对已公布的线条回复 |
phabricator_revision_inline_search | 列出修改后与侧面、 范围、 建议编辑和 Done 状态的内置评论 |
phabricator_revision_inline_publish | 将您的内置评论草稿作为一次评论发布, 如“ 提交” 在网络 UI 中 |
phabricator_revision_inline_done | 选中或取消选中内置注释中的“ 完成 ” |
phabricator_revision_inline_edit | 替换文本并建议编辑您的内置注释草稿 |
phabricator_revision_inline_delete | 删除您的内置注释草稿 |
phabricator_diff_raw | 通过 ID 获取 diff/ patch 的原始 diff 内容 |
phabricator_diff_search | 搜索 diffs( 修订版中的代码更改快照) |
phabricator_revision_paths | 获取修改后的文件路径列表 |
这个 phabricator_revision_inline_* 工具调用 differential.inline.* 管道方法,Phabricator不载运。 没有他们, phabricator_revision_inline_comment 仍然通过创建平线注释 differential.createinline,但这些草案不能通过Conduit发布. 答复(replyToInlineID)需要一个支持他们的扩展版本;一个年长的人拒绝呼叫(does not define these parameters: 'replyToInlineID'),并创造出一无所有.
phabricator_revision_edit是因为 acceptAs 仅代表审查者接受所列内容,如网页UI的"接受为"复选框所示: ["self"] 为您单独接受, 绝不为您所属的组, 而投影或包 PHIDs 添加这些组 . action: "accept" 为所属的每个群体接受;两者不能合并. acceptAs 需要 Freelancer 的 Phabricator 扩展名 accept.as 交易); 一个Phabricator, 不拒绝整个编辑( P)has invalid type "accept.as"),而改变无.
仓库( 分散)
| 工具 | 说明 |
|---|---|
phabricator_repository_search | 搜索仓库 |
phabricator_commit_search | 搜索承诺 |
phabricator_repository_browse | 浏览仓库目录树 |
phabricator_repository_file_content | 从仓库读取文件的文本, 全部或按行范围读取 |
phabricator_branch_search | 在仓库中列出分支 |
phabricator_tag_search | 在仓库中列出标签 |
phabricator_repository_file_history | 获取文件路径的历史 |
phabricator_repository_code_search | 在仓库中搜索( grep) 文件内容 |
phabricator_repository_edit | 创建或编辑扩散寄存器 |
用户
| 工具 | 说明 |
|---|---|
phabricator_user_whoami | 获取当前认证用户 |
phabricator_user_search | 搜索用户 |
项目
| 工具 | 说明 |
|---|---|
phabricator_project_search | 搜索项目 |
phabricator_project_edit | 创建或编辑工程 |
phabricator_column_search | 搜索工作板列 |
粘贴
| 工具 | 说明 |
|---|---|
phabricator_paste_search | 搜索粘贴 |
phabricator_paste_create | 创建粘贴 |
phabricator_paste_edit | 编辑已存在的粘贴 |
维基 (字典)
| 工具 | 说明 |
|---|---|
phabricator_document_search | 搜索维基文档 |
phabricator_document_create | 创建新维基文档 |
phabricator_document_edit | 编辑维基文档标题或内容 |
phabricator_document_add_comment | 在维基文档中添加注释 |
博客 (页)
| 工具 | 说明 |
|---|---|
phabricator_blog_search | 搜索 Phame 博客 |
phabricator_blog_edit | 创建或编辑 Phame 博客 |
phabricator_blog_post_search | 搜索博客文章 |
phabricator_blog_post_create | 创建新博客帖 |
phabricator_blog_post_edit | 编辑已存在的博客文章 |
phabricator_blog_post_add_comment | 在博客文章中添加注释 |
交易
| 工具 | 说明 |
|---|---|
phabricator_transaction_search | 在任何对象上搜索交易(评论、状态变化等) |
phabricator_transaction_comment_edit | 替换您关于任何对象的已发表评论的文本 |
phabricator_transaction_comment_edit 呼唤 transaction.comment.edit Conduit 方法, 存储 Phabricator 不发运; 服务器将工具隐藏在一个实例上而不发运它 .
文件
| 工具 | 说明 |
|---|---|
phabricator_file_upload | 上传一个文件,并获取一个ID,以便通过 {F<id>} |
phabricator_file_search | 搜索文件 |
phabricator_file_info | 获取文件元数据( 名称、 大小、 MIME 类型、 URI) |
建筑( Harbormaster)
| 工具 | 说明 |
|---|---|
phabricator_buildable_search | 搜索可建设备(有建筑物的修订版/承诺) |
phabricator_build_search | 搜索构建(CI/构建结果) |
phabricator_build_target_search | 搜索构建目标(个人构建步骤) |
phabricator_build_log_search | 搜索构建日志( 构建步骤输出) |
phabricator_build_command | 向港务长报告建设状况(通过、失败、工作) |
phabricator_build_plan_search | 搜索构建计划(CI管道配置) |
代码所有权( Owners)
| 工具 | 说明 |
|---|---|
phabricator_owners_search | 搜索代码所有权软件包 |
活动种子
| 工具 | 说明 |
|---|---|
phabricator_feed_query | 查询活动种子(最近的任务更新、修改、承诺等) |
聊天( 连线)
| 工具 | 说明 |
|---|---|
phabricator_conpherence_create | 创建一个新的聊天室/线索,由您作为参与者 |
phabricator_conpherence_edit | 编辑聊天室( 重命名、 管理参与者) |
phabricator_conpherence_read | 从聊天线索读取信件 |
phabricator_conpherence_send | 发送消息到聊天线索 |
审计
| 工具 | 说明 |
|---|---|
phabricator_audit_query | 搜索承诺审计请求 |
PHID 公用事业
| 工具 | 说明 |
|---|---|
phabricator_phid_lookup | 按名称查找 PHID( 如“ T123 ” 、 “ @ 用户名 ” ) |
phabricator_phid_query | 获取 PHID 的详细信息 |
服务器
| 工具 | 说明 |
|---|---|
phabricator_version | 获取运行中的 phabricator- mcp 服务器的版本 |
使用量
一旦连接起来, 请您的AI助手用自然语言执行 Phabricator 任务 :
任务
- "展示我的任务"
- 在工程后端创建名为“ Fix 登录错误” 的任务
- "增加给T12345的评语,称"修补工作已经做好审查准备"
- "结束任务 T12345"
- "有什么定制的字段可以用于事件任务?"
- "在T12345上设置起步日期和根源类别"
- "确定到期日为T12345至2026年11月20日"
- "让T456成为T123的子任务"
- "装入这个截图 并添加到T789的描述"
代码审查
- "露出我的露天潜水艇"
- "D6789状态如何"
- "审查D6789的代码变化"
- "Add @alice 作为D6789的审查员"
- "接受D6789" (中文(简体) )
- "接受D6789只为我自己,不为我的团队"
- "对D6789中src/index.ts 第42行的内在评论"
- "为D6789的src/config.ts 第10-12行建议编辑,然后发表我的评论"
- " 重写我对D6789中的src/config.ts的内在评论稿,并删除12行的"
- "解决D6789未解决的内在评论"
- 回答D6789的内在评论 问我一个问题,然后发表
仓库和构建
- "在后端显示src/config.ts的内容"
- "在主回放中浏览/sc目录"
- "这栋建筑是经过D6789吗?"
- "给我看D6789的建筑日志"
- "谁拥有/src/auth/中的代码"
搜索( L)
- "找到用户约翰多"
- 搜索名下有后端的项目
- "搜捕作者的虱子"
- "寻找T123和D456"
- "给我看关于D6789的评论"
- "在T12345上我最后的评语中解答"
维基粘贴( P)
- "寻找关于部署的维基页面"
- "用这个错误日志创建粘贴"
博客
- 搜索博客文章
- "在工程博客上创建名为"Q1更新"的新博客草案"
- J42的博客
- "添加评论到J15的博客"
根据您的请求自动调用合适的工具 .
发展
git clone https://github.com/freelancer/phabricator-mcp.git
cd phabricator-mcp
npm install
npm run build
npm test
npm run dev # watch mode
见 捐款额 在打开拉动请求前, 如何对照真实的 Phabricator 检查更改 .
建筑
src/index.ts- 入境点,带有Stdio运输的MCP服务器src/config.ts- 配置装载器(阅读)~/.arcrc(原始内容存档于2018-10-21) (中文(简体) )src/client/conduit.ts- Phabricator Conduit API 客户端src/tools/*.ts- 每个Phabricator应用程序的工具实施
许可证
麻省理工学院