Gitopia MCP服务器
MCP服务器 吉托皮亚 --分散的Git,具有链上治理、赏金和DAO管理。适用于Cursor、VS Code、克劳德代码、克劳德桌面、Windsurf和任何兼容MCP的工具。
57工具 | 3个提示 | 4个资源模板
零配置启动:首次使用时自动生成钱包。除了粘贴配置代码片段外,没有其他设置。
快速开始
Docker(推荐)
docker pull ghcr.io/gitopia/gitopia-mcp-server:latest然后为编辑器添加配置(请参阅 编辑器设置 在......下面
原生二进制
下载自 ,或:
go install github.com/gitopia/gitopia-mcp-server/cmd/server@latest需要Go 1.25+和 git-remote-gitopia的 (curl https://get.gitopia.com | bash).
编辑器设置
OpenAI Codex
codex mcp add gitopia -- docker run --rm -i --platform linux/amd64 \
-v "${HOME}/.mcp/gitopia:/home/mcp/.mcp/gitopia" \
-e MCP_WORKSPACE_PATH=/home/mcp/.mcp/gitopia/workspace \
ghcr.io/gitopia/gitopia-mcp-server:latest stdio或添加到 ~/.codex/config.toml:
[mcp_servers.gitopia]
command = "docker"
args = [
"run", "--rm", "-i", "--platform", "linux/amd64",
"-v", "${HOME}/.mcp/gitopia:/home/mcp/.mcp/gitopia",
"-e", "MCP_WORKSPACE_PATH=/home/mcp/.mcp/gitopia/workspace",
"ghcr.io/gitopia/gitopia-mcp-server:latest", "stdio"
]Claude Code
添加到您的项目 .mcp.json:
{
"mcpServers": {
"gitopia": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--platform", "linux/amd64",
"-v", "${HOME}/.mcp/gitopia:/home/mcp/.mcp/gitopia",
"-v", "${PWD}:/workspace", "-w", "/workspace",
"-e", "MCP_WORKSPACE_PATH=/workspace",
"ghcr.io/gitopia/gitopia-mcp-server:latest", "stdio"
],
"env": {}
}
}
}Cursor
添加 ~/.cursor/mcp.json (macOS)或 %APPDATA%\Cursor\mcp.json (Windows):
{
"mcpServers": {
"gitopia": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--platform", "linux/amd64",
"-v", "${HOME}/.mcp/gitopia:/home/mcp/.mcp/gitopia",
"-v", "${workspaceFolder}:/workspace", "-w", "/workspace",
"-e", "MCP_WORKSPACE_PATH=/workspace",
"ghcr.io/gitopia/gitopia-mcp-server:latest", "stdio"
],
"env": {}
}
}
}VS Code
Windsurf
Claude Desktop
添加 ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"gitopia": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--platform", "linux/amd64",
"-v", "${HOME}/.mcp/gitopia:/home/mcp/.mcp/gitopia",
"-e", "MCP_WORKSPACE_PATH=/home/mcp/.mcp/gitopia/workspace",
"ghcr.io/gitopia/gitopia-mcp-server:latest", "stdio"
],
"env": {}
}
}
}使用现有钱包? 集 GITOPIA_MNEMONIC 在shell中,然后添加 "-e", "GITOPIA_MNEMONIC" 不要在配置文件中硬编码助记符。
工具(57)
上下文管理(4)
| 工具 | 说明 |
|---|---|
get_user_context | 获取当前身份、地址和可用DAO |
set_active_dao | 将操作切换到DAO上下文 |
refresh_user_context | 从链中重新加载用户信息 |
claim_fee_grant | 水龙头索赔费补助 |
用户管理(1)
| 工具 | 说明 |
|---|---|
create_user | 为钱包创建链上Gitopia用户 |
存储库管理(7)
| 工具 | 说明 |
|---|---|
list_repos | 列出所有者的存储库 |
create_repo | 创建远程存储库 |
get_repo | 获取存储库详细信息 |
list_branches | 列出分支 |
get_file_contents | 读取文件而不进行克隆 |
fork_repository | 分叉存储库 |
toggle_repository_forking | 启用/禁用叉车 |
标签,提交,发布(4)
| 工具 | 说明 |
|---|---|
list_tags | 列出版本标签 |
list_commits | 浏览分支的提交历史记录 |
list_releases | 列出已发布的版本 |
create_release | 发布新版本 |
问题管理(5)
| 工具 | 说明 |
|---|---|
list_issues | 列出问题 |
get_issue | 获取完整的问题详细信息 |
create_issue | 创建问题(链上) |
comment_on_issue | 对问题的评论(链上) |
update_issue | 更新状态、标签、受让人 |
拉取请求管理(6)
| 工具 | 说明 |
|---|---|
list_pull_requests | 列出PR |
get_pull_request | 获取完整的PR详细信息 |
get_pull_request_diff | 获得PR的统一差异 |
create_pull_request | 创建PR(链上) |
comment_on_pull_request | 对PR的评论(一般或内联) |
merge_pull_request | 合并PR(链上) |
Git操作(5)
| 工具 | 说明 |
|---|---|
git_clone | 将存储库克隆到工作区 |
git_push | 推送提交到远程 |
create_feature_branch | 创建并签出新分行 |
sync_with_remote | 获取并合并/重基化 |
commit_and_push_changes | 一步到位+提交+推送 |
工作流编排(3)
| 工具 | 说明 |
|---|---|
bootstrap_repo | 创建远程+本地init+文件+推送 |
create_feature_branch_pr | 分支+更改+提交+推送+公关 |
update_feature_branch | 向现有分支机构/PR添加承诺 |
标签管理(3)
| 工具 | 说明 |
|---|---|
list_labels | 列出存储库标签 |
create_label | 创建标签(在链上) |
delete_label | 删除标签(链上) |
DAO与治理(9)
| 工具 | 说明 |
|---|---|
get_dao | 获取DAO详细信息,包括group_id和group_policy_address |
create_dao | 使用成员和投票创建DAO |
dao_list_members | 列出DAO成员和权重 |
dao_list_proposals | 列出治理建议 |
dao_get_proposal | 通过理货获取提案详细信息 |
dao_update_members | 添加/删除/更改成员权重 |
dao_submit_proposal | 创建治理方案 |
dao_vote | 对提案进行投票 |
dao_exec | 执行通过的提案 |
赏金管理(6)
| 工具 | 说明 |
|---|---|
list_bounties | 发现赏金 |
get_bounty | 获取赏金详细信息 |
create_bounty | 将加密奖励附加到发行 |
update_bounty | 修改赏金到期 |
close_bounty | 停用赏金 |
delete_bounty | 永久删除赏金 |
批处理和批准(4)
| 工具 | 说明 |
|---|---|
batch_execute | 在一个事务中执行多达10个操作 |
confirm_transaction | 广播待处理交易 |
reject_transaction | 取消待处理交易 |
list_pending_transactions | 列出待处理交易 |
提示
| 提示 | 描述 |
|---|---|
fix-issue | 完整的工作流程:克隆、分支、修复、测试、PR |
review-pr | 审查拉取请求:检查、评论、批准 |
hunt-bounty | 发现奖金、评估、索赔、修复、提交 |
安全
- 信任级别 闸门工具通道:
readonly\<localwrite\<chainwrite - 速率限制 链上写入操作(默认10/min,100/hr)
- 邮件列表 只有标志
/gitopia.gitopia.gitopia.*和/cosmos.group.v1.* - 工作空间隔离 阻止路径遍历攻击
- 审批方式 在广播之前保存交易以进行明确确认
- 非root Docker 容器以无特权用户身份运行
看 安全.md 用于漏洞报告。
配置
| 变量 | 默认值 | 描述 |
|---|---|---|
GITOPIA_MNEMONIC | 自动生成 | BIP-39钱包助记符 |
GITOPIA_GRPC_ENDPOINTS | gitopia-grpc.polkachu.com:11390 | gRPC端点 |
TRUST_LEVEL | chainwrite | readonly, localwrite, chainwrite |
TOOLSETS | all | 启用逗号分隔的工具集(见下文) |
DRY_RUN | false | 预览交易而不进行广播 |
APPROVAL_MODE | false | 在写入链之前需要确认 |
MCP_WORKSPACE_PATH | ~/.mcp/gitopia/workspace | 工作区根目录 |
MCP_LOG_LEVEL | info | 日志级别 |
TRANSPORT | stdio | stdio 或 http |
PORT | 8080 | HTTP侦听端口(当TRANSPORT=HTTP时) |
看 env.example 查看完整列表。
工具集
控制哪些工具暴露给MCP客户端。有助于减少AI助手中上下文窗口的使用。
| 工具集 | 工具 | 说明 |
|---|---|---|
core | 52 | 除工作流编排器(始终包括在内)之外的所有工具 |
workflow | 5 | bootstrap_repo, create_feature_branch, create_feature_branch_pr, update_feature_branch, commit_and_push_changes |
TOOLSETS=all(默认):所有57个工具TOOLSETS=core:52个工具(隐藏工作流编排器)TOOLSETS=core,workflow:与all
对于Claude Code用户, TOOLSETS=core 建议使用,因为Claude可以原生编排git操作。
发展
go build ./cmd/server # build
go test ./... # test
go vet ./... # lint
docker build -t gitopia-mcp-server:latest . # docker看 贡献.md 发展指南。
