Permite que clientes de IA consultem liteservers da TON diretamente para verificar saldos, estado de contas, transações, get-methods e construir swaps não assinados.
Também conhecido como tonnode/mcp, mcp, @tonnode/mcp
- Stars
- 20
- Ferramentas
- 16
- Downloads, 30 dias
- —
- Versão mais recente
- 0.9.2
- Último commit
- 8 de out. de 2026
- Licença
- MIT
O que é o MCP TON?
TON é um MCP server. Permite que clientes de IA consultem liteservers da TON diretamente para verificar saldos, estado de contas, transações, get-methods e construir swaps não assinados. Ele expõe 16 ferramentas, como get_balance, get_jetton_balance, get_jetton_info.
Resumo gerado a partir do README do projeto
Sobre o MCP server de TON
Este servidor permite que agentes de IA consultem a blockchain TON diretamente. Ao fornecer acesso direto aos liteservers via protocolo nativo ADNL, ele evita gateways HTTP tradicionais para buscar estados de conta, históricos de transações e saldos de jettons. Desenvolvedores podem integrar isso em clientes como Claude Desktop, Cursor ou ChatGPT usando um comando npx simples para uso local ou via um endpoint HTTP hospedado para implantações remotas.
Além da simples recuperação de dados, o servidor permite que agentes atuem como traders. Ele suporta a construção de transações de swap não assinadas para GRAM e diversos jettons usando o protocolo Omniston, bem como o gerenciamento de swaps cross-chain complexos envolvendo redes como Ethereum, Arbitrum e Avalanche. Também inclui ferramentas para gerar novas carteiras com versões de contrato específicas, como v4 ou highload_v3. Para quem utiliza a versão hospedada, o servidor gerencia a autenticação por meio de chaves Bearer e oferece rate limiting granular para garantir um desempenho estável.
O que você pode fazer com ele
- 1Verificar saldos de carteiraUm agente de IA pode determinar os saldos atuais de GRAM ou USDT de um endereço específico.
- 2Preparar swaps descentralizadosUm desenvolvedor pode pedir para uma IA gerar uma transação não assinada para uma troca de tokens, pronta para ser assinada por uma carteira.
- 3Executar trades cross-chainUm agente pode gerenciar o ciclo de vida de um trade movendo ativos da TON para redes como Polygon ou Base.
- 4Criar novas identidadesVocê pode instruir uma IA a criar uma carteira nova com uma mnemônica de 24 palavras e uma versão de contrato específica.
Escrito a partir do README do projeto. Cada caso de uso é verificado com uma citação dele.
Como instalar o MCP TON
Formatos verificados em 10 nov 2026Adicionar ao CursorAdicionar ao GooseInstalar o MCP TON no Claude Code
$ claude mcp add mcp -- npx -y @tonnode/mcpInstalar o MCP TON no Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@tonnode/mcp"
]
}
}
}Instalar o MCP TON no VS Code
.vscode/mcp.json
{
"servers": {
"mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@tonnode/mcp"
]
}
}
}Instalar o MCP TON no VS Code CLI
$ code --add-mcp '{"name":"mcp","type":"stdio","command":"npx","args":["-y","@tonnode/mcp"]}'Instalar o MCP TON no Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@tonnode/mcp"
]
}
}
}Instalar o MCP TON no Codex
$ codex mcp add mcp -- npx -y @tonnode/mcpInstalar o MCP TON no Codex config.toml
~/.codex/config.toml
[mcp_servers.mcp] command = "npx" args = ["-y", "@tonnode/mcp"]
Instalar o MCP TON no Gemini CLI
$ gemini mcp add -s user mcp npx -- -y @tonnode/mcpInstalar o MCP TON no Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"mcp": {
"command": "npx",
"args": [
"-y",
"@tonnode/mcp"
]
}
}
}Ferramentas do MCP TON 16
Detectadas a partir do READMEget_balanceget_jetton_balanceget_jetton_infoget_transactionsget_account_staterun_get_methodparse_addressget_masterchain_infoget_swap_quotebuild_swap_txget_crosschain_quotebuild_crosschain_swap_tx
| get_balance | — | |
| get_jetton_balance | — | |
| get_jetton_info | — | |
| get_transactions | — | |
| get_account_state | — | |
| run_get_method | — | |
| parse_address | — | |
| get_masterchain_info | — | |
| get_swap_quote | — | |
| build_swap_tx | — | |
| get_crosschain_quote | — | |
| build_crosschain_swap_tx | — |
Mostrar todas as 16 ferramentasMostrar menos ferramentas
track_crosschain_swapdisclose_crosschain_secretbuild_crosschain_refundgenerate_wallet
| track_crosschain_swap | — | |
| disclose_crosschain_secret | — | |
| build_crosschain_refund | — | |
| generate_wallet | — |
Configuração
TONNODE_KEYSTON_LITESERVERSOptional JSON array of private liteserver entries: [{"ip":"host","port":41000,"key":"<base64 ed25519>"}]. Defaults to the public global config.
TON_NETWORKSet to "testnet" to use the testnet global config.
| Nome | Descrição | Tipo |
|---|---|---|
| TONNODE_KEYS | — | |
| TON_LITESERVERS | Optional JSON array of private liteserver entries: [{"ip":"host","port":41000,"key":"<base64 ed25519>"}]. Defaults to the public global config. | |
| TON_NETWORK | Set to "testnet" to use the testnet global config. |
Verificações automatizadas
Executado em 13 de nov. de 2026Relatório completo →Passou em nossas verificações automatizadas. Isso não é uma auditoria de segurança: leia o código e dê ao servidor o acesso mais restrito de que ele precisa. Como as verificações funcionam
- Repositório de origem vinculado e acessívelPassou
- Licença de código aberto (OSI)Passou
- Commit ou release no último anoPassou
- Nome do pacote não é próximo a um pacote popularPassou
- O endpoint remoto usa HTTPSPassou
- Ferramentas destrutivas estão rotuladasPassou
- Sem instruções ocultas para o modeloPassou
- Nenhum aviso crítico no pacote ou em suas dependênciasPassou
README
Ver no GitHub@tonnode/mcp
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:
{
"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
*_gramfields.
| Tool | What it does | Typical question |
|---|---|---|
get_balance |
GRAM balance of an address | "How much GRAM does EQ… hold?" |
get_jetton_balance |
Jetton/token balance (USDT and any TEP-74 token) | "How much USDT is on this wallet?" |
get_jetton_info |
Token metadata: name, symbol, decimals, supply | "What are this jetton's decimals?" |
get_transactions |
Recent transactions: values, senders, fees | "Did my payment arrive?" |
get_account_state |
Status, deployment flags, last-tx pointer | "Is this contract deployed?" |
run_get_method |
Read-only get-methods on contracts | "Call get_jetton_data on this master" |
parse_address |
Convert/validate EQ…/UQ…/raw forms, offline | "Are these two addresses the same?" |
get_masterchain_info |
Masterchain head: seqno, shard, hashes | "Is the network (or my endpoint) alive?" |
get_swap_quote |
Firm DEX swap quote (GRAM ⇄ any jetton) via Omniston | "How much USDT for 100 GRAM right now?" |
build_swap_tx |
Unsigned, TonConnect-ready swap transaction | "Prepare that swap for my wallet to sign" |
get_crosschain_quote |
Quote TON → Ethereum/Arbitrum/Base/BNB/Polygon/Avalanche | "How much USDT on Ethereum for my TON USDT?" |
build_crosschain_swap_tx |
Unsigned HTLC escrow transaction + its secret | "Start that cross-chain swap" |
track_crosschain_swap |
Live phases of a cross-chain trade on both chains | "Did the resolver lock my USDT on Ethereum?" |
disclose_crosschain_secret |
Reveal the secret — atomically settles both sides | "Complete the swap" |
build_crosschain_refund |
Unsigned cancellation that reclaims escrowed funds | "The trade stalled — get my money back" |
generate_wallet |
Mint 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=1to 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:
get_swap_quotelocks a firm quote (amounts in raw indivisible units; the answer includes the slippage floor, price impact, gas budget and DEX route).build_swap_txturns the quote into unsigned messages in exactly the shapetonConnectUi.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):
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:
{
"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 var | Meaning |
|---|---|
TON_LITESERVERS |
Use your own liteservers instead of the public config: [{"ip":"1.2.3.4","port":40004,"key":"<base64 ed25519>"}] |
TON_CONFIG_URL |
Alternative global-config URL |
TON_NETWORK=testnet |
Use the testnet config (or pass --testnet) |
TONNODE_KEYS |
HTTP mode: comma-separated Bearer API keys (simple, fixed) |
TONNODE_KEYS_FILE |
HTTP mode: JSON key file with labels, per-key rpm, expires — hot-reloaded |
HOST |
HTTP mode: bind address (default 127.0.0.1) |
PORT |
HTTP mode: listen port (default 8808) |
RATE_LIMIT_RPM |
HTTP mode: default requests per minute per key (default 300) |
GLOBAL_RATE_LIMIT_RPM |
HTTP mode: total ceiling across all keys (default off) |
SESSION_TTL_MIN |
HTTP mode: idle minutes before a session is swept (default 30) |
MAX_SESSIONS / MAX_SESSIONS_PER_KEY |
HTTP mode: concurrent session caps (default 500 / 50) |
OMNISTON_API_URL |
Swap tools: alternative Omniston WebSocket endpoint (default wss://omni-ws.ston.fi) |
OMNISTON_INTEGRATOR_ADDRESS / OMNISTON_INTEGRATOR_FEE_BPS |
Swap 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_GEN |
Set 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
Perguntas sobre o MCP TON
Como adiciono o MCP TON ao Claude Code?
Execute claude mcp add mcp -- npx -y @tonnode/mcp no seu terminal. Adicione --scope user para torná-lo disponível em todos os projetos.
Como adiciono o MCP TON ao Cursor?
Abra ~/.cursor/mcp.json e adicione o servidor em mcpServers, usando a configuração do Cursor mostrada na seção de instalação acima.
Quais ferramentas o MCP TON oferece?
Ele expõe 16 ferramentas, incluindo get_balance, get_jetton_balance, get_jetton_info, get_transactions, get_account_state.
O que um agente de IA pode fazer com o MCP server da TON?
Ele pode consultar liteservers da TON para obter saldos de GRAM e jettons, estado de conta, histórico de transações e get-methods de contratos, além de obter cotações de swap para construir transações não assinadas.
O servidor assina ou transmite transações de swap?
Não. Ele retorna mensagens não assinadas e prontas para o TonConnect; a assinatura e o envio permanecem sob responsabilidade do proprietário da carteira.
Como conecto o Claude Desktop ou o Cursor a ele?
Adicione o servidor à configuração do seu cliente MCP usando npx -y @tonnode/mcp; por padrão, ele se conecta à mainnet da TON via configuração global pública.
Como funciona a autenticação no modo HTTP hospedado?
Utiliza chaves de API Bearer passadas via header Authorization ou X-API-Key, com limite de taxa (rate limiting) por chave.
Quais carteiras o comando generate_wallet pode criar?
Ele gera uma mnemônica de 24 palavras, um par de chaves ed25519 e um endereço para as versões de contrato v4, v3r2, v5r1 ou highload_v3.