TONNode — TON blockchain access

io.github.tonnode由 GitHub 账号 tonnode 发布v0.9.2更新于 Oct 24, 2026

TON liteservers over ADNL: balances, history, get-methods, non-custodial DEX and cross-chain swaps

已验证Streamable HTTP可网页运行金融开发者工具

概览

AI 生成的概览

让 AI 助手通过 liteserver 直接访问 TON 区块链,查询余额、交易历史、合约 get-method,并进行非托管的 DEX 与跨链兑换。

可以做什么
查询余额与账户状态:GRAM 余额、Jetton 代币余额与元数据、账户状态与部署标记、主链头信息,以及离线地址解析与校验。查看近期交易,包括金额、发送方与手续费。在合约上执行只读 get-method。获取 DEX 兑换的确定报价(GRAM 与任意 Jetton),并构建未签名、可直接用于 TonConnect 的兑换交易。报价、构建、跟踪、结算或退款从 TON 到 Ethereum、Arbitrum、Base、BNB、Polygon 或 Avalanche 的跨链兑换。生成新的 TON 钱包,包含助记词、密钥和地址。
适用场景
适合助手需要回答 TON 地址、余额、代币或交易相关问题,或为钱包持有人准备兑换与跨链交易的场景。也适合需要区块链数据但不想自建节点的代理,以及签名始终留在用户手中的非托管交易流程。
运行要求
可作为远程端点使用,也可通过 npx 作为本地 npm 包运行(需要 Node.js)。托管端点需要 OAuth 或在提供方网站申请的 Bearer API 密钥;自托管 HTTP 模式需要 TONNODE_KEYS 或 TONNODE_KEYS_FILE。可选 TON_LITESERVERS 使用私有 liteserver、TON_NETWORK=testnet 使用测试网,以及 TON_CONFIG_URL。需要访问 TON 网络和 Omniston 兑换服务的网络连接。
安装前请注意
generate_wallet 会返回密钥材料(助记词和私钥);托管模式下密钥在服务端生成,应把这类钱包视为热钱包,并避免响应进入日志或共享对话记录。兑换工具只生成未签名交易,服务器从不签名或广播,但报价约一分钟过期,跨链流程涉及托管秘密。可配置可选的集成商手续费,并会显示在报价中。公共 liteserver 为共享、限速且不保留深层交易历史。

安装

在 SourceWeft 中

  1. 打开 控制台中的 TONNode — TON blockchain access,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.github.tonnode%2Fmcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "tonnode-ton-blockchain-access": {
      "type": "http",
      "url": "https://mcp.tonnode.io/mcp"
    }
  }
}

README

@tonnode/mcp

[mcp MCP server]

Русская версия

MCP server that gives AI agents direct liteserver access to The Open Network (TON) — no HTTP gateways in the middle. Balances, account state, transaction history and contract get-methods over TON's native ADNL protocol.

Built by TONNode — private TON liteservers, archive nodes, a mempool stream and a REST API (early access, on request).

Quick start

Add to Claude Desktop, Claude Code, ChatGPT, Cursor, Codex or any MCP client:

json
{  "mcpServers": {    "ton": {      "command": "npx",      "args": ["-y", "@tonnode/mcp"]    }  }}

That's the whole integration. The server connects to TON mainnet via the public global config by default. Ready-made configs for every client — plus programmatic Node.js usage — live in examples/.

Tools

Naming note: the native coin was renamed from Toncoin to GRAM in June 2026; the network itself is still called TON. Tool outputs use *_gram fields.

