@chainrender/mcp

中文文档
0.10.0发布于 2026/11/01MITES Module

Model Context Protocol server for building ChainRender apps with AI — exposes the SDK (vocabulary, resolver-kind search, tree check, compile, grade, validate, review, verify, doctor) as tools so an AI assistant can build verifiable, Grade-A on-chain apps.

原始使用文档
文档目录7 节
  1. The principle: AI proposes, the SDK and chain verify
  2. Tools
  3. Install & run
  4. Review a tree from the command line
  5. Configure in an MCP client
  6. The AI workflow
  7. Status

@chainrender/mcp

A Model Context Protocol (MCP) server for building ChainRender apps with AI. It exposes the ChainRender SDK as tools so an AI assistant that speaks MCP (in your editor or an MCP-capable chat) can compose, grade, compile, and validate fully on-chain, Grade-A, verifiable apps.

The principle: AI proposes, the SDK and chain verify

ChainRender is designed so AI output is checkable, not blind:

  • Closed vocabulary — the AI can't express an invalid construct.
  • grade() — the AI's trust claim is computed, not asserted (A/B/C + itemized breakdown).
  • Deterministic compile() — you reproduce the exact hash the AI produced.
  • Enforcer validation — an unsafe app is refused; the validate tool catches it locally first.

Tools

ToolWhat it does
chainrender_vocabularyThe closed vocabulary (node types and fields, enums, capabilities, resolver kinds). Call first. Optional include returns only the named sections.
chainrender_search_kindsFind resolver kinds by words and data edge — names, one-line summaries and arg names only.
chainrender_describe_kindOne kind's full descriptor: args, argsEncoding, data edge, capability, notes.
chainrender_check_nodeCheck a Node tree against everything compile() reads; reports what it would silently drop, with paths.
chainrender_node_schemaThe strict JSON Schema of a Node tree.
chainrender_gradeGrade a composition (A/B/C + breakdown) before deploying.
chainrender_compileCompile a composition to its content-addressed hash (deterministic).
chainrender_validateRun the enforcer-equivalent checks locally (needs a manifest; optional known-components).
chainrender_reviewcheck + grade + compile + honesty findings + (optional) validate in one call — the finalize loop. pass is the bit to gate "done" on. Pass chain to check every address against that chain.
chainrender_verifyConfirmed / Refuted / Inconclusive, with evidence, for one fact: kind-exists, export-exists, kind-deployed, contract-deployed, address-has-code.
chainrender_doctorInstalled SDK and server vs npm; chains.json vs the published Addresses page; each RPC reachable; every listed contract has code.

The server's instructions (sent when a client connects) are Start here for AI builders: the model does not know ChainRender from training data, where each fact is published, and the verify loop. Same text as the top of llms.txt.

Keep the context small: the full vocabulary is ~59 KB, most of it resolver kinds. Request every section except resolverKinds ({"include":["nodeTypes","a11y","behavior","enums","capabilities","kinds","limits"]}, ~5 KB) and look kinds up with chainrender_search_kinds → chainrender_describe_kind.

Install & run

npm install -g @chainrender/mcp
chainrender-mcp            # runs on stdio

chainrender_verify, chainrender_doctor and chainrender_review with chain read the published deploy records and the chain. Override any source with an environment variable:

VariableDefault
CHAINRENDER_CHAINShttps://chainrender.org/chains.json (a path or URL)
CHAINRENDER_ADDRESSEShttps://chainrender.org/docs/reference/addresses.md
CHAINRENDER_RPC_<chainId>the chain's rpc in chains.json
CHAINRENDER_NPM_REGISTRYhttps://registry.npmjs.org

Review a tree from the command line

For a tree an AI gave you, when that AI cannot run MCP (for example a chat model, or Google AI Studio):

npx -y @chainrender/mcp review app.json                  # human-readable report; exit 0 = pass, 1 = fail
npx -y @chainrender/mcp review app.json --chain sepolia  # also check every address against that chain
npx -y @chainrender/mcp review app.json --json           # the full result, as chainrender_review returns it

It is the same review as the chainrender_review tool and the visual builder's Review tab. Paste the printed report back to the AI and ask it to fix every item.

Configure in an MCP client

Add to your client's MCP server config (e.g. an editor's mcp.json):

{
  "mcpServers": {
    "chainrender": { "command": "chainrender-mcp" }
  }
}

The AI workflow

  1. The AI calls chainrender_vocabulary (slim) to learn what it can compose, and chainrender_search_kinds / chainrender_describe_kind for the data sources it binds — encoding each arg exactly as the descriptor says.
  2. It composes a Node tree from the vocabulary (using the compose.* builders' shapes).
  3. It calls chainrender_check_node and fixes every issue — compile() silently drops unknown fields and invalid enum values.
  4. It calls chainrender_grade to check the trust level — and fixes anything that lowered it.
  5. It calls chainrender_verify for every fact it relies on (a kind, an export, a contract on the target chain, an address) and uses only what is Confirmed.
  6. It calls chainrender_review (with chain) and does not report the app as done until pass is true and every honesty warning is fixed or explained.
  7. The human deploys the reproducible, graded, validated result.

Every step after the AI composes is a verification, not trust. See the ChainRender docs: "Building with AI" and "Instructing an AI" — also as Markdown for agents at https://chainrender.org/docs/llms.txt.

Status

v0.9.0. Wraps the shipped @chainrender/client (^0.16.0) — the tools are thin wrappers over the SDK's vocabulary(), checkNode(), nodeJsonSchema(), grade(), compileComponent(), validateApp() and honestyFindings(); verify and doctor read chains.json, the Addresses page and the chain (src/chain.ts). Tests: npm test drives the built server over stdio against local mocks. No logic is duplicated; the SDK is the single source of truth.

版本与发布记录

@chainrender/mcp 共发布 16 个版本,首次发布于 2026/09/08;过去 12 个月发布了 16 个版本。

版本发布日期距今
0.10.0latest2026/11/012 天前
0.9.02026/10/304 天前
0.8.12026/10/304 天前
0.8.02026/10/295 天前
0.7.02026/10/286 天前
0.6.02026/10/286 天前

关于 @chainrender/mcp 的常见问题

@chainrender/mcp 是什么?

用于使用AI构建ChainRender应用程序的协议服务器-将SDK(词汇表,解析器类型的搜索,树检查,编译,分级,验证,审查,验证,医生)作为工具公开,以便AI助手可以构建可验证的,a级链上应用程序。

如何安装 @chainrender/mcp?

在项目目录运行 npm install @chainrender/mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 chainrender-mcp,可以用 npx chainrender-mcp 直接运行。

@chainrender/mcp 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/chainrender__mcp 是否存在。

@chainrender/mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@chainrender/mcp 可以商用吗?

@chainrender/mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@chainrender/mcp 还在维护吗?

最新版本 0.10.0 发布于 2026/11/01(2 天前);至今共发布 16 个版本,其中过去 12 个月发布了 16 个;首次发布于 2026/09/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。