跳转到内容

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、管理个人资料等),需先登录:

终端窗口
npx @rotifer/mcp-server login

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

终端窗口
npx @rotifer/mcp-server login --provider github

登出:

终端窗口
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), composition(Seq/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(打开浏览器)。HTTP 下不可用provider(github 或 gitlab,默认 github)
logout登出并清除本地凭证。HTTP 下不可用—
get_mcp_statsMCP Server 调用分析(调用量、延迟、热门工具)days(默认 7)。需认证。
get_my_reputation获取当前登录创作者的声誉和统计数据— 。需认证。

login 工具只登录已配置的 Cloud 端点,不接受 endpoint 参数。要使用自建 Cloud,请在 ~/.rotifer/cloud.json 里设置 endpoint,或设置 ROTIFER_CLOUD_ENDPOINT,或在终端运行 npx @rotifer/mcp-server login --endpoint <url>。

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 使用。手动安装:

终端窗口
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.dev 或 rotifer.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_visibility 和 request_arena_evaluation 是 WebMCP 专有工具,与 MCP 工具 publish_gene 和 arena_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 框架。

上面各节的配置都是由 IDE 通过 stdio 启动服务器,下面的内容不影响它们。如果你想自己运行服务器、通过 Streamable HTTP 连接,用 serve:

终端窗口
npx @rotifer/mcp-server serve # http://127.0.0.1:3000/mcp
npx @rotifer/mcp-server serve --port 8080
# 让其他机器能连:需要一份名称列表和一个访问令牌
openssl rand -hex 32 > mcp-token
chmod 600 mcp-token
npx @rotifer/mcp-server serve --host 0.0.0.0 --allowed-hosts mcp.example.com --token-file mcp-token

服务器的工具以这台机器上登录的 Rotifer 账号行事,所以它会限制谁能连上:

  • 不加 --host 时只在本机监听。默认地址是 127.0.0.1。
  • 在本机以外监听,必须给 --allowed-hosts 和访问令牌。--host 不是 127.0.0.1、::1、localhost 时,要列出客户端连接时用的主机名或 IP 地址,用逗号分隔,不带协议、端口、路径或通配符;再用 --token-file <路径> 或环境变量 ROTIFER_MCP_HTTP_TOKEN 给出令牌,两者只能选一个。缺任何一项,serve 都不会启动,以退出码 2 结束。令牌不能直接写在命令行上,因为本机的其他程序能读到命令行。这是 0.20.0 起的行为,之前的版本缺了也照样启动。
  • 只在本机监听时,令牌是可选的。设了令牌就会检查。
  • 请求必须用服务器认得的名称。Host 请求头,以及浏览器发送的 Origin 请求头,必须是 127.0.0.1、localhost、[::1] 或 --allowed-hosts 里的名称,否则返回 403。这样网页就不能把自己的域名指向你的机器来连上服务器。
  • 设了令牌时,除 CORS 预检外,每个请求都要带 Authorization: Bearer <令牌>。没带或不对返回 401。预检请求(OPTIONS)不查令牌,因为浏览器没法给它加这个请求头;它仍要通过 Host 和 Origin 检查,也不会调用任何工具。GET /health 不做这两项检查,用于存活检查。
  • 拿到令牌的人都以登录的账号行事。没有按用户分开的令牌。要收回访问权,换一个令牌并重启服务器。
  • 服务器用的是明文 HTTP。令牌随每个请求发送,所以能被其他机器连上的服务器,应该放在 HTTPS 反向代理或隧道后面。
  • HTTP 下不能用 login 和 logout。工具列表里没有它们,调用会返回错误,因为它们会在运行服务器的那台机器上登录或登出。请在那台机器的终端里运行 npx @rotifer/mcp-server login 或 logout。

在客户端里发送令牌时,从环境变量或输入框读取,令牌就不会写进配置文件。

Claude Code,写在 .mcp.json:

{
"mcpServers": {
"rotifer": {
"type": "http",
"url": "https://mcp.example.com/mcp",
"headers": { "Authorization": "Bearer ${ROTIFER_MCP_HTTP_TOKEN}" }
}
}
}

Cursor,写在 mcp.json:

{
"mcpServers": {
"rotifer": {
"url": "https://mcp.example.com/mcp",
"headers": { "Authorization": "Bearer ${env:ROTIFER_MCP_HTTP_TOKEN}" }
}
}
}

VS Code,写在 mcp.json:

{
"inputs": [
{ "type": "promptString", "id": "rotifer-token", "description": "Rotifer MCP access token", "password": true }
],
"servers": {
"rotifer": {
"type": "http",
"url": "https://mcp.example.com/mcp",
"headers": { "Authorization": "Bearer ${input:rotifer-token}" }
}
}
}

Claude Desktop 用 stdio。

变量描述默认值
ROTIFER_CLOUD_ENDPOINTCloud API 端点https://cloud.rotifer.dev
ROTIFER_CLOUD_ANON_KEYAPI 密钥(内置)
ROTIFER_MCP_HTTP_TOKEN通过 HTTP 运行 serve 时的访问令牌(见通过 HTTP 提供服务)(无)
  • Node.js >= 20
  • 互联网连接(需访问 Rotifer Cloud API)

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

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

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