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 分