Search documentation
Documentation generates and exposes a remote MCP server as a search tool for AI applications to query. Access it athttps://docs.ton.org/mcp.
Use the contextual menu at the top of this page to copy the MCP server URL or follow a deep link to connect from Cursor or VS Code directly.
For Claude Code, run the following command:
opencode.json
Perform blockchain operations with @ton/mcp
The @ton/mcp server enables agents to operate with TON wallets and perform many common blockchain operations. It manages dangerous parts like private keys and signing, allowing agents to handle intents and confirmation flows safely. The server is built on top of WalletKit.
The latest alpha release is available on npm. Run it locally with the following command, passing CLI flags as needed.
Features
- Balance queries: check Toncoin and jetton (token) balances, view transaction history
- Transfers: send Toncoin, jettons, and NFTs to any TON address
- Assets: list, inspect, and manage popular jettons or NFTs
- Swaps: get quotes for token swaps via DEX aggregators
- DNS: resolve TON DNS-compatible domains and perform reverse-lookup for addresses
- Work with multiple stored wallets, active wallet selection, and local config-backed management tools
- Agentic sub-wallet deployments: deploy additional agentic wallets from a root wallet
- Multiple transports: standard I/O (default), multi-session HTTP server, and serverless
Quick start
The@ton/mcp supports two runtime modes. If neither MNEMONIC nor PRIVATE_KEY environment variables are set, the server starts in the registry mode, reading from a local config registry found at ~/.config/ton/config.json or at TON_CONFIG_PATH, if available. Otherwise, server starts with one in-memory wallet in the single-wallet mode.
Usage with MCP clients
For Claude or Cursor, add:Environment variables
| Variable | Default | Description |
|---|---|---|
NETWORK | mainnet | TON network and default env override target for TONCENTER_API_KEY. Use mainnet for production and testnet for development and testing. |
MNEMONIC | Space-separated 24-word mnemonic phrase for single-wallet mode | |
PRIVATE_KEY | Hex-encoded private key: 32-byte seed or 64-byte (private + public key), alternative to mnemonic | |
WALLET_VERSION | v5r1 | Wallet version to use in single-wallet mode (v5r1, v4r2, or agentic) |
AGENTIC_WALLET_ADDRESS | Agentic wallet address (required for WALLET_VERSION=agentic, unless derived from init params) | |
AGENTIC_WALLET_NFT_INDEX | Agentic wallet NFT index or subwallet ID (uint256, optional) | |
AGENTIC_COLLECTION_ADDRESS | EQByQ19qvWxW7VibSbGEgZiYMqilHY5y1a_eeSL2VaXhfy07 | Agentic collection address override for single-wallet mode |
TONCENTER_API_KEY | API key for TON Center (optional, for higher rate limits) | |
TON_CONFIG_PATH | ~/.config/ton/config.json | Config path for registry mode |
AGENTIC_CALLBACK_BASE_URL | Optional public base URL for agentic onboarding callbacks | |
AGENTIC_CALLBACK_HOST | 127.0.0.1 | Host for the local callback server in stdio mode |
AGENTIC_CALLBACK_PORT | random free port | Port for the local callback server in stdio mode |