
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 分