ToolWhat it doesTypical question
get_balanceGRAM balance of an address"How much GRAM does EQ… hold?"
get_jetton_balanceJetton/token balance (USDT and any TEP-74 token)"How much USDT is on this wallet?"
get_jetton_infoToken metadata: name, symbol, decimals, supply"What are this jetton's decimals?"
get_transactionsRecent transactions: values, senders, fees"Did my payment arrive?"
get_account_stateStatus, deployment flags, last-tx pointer"Is this contract deployed?"
run_get_methodRead-only get-methods on contracts"Call get_jetton_data on this master"
parse_addressConvert/validate EQ…/UQ…/raw forms, offline"Are these two addresses the same?"
get_masterchain_infoMasterchain head: seqno, shard, hashes"Is the network (or my endpoint) alive?"
get_swap_quoteFirm DEX swap quote (GRAM ⇄ any jetton) via Omniston"How much USDT for 100 GRAM right now?"
build_swap_txUnsigned, TonConnect-ready swap transaction"Prepare that swap for my wallet to sign"
get_crosschain_quoteQuote TON → Ethereum/Arbitrum/Base/BNB/Polygon/Avalanche"How much USDT on Ethereum for my TON USDT?"
build_crosschain_swap_txUnsigned HTLC escrow transaction + its secret"Start that cross-chain swap"
track_crosschain_swapLive phases of a cross-chain trade on both chains"Did the resolver lock my USDT on Ethereum?"
disclose_crosschain_secretReveal the secret — atomically settles both sides"Complete the swap"
build_crosschain_refundUnsigned cancellation that reclaims escrowed funds"The trade stalled — get my money back"
generate_walletMint a fresh TON wallet (mnemonic + keys + address)"Create a wallet for my agent to use"

Wallet generation

generate_wallet mints a brand-new wallet — a 24-word mnemonic, its ed25519 keypair and the address for the chosen contract version (v4 default, plus v3r2, v5r1 and highload_v3 for mass payouts). The v3r2/v4/v5r1 addresses come from @ton/ton's canonical contracts; highload_v3 is derived from the official contract code and cross-checked against a maintained reference implementation.

⚠️ This returns secret key material. In hosted mode the keys are generated on the server and returned over TLS — treat every generated wallet as hot: fine for programmatic/ephemeral use, but move any meaningful balance to cold storage, and keep the response out of logs and shared transcripts. The server never stores or logs the mnemonic or private key (only the public address). Operators can set TONNODE_DISABLE_WALLET_GEN=1 to remove the tool entirely.

Swaps — agents that can actually trade

get_swap_quote and build_swap_tx are powered by Omniston, STON.fi's RFQ protocol aggregating STON.fi and DeDust liquidity. No API key needed.

The flow is strictly non-custodial — the server never sees a private key, never signs and never broadcasts:

  1. get_swap_quote locks a firm quote (amounts in raw indivisible units; the answer includes the slippage floor, price impact, gas budget and DEX route).
  2. build_swap_tx turns the quote into unsigned messages in exactly the shape tonConnectUi.sendTransaction() expects — signing and sending stay with the wallet owner.

Quotes expire in about a minute, so build promptly. Omniston emulates the transfer while building: if the wallet doesn't hold the input amount, the build fails up front instead of burning gas on-chain.

Cross-chain

The *_crosschain_* tools take the same idea across blockchains: pay in GRAM or any TON jetton, receive USDT/USDC/native coins on Ethereum, Arbitrum, Base, BNB, Polygon or Avalanche — settled through Omniston's atomic HTLC escrow, typically in well under a minute. TON is always the source chain (the signer is a TON wallet).

The agent drives the full atomic-swap lifecycle: quote → build (the tool generates the HTLC secret and hands it to the caller — the server keeps nothing) → sign & send → track both chains → disclose the secret to settle, or build a refund if the trade stalls. At no point can the server, the resolver or anyone else redirect the funds: the secret only completes the trade as quoted, and an unfilled escrow is always reclaimable by the owner wallet.

Hosted / self-hosted HTTP mode

The package also ships a Streamable-HTTP entry for remote deployments (this is what powers mcp.tonnode.io):

bash
TONNODE_KEYS=tn_live_abc,tn_live_def PORT=8808 npx -y @tonnode/mcp --http

Want a ready-made hosted endpoint instead of running your own? Keys for mcp.tonnode.io are issued at tonnode.io/mcp. Clients connect without installing anything:

json
{  "mcpServers": {    "ton": {      "url": "https://your-host/mcp",      "headers": { "Authorization": "Bearer tn_live_abc" }    }  }}

