MetaMCP

io.github.mentu-ai由 GitHub 账号 mentu-ai 发布v1.0.0更新于 Oct 25, 2026

Route long-tail MCP servers through three lazy tools and reviewed declarative Methods.

已验证STDIO仅桌面效率与工作流开发者工具

概览

AI 生成的概览

MetaMCP 是一个本地网关,向助手提供三个稳定工具,用于发现、按需调用并运行声明式 Method,以接入各类长尾 MCP 服务器。

可以做什么
发现已配置的服务器、缓存的工具 schema 和已审核的 Method,无需启动全部子服务器,并可按服务器从实时工具列表刷新。按需调用一个明确指定的子工具,可设置超时,失败后不会自动重放。运行有边界、经 schema 校验的声明式 Method,跨子服务器串联步骤,带读写效果声明、截止时间和逐步追踪。从本地记录导出哈希链接的证据包,涵盖已完成的调用与运行。可通过命令行浏览并添加图库服务器,工具调用本身不会安装任何软件包。
适用场景
当你有许多不规则的、长尾的 MCP 服务器,又希望保持客户端工具面精简时使用。适合重复的多步骤“获取—规范化—分析”流程,可用带版本、可测试的 Method 固化。高频、紧凑、安全敏感或强认证的服务器应保持直连。
运行要求
需要 Node.js 20 或更高版本;以 stdio 或 Streamable HTTP 在本地运行。需通过配置参数提供列出子服务器的配置文件。子服务器凭据从宿主环境引用,未解析的引用会导致启动失败。可选的语义搜索需显式设置 METAMCP_VOYAGE_API_KEY。写入或混合效果的 Method 需以允许写入的参数启动。
安装前请注意
子服务器是拥有自身权限的可信代码;MetaMCP 只是策略边界,不是操作系统沙箱,应审查命令并固定版本。不要将计费、基础设施变更或身份类服务器接入。超时后不会重放调用,因为变更可能已完成。启用语义搜索会把发现查询发送给 Voyage。非回环 HTTP 绑定需配置 OAuth 校验或 METAMCP_HTTP_BEARER_TOKEN,浏览器来源必须显式允许。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MetaMCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MetaMCP

[npm version] [Node.js] [License] [CI]

MetaMCP is a secure, on-demand gateway for the long tail of MCP servers. It gives an MCP client three stable tools:

  • mcp_discover finds configured servers, cached tool schemas, and reviewed Methods without starting every child.
  • mcp_call lazily calls one explicitly named child tool.
  • mcp_run executes a bounded, schema-validated declarative Method.

MetaMCP is deliberately not a replacement for every direct MCP connection. Keep important, frequently used, compact, or strongly authenticated MCPs direct. Put irregular long-tail servers behind MetaMCP, and promote repeated multi-step rituals into Methods.

text
                               ┌─ direct: GitHub / Codex Apps / core runtimeMCP client ────────────────────┤                               └─ MetaMCP (3 tools)                                    ├─ discover cached capabilities                                    ├─ call one lazy child                                    └─ run reviewed Methods

When to use which path

PathBest fitWhy
Direct MCPHigh-frequency, compact, security-sensitive, or foundational serversPreserves typed schemas, native auth, and explicit approvals
mcp_discover + mcp_callLong-tail or irregular capabilitiesKeeps the client surface small without hiding the assembly language
mcp_runRepeated Acquire → Normalize → Analyze workflowsMakes bounded behavior testable, versioned, and evidence-producing

Do not route billing, infrastructure mutation, identity, or another high-consequence server through MetaMCP merely to reduce tool count. The right boundary is operational, not ideological.

Quick start

Requires Node.js 20 or newer.

bash
npx @mentu/metamcp@latest --config .mcp.json

Inspect the complete model-facing surface before configuring a client:

bash
npx @mentu/metamcp@latest toolsnpx @mentu/metamcp@latest tools --json

The inspector reads the same definitions returned by MCP tools/list, then exits before loading configuration, opening storage, starting a child, or binding a transport. --json includes the complete input schemas for automated review and version-to-version diffs.

Create .mcp.json:

json
{  "mcpServers": {    "filesystem": {      "command": "npx",      "args": ["-y", "@modelcontextprotocol/[email protected]", "/path/to/allowed/files"]    },    "internal-api": {      "command": "node",      "args": ["./servers/internal-api.js"],      "env": { "API_TOKEN": "${INTERNAL_API_TOKEN}" },      "inheritEnv": ["HTTP_PROXY"]    }  }}

Child servers start only when explicitly refreshed, called, or used by a Method. Plain discovery reads configuration and cached schemas; it does not spawn all children.

Server names are stable cache identities and must contain 1-128 letters, numbers, dots, underscores, or hyphens; path separators and traversal-like names are rejected.

Safe client setup

init is preview-only unless --yes is supplied. Without a named client it considers existing client config files only.

bash
metamcp init                         # preview, no writesmetamcp init --client Codex          # preview one clientmetamcp init --client Codex --yes    # apply atomically and write a .bak

Malformed JSON is rejected and left untouched. A named client may be created explicitly; MetaMCP never creates every supported client config by default.

For a manual client configuration, use an absolute path so the gateway does not depend on the client's working directory:

json
{  "mcpServers": {    "metamcp": {      "command": "npx",      "args": [        "-y",        "@mentu/metamcp@latest",        "--config",        "/absolute/path/to/.mcp.json"      ]    }  }}

@latest is convenient for evaluation. Pin @mentu/[email protected] in controlled environments so upgrades are deliberate and reviewable.

The three tools

Discover

