
Monad Mcp
io.github.pareen由 GitHub 账号 pareen 发布v0.2.1更新于 Oct 24, 2026
Monad blockchain gateway for AI agents: balances, transfers, swaps, DeFi, with Privy signing.
概览
面向 Monad 区块链的 MCP 服务器,让助手查询余额、代币与合约,并通过 Privy 内嵌钱包签名完成转账、兑换和 DeFi 交易。
- 可以做什么
- 读取链上数据:原生与 ERC-20 余额、含美元价格的资产组合、交易历史、交易回执、代币价格与风险检查
- 解析名称与代币:.nad 名称与地址互转、符号转代币地址、内置标准代币列表
- 检查合约:用内联 ABI 调用任意 view 函数、解码返回数据、试运行交易
- 转移资金:原生与 ERC-20 转账、任意合约写入、x402 服务支付、跨链报价与执行
- 管理审批:查询待处理请求状态、发放带消费上限和允许名单的会话密钥、撤销授权
- 使用协议插件:Uniswap 兑换、Kintsu 与 FastLane 流动性质押、Morpho 借贷、Kuru 订单簿
- 适用场景
- 适合让助手查询 Monad 余额、代币风险或合约状态,或在人工审批环节下准备并发送 Monad 交易,而不必交出私钥。也适合需要通过会话密钥预授权消费的自动化代理流程。
- 运行要求
- 以 npm 包形式通过 stdio 本地运行,或连接托管的 HTTP 端点。写入类工具需要 Privy 应用:PRIVY_APP_ID 与 PRIVY_APP_SECRET,并需一次性引导生成 P-256 密钥并注册 Privy key quorum(PRIVY_AUTHORIZATION_PRIVATE_KEY、PRIVY_KEY_QUORUM_ID)。MONAD_DEFAULT_NETWORK 选择主网或测试网。审批流程需要 HTTP 服务器运行且 PUBLIC_BASE_URL 可访问。需能访问 Monad RPC、DexScreener 与 Privy。
安装
在 SourceWeft 中
- 打开 控制台中的 Monad Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
monad-mcp
MCP server for the Monad blockchain. Your agent's gateway to balances, transfers, swaps, and DeFi on Monad — with signing handled by a Privy embedded wallet, never by the agent.
Built around a simple shape — stored requests + approval URLs + skill plugins — on Monad mainnet 143 / testnet 10143, with Privy as the wallet provider.
🌐 Landing page + live read-only demo: pareen.github.io/monad-mcp — query real Monad balances in your browser, exactly what the agent sees.
🔌 Connect it — no install, no terminal. In Claude Desktop or ChatGPT, add a custom connector and paste this URL:
That's the whole setup — read tools (balances, prices, portfolios, token checks) work immediately. Step-by-step for each app: docs/connect-claude.md.
Prefer the terminal? One line in Claude Code:
The hosted endpoint runs in split mode: read tools are public (paste the URL,
no login — safe to share) and write tools are gated behind a Privy sign-in,
returning auth_required until you authenticate. The hosted sign-in path is wired
but still being verified end-to-end, so the tested route for transactions is your
own Privy-signed instance — see docs/connect-claude.md, docs/FAQ.md for common security/setup questions, and docs/DEPLOY.md.
🧭 Monad ≠ Ethereum: the server ships agent-facing guidance on Monad's quirks (128 KB contracts, gas_limit billing, speculative latest, eth_getLogs caps, FastLane/MEV) as monad://guide/* MCP resources — see docs/building-on-monad.md.
What's in the box
Core tools (work on any address; auth required only where noted):
Skill plugins (additive, drop in your own under src/plugins/):
- Uniswap (
uniswap_quote,uniswap_swap,approve_erc20) — exact-input single-hop swaps on Uniswap v3 (testnet + mainnet). - Kintsu (
kintsu_stake,kintsu_request_unstake,kintsu_claim_unstake,kintsu_position) — liquid staking MON → sMON via Kintsu's ERC-7535 vault. Two-step unstake with batch processing. - FastLane (
fastlane_stake,fastlane_unstake,fastlane_position) — liquid staking MON → shMON via FastLane's shMONAD ERC-4626 vault. Payable native deposit, synchronous redeem (no epoch wait); shMON keeps earning staking + MEV rewards. - Morpho (
morpho_supply,morpho_withdraw,morpho_borrow,morpho_repay,morpho_position,morpho_market) — lending on Morpho Blue's singleton. Caller passes MarketParams inline; plugin derives the market id. - Kuru (
kuru_best_bid_ask,kuru_market_params,kuru_place_limit,kuru_cancel_orders,kuru_market_swap) — fully-on-chain CLOB. Ships with known mainnet markets (MON/USDC, MON/AUSD, WETH/USDC); accepts raw addresses for new ones.
All write tools across plugins auto-route through a covering session-key grant (see "Session keys" below); otherwise they return an approval URL.
Mainnet-only plugins (Kintsu / FastLane / Morpho / Kuru) are skipped at boot when MONAD_DEFAULT_NETWORK=testnet. Override per-tool with network: "mainnet".
Quickstart
1. Install + configure
Edit .env. Minimum config to do anything useful with write tools:
For the Uniswap plugin, supply contract addresses (verify against the canonical Uniswap deployment for Monad before using):
2. Privy app setup
In the Privy dashboard:
- Create an app. Enable embedded wallets under "Wallets".
- Under "Networks", add Monad mainnet (chainId
143) and/or testnet (chainId10143) as an EVM chain. - Copy the App ID + App Secret into
.env. - Copy the JWT verification key (PEM-encoded ES256 public key) into
PRIVY_VERIFICATION_KEYfor fastest token verification. If omitted, the server falls back to JWKS over the network. - (Optional) Configure wallet policies (spend limits, allowlists) to gate what the agent can do.
2a. Bootstrap server-side wallet authorization (one-time)
Privy embedded wallets are user-owned by default — the server cannot sign for them. The MCP server needs a P-256 key quorum registered with Privy, attached as an additional_signer on every wallet it provisions. Bootstrap it:
After bootstrap, every create_user call attaches the quorum at wallet creation, and every transfer/swap includes the private key in authorization_context. Important: wallets minted before you set these env vars are stranded — Privy doesn't let you retrofit an additional_signer (updating authorization requires existing authorization). Always bootstrap first.
3. Run
4. Wire it into Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json. The --env-file flag loads PRIVY_*, MONAD_*, and PUBLIC_BASE_URL from your .env into the spawned process:
You'll also need the HTTP server running (npm run start:http) for the approval flow — the stdio MCP returns approval URLs that point at the HTTP server. See docs/claude-desktop.md for the full dogfood walkthrough (bootstrap, funding, first transfer).
Public reads, no self-hosting: to use the read tools (balances, portfolio, history) without building anything, point Claude Desktop at the hosted endpoint via the
mcp-remoteshim —"args": ["-y", "mcp-remote", "https://monad-mcp.fly.dev/mcp"]. Writes (transfers/swaps) are gated behind a Privy sign-in; the verified path for them is a self-hosted signer.
5. Try a prompt
For the second prompt the agent calls transfer, hands you a link like http://localhost:8787/approve/<uuid>, and you approve in your browser. The agent polls poll_request and reports the tx hash.
Architecture
Write tools follow the stored request pattern:
- Tool builds an unsigned
{ to, value, data }payload and a human-readable summary. - Server stores it under a UUID and returns
https://your-server/approve/<uuid>to the agent. - User opens the URL — page shows the summary + asset diff + signs via their Privy embedded wallet.
- Server records the tx hash; agent polls
poll_requestand continues.
The agent never touches a private key. Privy's TEE-backed key custody + wallet policies are the security envelope.
Adding your own skill plugin
Plugins live in src/plugins/<id>/ and export a SkillPlugin:
Register it in src/plugins/index.ts. Write tools just need to construct a { to, value, data } payload and call server.store.create(...) — the approval flow is shared.
Testing
56 unit tests cover the chain config, both stores (requests + grants), tool registry (auth gating, schema validation), every core tool, every session-key surface, and the Uniswap plugin's quote sweep.
The integration suite runs transfer end-to-end on Monad testnet through the Privy server SDK: build → sign → broadcast → poll receipt. Gated on PRIVY_APP_ID, PRIVY_APP_SECRET, PRIVY_AUTHORIZATION_PRIVATE_KEY, PRIVY_KEY_QUORUM_ID, and MONAD_MCP_E2E_USER_ID being set + the wallet being funded; cleanly skips otherwise so it doesn't break CI without secrets.
Security model
- Keys: Privy holds the key in a TEE. The MCP server never sees a private key.
- Authorization to act: every write tool builds a stored request; nothing happens until the user clicks Approve on the approval page.
- Token scope: the OAuth 2.1 bearer in the MCP transport identifies which user; it does not authorize which tx — that's gated by the explicit approval click + Privy wallet policies.
- Stale link defense: stored requests expire after
ttl_seconds(default 5 min); expired requests can't be approved. - CSRF on /reject: rejection is intentionally permissionless — worst case, a stale link can't be re-used. Approval requires a Bearer token tied to the requesting user.
For production, the stored-request and grant stores already support a Postgres backend (set STORE_BACKEND=postgres); still on the hardening list are rate limiting on /approve and /submit, and per-tool spend caps via Privy policies.
Session keys: skipping per-tx approvals
By default every write tool returns an approval URL the user has to click. That's fine for one-shot prompts, fatal for anything agentic ("DCA $100 into MON every Friday", "rebalance my LP weekly"). The fix is grant_session_key:
Grants are scoped by:
spend_cap_mon— total native MON the agent can spend (running total tracked across calls)ttl_seconds— grant expiry window (max 30 days)allowed_targets— optional recipient/contract allowlist (empty = any)allowed_selectors— optional 4-byte function selector allowlist (e.g.0xa9059cbb= ERC-20 transfer only)
Coverage is checked against every write call; if the grant doesn't cover (wrong target, wrong selector, would exceed cap), the tool falls back to the approval-URL flow. Revoke any time with revoke_session_key.
Limits: v1 tracks native-MON spend cap only. ERC-20 token amounts aren't deducted from the cap — instead, restrict ERC-20 access by listing the token contract in allowed_targets. Per-token spend caps are a v2 add.
End-to-end testing on Monad testnet
The e2e script reuses MONAD_MCP_E2E_USER_ID from env so you don't burn a new Privy seat on each run.
What's next
- Browser-first signing path (Privy web SDK in the approval page → no server-side
sendTransactionround-trip). - More plugins — Neverland lending (Aave V3 fork on Monad), additional DEXes/perps.
- Block-explorer integration once Monad's explorer API stabilizes (
get_transaction_historywill return full decoded history). - x402 payment support (pay for x402-enabled services).
- Per-token (ERC-20) spend caps on session grants — today's cap is a single native-MON budget per grant.
- Universal contract reader/writer for "talk to any Monad contract" without writing a per-protocol plugin.
License
MIT — see LICENSE.
来源:README.md,提交 b2bd497
工具
0版本历史
1- v0.2.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分