Requests are authenticated with Bearer keys and rate-limited per key (RATE_LIMIT_RPM, default 300). Besides Authorization: Bearer <key>, the server accepts a bare Authorization: <key> and X-API-Key: <key> — for gateways (e.g. Smithery) that reserve the Authorization header for themselves. Keys come from either TONNODE_KEYS (comma-separated, fixed) or TONNODE_KEYS_FILE — a JSON array of {"key", "label"?, "rpm"?, "expires"?} that is hot-reloaded on change and on SIGHUP: add or revoke customer keys with no restart, per-key rate limits, and self-expiring keys for subscription plans. A revoked key's live sessions are closed immediately. GLOBAL_RATE_LIMIT_RPM adds a total ceiling across all keys to protect the backend liteserver. Sessions are private to the key that opened them, idle sessions are swept after SESSION_TTL_MIN (default 30 minutes), and concurrent sessions are capped per key and globally. Without keys the server refuses to start; set TONNODE_ALLOW_OPEN=1 to explicitly run keyless behind your own firewall. GET /healthz for monitoring, deploy/tonnode-keys.sh for key management.

The server binds 127.0.0.1 by default — put a TLS reverse proxy (Caddy, nginx) in front and set HOST=0.0.0.0 only if the proxy runs on another machine. Ready-made systemd + Caddy configs live in deploy/.

Configuration

Env varMeaning
TON_LITESERVERSUse your own liteservers instead of the public config: [{"ip":"1.2.3.4","port":40004,"key":"<base64 ed25519>"}]
TON_CONFIG_URLAlternative global-config URL
TON_NETWORK=testnetUse the testnet config (or pass --testnet)
TONNODE_KEYSHTTP mode: comma-separated Bearer API keys (simple, fixed)
TONNODE_KEYS_FILEHTTP mode: JSON key file with labels, per-key rpm, expires — hot-reloaded
HOSTHTTP mode: bind address (default 127.0.0.1)
PORTHTTP mode: listen port (default 8808)
RATE_LIMIT_RPMHTTP mode: default requests per minute per key (default 300)
GLOBAL_RATE_LIMIT_RPMHTTP mode: total ceiling across all keys (default off)
SESSION_TTL_MINHTTP mode: idle minutes before a session is swept (default 30)
MAX_SESSIONS / MAX_SESSIONS_PER_KEYHTTP mode: concurrent session caps (default 500 / 50)
OMNISTON_API_URLSwap tools: alternative Omniston WebSocket endpoint (default wss://omni-ws.ston.fi)
OMNISTON_INTEGRATOR_ADDRESS / OMNISTON_INTEGRATOR_FEE_BPSSwap tools: optional integrator revenue share in bps of the output — always visible to the caller as integrator_fee_units in every quote (default off)
TONNODE_DISABLE_WALLET_GENSet to 1 to remove the generate_wallet tool (e.g. on a shared hosted endpoint where you don't want key material generated server-side)

A note on public liteservers

The default public-config liteservers are shared, rate-limited and keep no deep history — get_transactions beyond recent blocks will answer lt not in db. Agents also tend to query in bursts, which public gateways throttle.

For your own rate limit and archive history, point TON_LITESERVERS at a private liteserver — a keypair and a global.config.json from the console, paid from a balance funded in GRAM or USDT. How the config file, ADNL keys and archive routing work is covered in the TON Liteserver guide.

Mempool stream

Pending messages are not exposed through this MCP server — none of the tools above read the mempool. TONNode offers the mempool as a separate WebSocket feed at wss://mempool.tonnode.io/v1/stream: one JSON object per external message as TONNode's node receives it from the public overlay, before it lands in a block, with filters by destination wallet, op code or DEX pool and a short replay after a reconnect. Plans are priced by the number of simultaneous connections on one key. Coverage is partial — the node sees only what reaches it over the overlay, and no completeness or speed figures are promised — and messages sent through TONNode's liteservers usually do not appear in it (the node does not publish its own broadcasts; a copy relayed back by other nodes showed up for 2 of 20 sends in a test on 8 October 2026). Protocol, keys and plans: tonnode.io/en/docs/mempool.

License

MIT © TONNode

来源:README.md,提交 8286cf8

工具

0
该服务器需要 API 密钥等凭据,因此 SourceWeft 无法在没有凭据的情况下读取其工具,也未收录。

版本历史

2
  1. v0.9.2最新Oct 6, 2026
  2. v0.5.0Sep 16, 2026

评分

已满足适用检查项的 85%

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

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分

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

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