json
{ "query": "capture screenshot", "kind": "tool" }

Discovery searches only live or cached schemas. To refresh one server from its live tool list:

json
{ "server": "browser", "refresh": true }

refresh without a server is rejected so an agent cannot accidentally fan out across the whole configuration.

Call

json
{  "server": "browser",  "tool": "capture_page",  "args": { "url": "https://example.com" },  "timeoutMs": 60000}

MetaMCP never automatically replays a child call after a timeout or transport failure. The child may have completed a mutation before the response was lost. A later Method may retry only when its manifest explicitly declares that step idempotency: "safe".

Run a Method

Put JSON manifests in .metamcp/methods/ or pass --methods <directory>. The child server and tool names below are illustrative; bind them to reviewed servers in your own config:

json
{  "apiVersion": "metamcp.io/v1alpha1",  "kind": "Method",  "metadata": {    "name": "content.acquire-and-normalize",    "version": "1.0.0",    "description": "Acquire content and normalize it into a stable record"  },  "spec": {    "effects": "read",    "inputSchema": {      "type": "object",      "properties": { "url": { "type": "string" } },      "required": ["url"],      "additionalProperties": false    },    "steps": [      {        "id": "acquire",        "server": "fetch",        "tool": "fetch",        "args": { "url": "${input.url}" }      },      {        "id": "normalize",        "server": "content",        "tool": "normalize",        "dependsOn": ["acquire"],        "args": { "document": "${steps.acquire.structuredContent}" }      }    ],    "output": "${steps.normalize.structuredContent}"  }}

Then call:

json
{ "method": "content.acquire-and-normalize", "input": { "url": "https://example.com" } }

Methods are declarative rather than arbitrary JavaScript. They have bounded step counts, deadlines and output sizes; input/output JSON Schemas; explicit read/write effects; safe interpolation; typed gaps; and a per-step trace. Write or mixed-effect Methods are disabled unless the gateway operator starts MetaMCP with --allow-writes.

See Method Mode, the manifest schema, and the example Method. The design generalizes the consistency layer documented by Crawlio Method Mode.

Configuration and secrets

${NAME} references in env and HTTP headers resolve from the host environment by default. An unresolved reference fails startup; it is never passed to a child as a literal placeholder.

MetaMCP does not copy its ambient environment into stdio children. It inherits only a small runtime allowlist (PATH, home/temp/locale variables, and platform equivalents), variables named in inheritEnv, and values explicitly set in the child env block. Embedders can install a custom SecretProvider for a keychain or vault.

Discovery is local keyword search by default. To opt into Voyage-backed semantic search, set METAMCP_VOYAGE_API_KEY explicitly; discovery queries will then be sent to Voyage and the optional local SQLite vector index will be enabled. Ambient ANTHROPIC_API_KEY or VOYAGE_API_KEY variables never activate network calls.

Remote child servers use url, transportType, headers, and the existing OAuth fields:

json
{  "mcpServers": {    "remote": {      "url": "https://mcp.example.com/mcp",      "transportType": "http",      "headers": { "Authorization": "Bearer ${REMOTE_TOKEN}" }    }  }}

HTTP gateway

HTTP mode binds to 127.0.0.1 by default:

bash
metamcp --transport http --port 8080 --config .mcp.json

An unauthenticated non-loopback bind fails closed. Configure OAuth resource-server validation or METAMCP_HTTP_BEARER_TOKEN before exposing the listener. Browser requests with an Origin header are denied unless the exact origin is supplied with --allow-origin or METAMCP_ALLOWED_ORIGINS.

MetaMCP serves legacy MCP clients and the 2026-07-28 stateless request envelope over stdio and Streamable HTTP. See Architecture for the supported boundary and deployment guidance.

Evidence

Completed mcp_call and mcp_run attempts are serialized into .metamcp/ledger.jsonl. Export a portable hash-linked bundle:

bash
metamcp export-evidence \  --ledger .metamcp/ledger.jsonl \  --out .metamcp/evidence-bundle.json
metamcp export-evidence --out .metamcp/evidence-bundle.json --verify

The operational ledger is not a remote attestation system. The export detects later changes inside a bundle; it does not prove that a compromised host recorded every event.

Optional gallery

The package still ships a human-operated server gallery:

bash
metamcp add --listmetamcp add playwright sentry --config .mcp.json

The runtime never installs packages in response to an MCP tool call. Installation remains an explicit CLI/user action.

Gallery entries are either a local launcher (command + args) or a hosted Streamable HTTP endpoint (url, shown as 🌐 in --list). Hosted entries are written to .mcp.json as native remote servers; the gallery never routes a remote server through a stdio bridge package.

Upgrade from 0.x

Version 1.0 intentionally removes the model-facing provisioning, skill-advice, and JavaScript execution tools. It also changes HTTP binding, child environment inheritance, retries, and init. Read Migration to 1.0 before upgrading.

Security

Child MCP servers are trusted local or remote code with their own permissions. MetaMCP is a policy and lifecycle boundary, not an OS sandbox for untrusted packages. Review commands, pin packages where appropriate, scope credentials per child, and keep dangerous direct servers behind client-side human approval.

Report vulnerabilities privately as described in SECURITY.md.

Development

bash
npm cinpm run typechecknpm test./scripts/smoke-test.shnpm run check:releasenpm pack --dry-run

npm publish runs the full verify:release gate again. The gate derives the public tool surface from the built CLI and checks package, lockfile, changelog, and official MCP Registry metadata for version drift.

Apache-2.0 licensed. Maintained by Mentu AI.

来源:README.md,提交 ccc9ac7

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分