
Xahau MCP
io.github.Hugegreencandle由 GitHub 账号 Hugegreencandle 发布v2.3.0更新于 Oct 24, 2026
MCP server for the Xahau network — offline Hook WASM VM + static analyzer, read-only ledger tools.
概览
面向 Xahau 网络的本地 MCP 服务器,可在离线虚拟机中运行 Hook WebAssembly 字节码、静态分析 Hook,并读取账本状态。
- 可以做什么
- 在本地虚拟机中运行和模糊测试 Hook 字节码,模拟未签名交易、重放历史交易,并对真实 Hook 执行做事后分析与保真度报告、注解调用轨迹。用静态规则引擎审计 Hook,进行分类、版本对比、脚手架生成、WASM 检查以及费用和状态成本估算。解码与编码 Xahau 数据:HookOn 与 HookCanEmit 位图、SetHook 与交易 blob、金额、地址、X 地址、货币代码、Ripple 时间、URIToken、XPOP 和租赁 URI。读取账户、Hook、Hook 状态、交易和账本等账本数据,并诊断失败交易、奖励状态、治理状态和 Evernode 主机健康状况。构建未签名的 SetHook、ClaimReward 和 Payment 交易。
- 适用场景
- 适用于处理 Xahau Hook 或账本数据的场景:在安装前审计或测试 Hook、预测未签名交易会触发什么、解释失败交易、查询奖励资格或治理情况,或诊断 Evernode 主机。离线工具无需任何网络访问。
- 运行要求
- 需要 Node.js 20 或更高版本;作为本地 stdio 进程由 MCP 客户端启动,例如通过 npx。读取账本的工具需要访问公共 Xahau JSON-RPC 端点的网络,可用 XAHAU_RPC_URLS(主网)和 XAHAU_TEST_RPC_URLS(测试网)覆盖。无需账户、API 密钥或身份验证。
安装
在 SourceWeft 中
- 打开 控制台中的 Xahau MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
xahau-mcp
A Model Context Protocol server for the Xahau network with two firsts: it runs a Hook's real WebAssembly bytecode in a local VM (no xahaud node required), and it runs a Hooks-specific static-analysis / security rule engine over it — both fully offline. Around that core it adds read-only ledger access, a Xahau-aware binary codec, an instruction-count fee estimate, network-reward math, governance helpers, and unsigned-transaction builders.
Xahau is the XRPL fork whose flagship feature is Hooks — small on-ledger WebAssembly smart contracts. There was no MCP for Xahau and no static analyzer for Hooks; this is both.
[xahau-mcp v2.0 flight simulator demo]
The trifecta — safe Hooks, end to end
Three open-source tools, one workflow: write → simulate one tx → prove all inputs. xahau-mcp is the simulate stage.
Why it's useful
Point any MCP-capable agent (Claude, etc.) at this server and it can:
-
See the future before signing —
simulate_transactionis a pre-sign flight simulator: every hook an unsigned transaction would trigger runs as real bytecode against live ledger state, with per-hook accept/rollback, decoded emitted transactions, simulated state writes and labeled static engine preflights. Its siblingwhat_ifis a time machine: replay any real historical transaction — with your modifications — at its original ledger. Verified to reproduce a real claim's emittedGenesisMintpayout to the drop (72,251,963 drops), test-locked. -
Run a Hook without deploying it —
execute_hookinstantiates the real CreateCode WASM in a local VM, supplies the Hook API over a simulated transaction + ledger state, and reports the actualaccept/rollbackdecision, return code/string, state writes, emitted transactions and a call trace. Noxahaudnode needed. -
Audit a Hook before it's installed — paste the CreateCode WASM (or an on-ledger hook hash) and get SARIF-lite findings: missing
accept/rollbackexit, unguarded loops (_g), unknownenvimports, dangerousHookGrants, over-broadHookOn, and more. -
Decode the cryptic
HookOnbitmap in both directions — the 256-bit, inverted, active-low mask (with the active-high SetHook bit) is easy to get wrong; here it's verified and round-trip-tested. -
Read Xahau ledger state — accounts, installed hooks, hook definitions, hook state, transactions (with
HookExecutionsmetadata), ledgers. -
Answer the #1 retail question —
reward_statustells any account whether it's opted in to Xahau network rewards (Balance Adjustments), the exact XAH accrued — computed with the genesis reward hook's own formula and live parameters, verified to reproduce a real on-chain payout to the drop — when it can next claim, and whether the claim is overdue (late claiming forfeits yield). -
Diagnose an Evernode host —
evernode_host_diagnosticsautomates the official troubleshooting checklist for Xahau's largest operator group: registration, heartbeat liveness (the actual on-chain active rule), reputation, EVR trustline, lease offers, specs and accumulated rewards, in one read-only call. -
Explain a failed transaction —
diagnose_failed_txturns an engine result + hook return strings into a plain-English cause and a concrete fix. -
Watch governance live —
governance_statedecodes the Genesis Governance Game's full hook state: who holds the 20 seats, every open vote and tally, and whether a change (member swap, reward-rate change) is about to be actioned. No explorer shows this. -
Build unsigned transactions (SetHook, ClaimReward, Payment) with an automatic security preflight — returned unsigned, to be signed offline.
Why this is the most advanced blockchain MCP we know of
Strong claim, so here is the checkable evidence (2026-06-11). To our knowledge no MCP for ANY chain — Ethereum, Solana, Bitcoin, XRPL or otherwise — combines even two of these; the closest comparators are cloud-simulation MCPs (e.g. Tenderly's, which simulates on their hosted infrastructure) and standalone analyzers (e.g. Slither, which is EVM-only and not an MCP):
- Executes real on-chain contract bytecode in a LOCAL VM —
execute_hookruns the actual CreateCode WASM with no node, no cloud, no account. Not an ABI wrapper, not a hosted simulator. - Publishes a measured, regression-locked fidelity score against chain ground truth —
vm_fidelity_reportreplays 30 real mainnet hook executions: 30/30 agree (100%), 0 degraded, including the foreign-state-reading hook that dominates live traffic. Those 30 are all accept-direction (live Xahau traffic is heartbeat-dominated), and the metric says so itself — it reports the accept/rollback composition and warns that an accept-only corpus can't distinguish the VM from an always-accept stub. The rollback direction is exercised on real genesis bytecode (governanceInvoke→ rollback) intests/regression.test.ts. The corpus, the method and the honest history (25% → 0% → 100%) are in docs/FIDELITY.md. We know of no other blockchain MCP that even attempts this. - In-protocol static security analysis — a Hooks-specific rule engine (SARIF-lite findings), calibrated against the network's own genesis hooks.
- In-protocol differential fuzzing —
fuzz_hookmaps a contract's accept/reject decision boundary in the local VM. - Post-mortems real transactions with real bytecode —
hook_execution_postmortemreplays what actually fired on chain and compares. - Reproduces on-chain economics exactly —
reward_statusre-implements the genesis reward hook's formula and reproduces a real emitted payout to the drop (verified, test-locked). - Decodes live governance end-to-end —
governance_stateshows every seat, vote, tally and threshold of the Governance Game, live. - Operational doctors for the ecosystem's real pain: failed-tx diagnosis with cause+fix, Evernode host health, claim-overdue detection.
Every claim above is reproducible from this repo: the corpus is committed, the tests assert the numbers, and the canonical sources (xahaud genesis hooks, evernode-js-client) are cited in code.
Safety posture
-
Read-only toward the network. There is no
submitand nosignanywhere in this server. -
No key custody. Builder tools never accept a secret/seed and always return an unsigned transaction plus instructions to sign offline (e.g. with xaman or
xrpl-accountlib). They default to testnet. -
Honest fidelity.
execute_hookruns the real bytecode against a simulated environment. The VM implements a large slice of the 78-function Hook API — nearly the whole XFL float API (verified againstfloat_one;float_root/float_logare the exceptions — they returnNOT_IMPLEMENTED), the slot table + STObject subfield extraction (slot_subfield/sto_subfield, byte-exact against real txns), state,otxn_*/hook_*,util_accid/util_raddr/util_verify/util_sha512h, and more. STObject mutation (sto_emplace/erase/validate),util_keylet(account + hook verified against live ledger indexes; offer/escrow/check/ticket/signers canonical + fail-safe),slot_set+ foreign hook state (state_foreign/state_foreign_set) with async pre-resolve (execute_hook resolveKeylets:truefetches the ledger objects AND foreign-state entries the hook reads — iteratively, since one resolved read can expose the next — and re-runs),slot_float/float_sto/float_sto_set(STAmount ⇄ XFL both ways — parse a native or issued/IOU Amount into a float and serialize one back; the issued layout below bit 63 is the XFL layout), and 32-byte state-key padding (short keys are left-zero-padded exactly as on-ledger) are now supported.state_foreign_setrecords the write but does NOT model the on-chain HookGrant requirement;etxn_detailsserves a disclosed SYNTHETIC placeholder (listed insyntheticCalls, cannot change the accept/rollback decision). What still can't be faithful is honestly recorded: unverified keylet subtypes,meta_slot, and other un-modelled calls return the realNOT_IMPLEMENTEDcode, are listed inunsupportedCalls, and mark the rundegraded— never faked. The VM models the guard budget (_genforces each guard's declaredmaxiter→GUARD_VIOLATION), and reportsstateApplied(state writes commit only onaccept, discarded onrollback). It is not a consensus-faithfulxahaudreplica — it has no fee/fuel metering beyond guards, XFL math truncates rather than round-half-up (sofloat_mulratio's round-up flag and last-significant-digit results can differ), value-level math is verified only where tested. Hooks with a loop but no_gguard are refused before execution (invalid on-chain), and guarded runs are bounded by a VM budget (1M cumulative guard calls / 2s wall clock — labeled as a local VM cap, not a consensus limit); always confirm financial/resource hooks on testnet.hook_dry_runisSTATIC_ONLY,compute_rewardisDOCUMENTED_MODEL(legacy — preferreward_status, whoseREWARD_HOOK_FORMULAre-implementsreward.cexactly and reproduces a real on-chainGenesisMintpayout to the drop),estimate_hook_feeisESTIMATE. -
Resources & prompts. Beyond tools, the server exposes MCP resources (
xahau://rules,xahau://hook-api,xahau://tx-types) and guided prompts (audit_hook,simulate_hook,explain_hook) so agents can pull reference data and run the common workflows directly.
Tools
Hook intelligence (offline — the core)
Codec / decode (offline)
Ledger (read-only RPC)
Economics / governance
Amendment intelligence (read-only, no admin node)
Audit / forensics
Unsigned builders (no keys, testnet-default)
Cron (scheduled Hook execution)
Install
New here or non-technical? Start with the plain-English tutorial — what it does + cool things to just ask.
Requires Node.js 20+. The server speaks MCP over stdio; your MCP client launches it.
From npm
Run with no arguments, xahau-mcp waits for an MCP client on stdin/stdout — it is not an interactive CLI.
Add it to an MCP client
Claude Code:
Claude Desktop (claude_desktop_config.json), or any client that takes an mcpServers block:
If you installed globally, "command": "xahau-mcp" with no args works too. To pin your own RPC nodes, add "env": { "XAHAU_RPC_URLS": "https://your-node.example" } (comma-separated; XAHAU_TEST_RPC_URLS for testnet).
The server is read-only toward the network: it reads ledger state over public JSON-RPC, never signs or submits a transaction, and holds no keys. The offline tools (Hook VM, static analyzer, codec, HookOn) need no network at all.
From GitHub / source
Or clone and build:
Older versions (≤ 1.4.0) were published to GitHub Packages as @hugegreencandle/xahau-mcp; that scope needs a GitHub token even for public installs. Use the unscoped npm package above instead.
HTTP shim (browsers, wallets, web tools)
The MCP server speaks stdio — browsers, the Xaman webview, and a public "simulate any hook" web tool can't. The HTTP shim (src/http.ts) exposes the same flight-simulator core over plain HTTP. Read-only; never signs or submits.
On platforms that build the last Dockerfile stage (Railway, etc.), use Dockerfile.http (set RAILWAY_DOCKERFILE_PATH=Dockerfile.http) — it's the http stage as the final stage.
Endpoints
Simulate a not-yet-deployed hook — pass candidateCode (the built wasm hex) on /simulate. It replaces tx.Account's on-ledger hook chain, so a freshly-compiled hook runs against the live ledger + full TSH chain BEFORE you SetHook it. (This is what xahc verify and a public simulate tool call.)
Config (env)
Running it publicly
The shim serves untrusted, user-supplied wasm, so each hook execution runs in a throwaway worker_thread with the timeout + memory cap above — a hanging or allocation-bombing hook is terminated without blocking or crashing the main process (security-audited; an infinite loop / unguarded recursion returns 422, not downtime). For a public deploy:
- Run behind a process supervisor (systemd / pm2 / container restart policy) for defense-in-depth.
- Only set
TRUST_PROXYwhen genuinely behind a proxy that setsX-Forwarded-For; otherwise the rate limiter keys on the socket address (setting it lets clients spoof the header and bypass the limit). - Per-IP rate limit + a global concurrency cap are on by default — tune via env.
Security
Designed defensively and reviewed (npm audit + a danger-surface pass):
- Read-only & no key custody — no
sign/submitanywhere; builder tools never accept a secret and only emit unsigned transactions to sign offline. - No code-exec surface — no
eval/Function, nochild_process/shell, no filesystem writes, no dynamicrequire. RPCfetchonly ever hits the fixed endpoints indata/endpoints.json(or yourXAHAU_RPC_URLS/XAHAU_TEST_RPC_URLSoverrides for mainnet/testnet) — never a URL built from tool input, so no SSRF. - Untrusted Hook WASM is sandboxed —
execute_hook/fuzz_hookrun hook bytecode in Node's WebAssembly engine, which has no syscall/fs/network access; a hook can only call the in-memory JS Hook-API shims, with bounds-checked memory reads/writes. - Untrusted-bytecode hardening: before executing a hook the VM refuses modules with an unguarded loop (more loops than
_gguard call-sites), with an opcode-scan that couldn't verify the loops, over 128 KiB of bytecode, or declaring more than 512 memory pages; guarded loops are bounded by a cumulative guard budget + wall-clock cap. So an attacker-supplied hook can't hang or OOM a run. Tool output is data, not instructions (treat it as such, as with any MCP). - Dependencies:
npm auditreports only low-severity advisories transitively underxrpl-accountlib's signing libraries (elliptic/bip32/tiny-secp256k1) — code paths this server never calls (it uses only the binary codec).
How it works
- No heavy deps. Three runtime deps:
@modelcontextprotocol/sdk,zod, andxrpl-accountlib(used only for the Xahau-aware binary codec; its signing surface is never called). RPC is plainfetch; the WASM reader is hand-rolled and zero-dep; the VM uses Node's built-inWebAssemblyengine to run the bytecode with a JS Hook API shim — no WASM toolchain or native deps. - Real data, regenerable.
data/is built from a live Xahau node'sserver_definitionsand the canonical Hook API list (Xahau/hooks-rsc/extern.h) vianpm run fetch:all. The 78-function Hook API catalog carries per-function hazard metadata that drives the analyzer. - HookOn semantics are verified against the Xahau docs: 256-bit, bit n = tx type n, inverted/active-low (set = does not fire), with bit 22 (SetHook) active-high.
License
MIT © 2026 Dane Brown. Not affiliated with XRPL Labs or the Xahau project. Analyzer findings are heuristic guidance, not a security guarantee — always test on testnet and review hooks independently before mainnet use.
来源:README.md,提交 c468370
工具
0版本历史
3- v2.3.0最新Oct 4, 2026
- v2.2.0Sep 30, 2026
- v2.0.1Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分