跳转到内容

MCP Server 配置指南

Rotifer MCP Server 让所有支持 MCP 的 Agent 能够直接访问整个 Gene 生态。支持 Claude Desktop、Cursor、VS Code、Windsurf、JetBrains、Zed、Trae、CodeBuddy、通义灵码等主流 IDE。

大多数 IDE 使用标准 mcpServers 格式。在你的 IDE 的 MCP 配置中添加:

{
"mcpServers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

VS Code / GitHub Copilot 和 Zed 使用不同的配置格式,请参考下方各 IDE 的详细说明。

编辑配置文件:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

保存后重启 Claude Desktop。

在项目根目录创建 .cursor/mcp.json,或编辑全局配置 ~/.cursor/mcp.json

{
"mcpServers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

VS Code 使用 servers 字段(而非 mcpServers),并需要指定 type。在项目根目录创建 .vscode/mcp.json

{
"servers": {
"rotifer": {
"type": "stdio",
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

也可通过命令面板 MCP: Add Server 添加。GitHub Copilot 在 VS Code 中使用相同配置。

编辑配置文件:

  • macOS / Linux: ~/.codeium/windsurf/mcp_config.json
  • Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
{
"mcpServers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

JetBrains (IntelliJ IDEA / WebStorm / PyCharm 等)

Section titled “JetBrains (IntelliJ IDEA / WebStorm / PyCharm 等)”

打开 Settings → Tools → AI Assistant → Model Context Protocol (MCP),点击 Add (+),选择 STDIO

{
"mcpServers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

需要 IntelliJ 2025.1 或更高版本。支持 STDIO、HTTP、SSE 传输协议。

Zed 使用 context_servers 格式。编辑 Settings(Cmd+,)或通过命令面板 agent: open settings

{
"context_servers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

Cline 使用独立配置文件 cline_mcp_settings.json。在 VS Code 中打开 Cline 侧栏 → MCP Servers → 添加:

{
"mcpServers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

.continue/config.yaml 中添加 MCP Server 配置:

mcpServers:
- name: rotifer
command: npx
args:
- "@rotifer/mcp-server"

也支持导入 Claude Desktop / Cursor 格式的 JSON 配置。MCP 功能仅在 Agent 模式下可用。

在项目根目录创建 .trae/mcp.json,或编辑全局配置 ~/.trae/mcp.json

{
"mcpServers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

也可通过 Trae 内置的 MCP 市场搜索并一键安装。需要 Trae v1.3.0 或更高版本。

编辑用户配置 ~/.codebuddy/.mcp.json,或项目根目录 .mcp.json

{
"mcpServers": {
"rotifer": {
"type": "stdio",
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

也可通过对话面板右上角的 MCP 市场搜索安装。

打开右上角头像 → 个人设置 → MCP 服务 → 手动添加(STDIO):

{
"mcpServers": {
"rotifer": {
"command": "npx",
"args": ["@rotifer/mcp-server"]
}
}
}

也可在 ModelScope MCP 广场中搜索安装。需要通义灵码 v2.5 或更高版本。

MCP 功能仅在智能体模式下可用,最多同时连接 10 个 MCP 服务。

MCP Server 默认以匿名模式运行,可直接搜索和浏览公开 Gene。如需使用 Cloud 功能(发布 Gene、管理个人资料等),需先登录:

Terminal window
npx @rotifer/mcp-server login

支持 GitHub 和 GitLab OAuth 登录。指定提供商:

Terminal window
npx @rotifer/mcp-server login --provider github

登出:

Terminal window
npx @rotifer/mcp-server logout

凭证存储在 ~/.rotifer/credentials.json,与 @rotifer/playground CLI 共享。

查询 Rotifer Cloud 注册表,无需认证。

工具描述关键参数
search_genes按名称、领域或保真度搜索 Gene 生态query, domain, fidelity, sort, page, per_page
get_gene_detail获取 Gene 详细信息,包括表现型和适应度gene_id(Gene UUID、名称或 content hash),content_hash(可选替代)
get_arena_rankings查看按 F(g) 排序的领域 Arena 排名domain, page, per_page
compare_genes2-5 个 Gene 的适应度并排对比gene_ids(UUID 数组,必填)
get_gene_stats查看 Gene 下载统计(总量、7 天、30 天、90 天)gene_id(必填)
get_leaderboard查看创作者声誉排行榜limit(默认 20,最大 100)
get_developer_profile按用户名获取创作者资料和声誉数据username(必填)
list_gene_versions查看 Gene 版本历史链owner, gene_name(均必填)
get_gene_reputation获取 Gene 声誉详细分解(Arena、使用量、稳定性)gene_id(必填)
suggest_domain根据描述推荐匹配的 domaindescription(必填)

操作本地 Agent 工作区目录中的 Gene 和 Agent。

工具描述关键参数
list_local_genes扫描本地 Agent 工作区中已安装的 Geneproject_root, domain, fidelity
list_local_agents列出本地工作区中注册的 Agentproject_root, state
init_gene初始化新 Gene 项目(生成 phenotype.json 模板)gene_name(必填), fidelity, domain, no_genesis, project_root
scan_genes扫描源文件中可封装为 Gene 的候选函数或 SKILL.mdpath, skills, skills_path, project_root
wrap_gene将函数或 SKILL.md 封装为 Rotifer Genegene_name(必填), domain, fidelity, from_skill, from_clawhub, project_root
compile_gene将 Gene 编译为 WASMgene_name(必填), check, wasm_path, lang, project_root
run_gene执行本地 Genegene_name(必填), input, verbose, no_sandbox, trust_unsigned, project_root
test_gene在沙箱中测试 Gene(Schema、I/O、编译)gene_name(必填), verbose, compliance, project_root
install_gene从 Cloud 注册表安装 Gene 到本地 Agent 工作区gene_id(必填), force, project_root
vg_scanV(g) 安全扫描——Gene/Skill 代码静态分析(等级 A/B/C/D/?)path, gene_id, all, project_root

修改 Rotifer Cloud 中的数据,需先认证(运行 login)。

工具描述关键参数
publish_gene发布 Gene 到 Rotifer Cloudgene_name, all, description, changelog, skip_arena, skip_security, project_root
arena_submit提交 Gene 到 Arena(5 维适应度评分)gene_id, fitness_value, safety_score, success_rate, latency_score, resource_efficiency(均必填)
create_agent通过组合本地 Gene 创建 Agentagent_name(必填), gene_ids(必填,≥1), compositionSeq/Par/Cond/Try/TryPool), domain(仅元数据), strategy, par_merge, project_root
agent_run按名称运行本地 Agentagent_name(必填), input, verbose, no_sandbox, project_root
工具描述关键参数
auth_status检查当前认证状态(用户名、提供商、过期时间)
login通过 OAuth 登录 Rotifer Cloud(打开浏览器)providergithubgitlab,默认 github), endpoint
logout登出并清除本地凭证
get_mcp_statsMCP Server 调用分析(调用量、延迟、热门工具)days(默认 7)。需认证。
get_my_reputation获取当前登录创作者的声誉和统计数据— 。需认证。

MCP Server 还提供 Resource 模板,Agent 可通过 URI 直接读取数据:

URI 模板描述
rotifer://genes/{gene_id}/statsGene 下载统计
rotifer://genes/{gene_id}Gene 完整元数据和表现型
rotifer://developers/{username}创作者资料和声誉
rotifer://leaderboard按声誉排序的顶级创作者
rotifer://local/genes当前 Agent 工作区中所有已安装的 Gene
rotifer://local/agents当前 Agent 工作区中所有已注册的 Agent
rotifer://versionMCP Server 版本及更新可用性

配置完成后,Agent 可以:

"搜索网页抓取相关的基因"
→ search_genes({ query: "web scraping" })
"哪个搜索基因的适应度最高?"
→ get_arena_rankings({ domain: "search.web" })
"对比这两个基因"
→ compare_genes({ gene_ids: ["uuid1", "uuid2"] })
"谁的声誉分最高?"
→ get_leaderboard({ limit: 10 })
"查看本地安装了哪些基因"
→ list_local_genes({})
"创建一个文本摘要的 Gene"
→ init_gene({ gene_name: "summarize.text.my-v1", fidelity: "Wrapped" })
"发布我的 Gene 到云端"
→ publish_gene({ gene_name: "summarize.text.my-v1" })
"对我的 Gene 做安全扫描"
→ vg_scan({ path: "genes/summarize.text.my-v1", gene_id: "summarize.text.my-v1" })
"检查我的认证状态"
→ auth_status()
"查看某个 Gene 的版本历史"
→ list_gene_versions({ owner: "alice", gene_name: "search.web.google-v2" })

每个 MCP 工具都对应一个或多个 CLI 命令(反之亦然)。在 CLI 和 MCP 工作流之间切换时参考此表。

CLI 命令MCP 工具备注
rotifer searchsearch_genes
rotifer info <gene-ref>get_gene_detailCLI 用 info,MCP 用 get_gene_detail
rotifer arena listget_arena_rankings
rotifer comparecompare_genes
rotifer statsget_gene_stats
rotifer reputation --leaderboardget_leaderboard
rotifer reputation [gene-ref]get_gene_reputation
rotifer reputation --mineget_my_reputation需认证
rotifer whoamiauth_statusCLI whoami = MCP auth_status
rotifer versionslist_gene_versions
rotifer listlist_local_genes
rotifer agent listlist_local_agents
rotifer initinit_gene
rotifer scanscan_genes
rotifer wrapwrap_gene
rotifer compilecompile_gene
rotifer runrun_gene
rotifer testtest_gene
rotifer installinstall_gene
rotifer publishpublish_gene需认证
rotifer arena submitarena_submit需认证
rotifer agent createcreate_agent
rotifer agent runagent_run
rotifer loginlogin
rotifer logoutlogout
rotifer arena watch交互式命令,无 MCP 对应
rotifer network *P2P 桩实现,无 MCP 对应
rotifer vgvg_scan返回 JSON 报告(等级 + 发现列表)
get_mcp_statsMCP 专有:调用分析
suggest_domainMCP 专有:domain 推荐
get_developer_profileMCP 专有(CLI 用 reputation

如果你使用 OpenClaw,Rotifer 可作为 MCP 类型的 Skill 使用。手动安装:

Terminal window
git clone https://github.com/rotifer-protocol/rotifer-self-evolving-agent.git \
~/.openclaw/workspace/skills/rotifer-self-evolving-agent

重启 OpenClaw 后,使用 /rotifer 即可访问所有 Gene 生态工具。

WebMCP(Web Model Context Protocol)让浏览器端 AI Agent 能够直接从网页中发现和调用 Rotifer 工具——无需任何服务端配置。

Rotifer 主站和 rotifer.ai 页面中嵌入了声明式 <form> 标签,向 WebMCP 兼容的 Agent 暴露可调用的工具:

<form hidden toolname="search_docs"
tooldescription="搜索 Rotifer 协议文档">
<input name="query" type="text"
toolparamdescription="搜索关键词" />
</form>

当 Agent 访问 rotifer.devrotifer.ai 时,会自动发现这些工具并直接调用,无需手动配置。

rotifer.ai(14 个工具:10 个只读 + 4 个写入):

工具描述可执行
search_genes搜索 Gene 生态
get_gene_detail按名称或 UUID 获取 Gene 详情是(含 gene_name→UUID 解析)
get_arena_rankings查看 Arena 排名
compare_genes并排对比 2-5 个 Gene
get_gene_stats获取下载和使用统计
get_leaderboard按声誉排名的顶级创作者
get_developer_profile创作者资料及其 Gene
list_gene_versionsGene 版本历史
get_gene_reputationGene 声誉详情
get_rotifer_capabilities列出全部工具及可用性是(元工具)
set_gene_visibility设置 Gene 为已发布/可见(WebMCP 专有)是(需登录)
request_arena_evaluation请求服务端 Arena 评估(WebMCP 专有)是(需登录)
create_gene在注册表中创建 Gene 条目(WebMCP 专有)是(需登录)
update_gene_metadata更新 Gene 元数据(WebMCP 专有)是(需登录)

命名说明set_gene_visibilityrequest_arena_evaluation 是 WebMCP 专有工具,与 MCP 工具 publish_genearena_submit 刻意使用不同名称。MCP 版本执行完整的本地→云端管道,WebMCP 版本仅执行简单的浏览器端操作。详见 ADR-198 语义等价约束。

rotifer.dev(3 个工具):

工具描述可执行
search_docs搜索协议文档仅发现
get_mcp_config获取 MCP Server 配置代码片段
suggest_domain根据描述推荐 Gene domain

注意:rotifer.ai 的 WebMCP 工具接受 Gene 名称(如 search.web.google-v2)和 UUID,会自动解析为 UUID 后查询 Cloud API。

WebMCP 是 W3C 社区组规范,Chrome 146(2026 年 2 月)已提供 Early Preview。支持实现了 Web MCP 规范 的 Agent,包括浏览器扩展和具有网页浏览能力的 Agent 框架。

变量描述默认值
ROTIFER_CLOUD_ENDPOINTCloud API 端点https://cloud.rotifer.dev
ROTIFER_CLOUD_ANON_KEYAPI 密钥(内置)
  • Node.js >= 20
  • 互联网连接(需访问 Rotifer Cloud API)

“Tool not found” 错误:确保 npx 在 PATH 中且 Node.js >= 20 已安装。

连接超时:检查网络连接。MCP Server 需要连接 cloud.rotifer.dev

无搜索结果:Gene 生态处于 alpha 阶段。尝试更宽泛的搜索词,或使用 get_arena_rankings({}) 查看可用领域。