MCPs Configurations to customize AI behavior, streamline the development and tailor code generation, suggestions and queries to your framework and language.
Integration of TON API with AI assistants and LLMs through the Model Context Protocol (MCP).
TON API MCP provides an interface for interacting with the TON blockchain through AI assistants like Claude and other systems supporting the Model Context Protocol. This allows AI models to access up-to-date data from the TON blockchain and perform various operations.
# Clone the repository
git clone https://github.com/ton-ai-core/ton-api-mcp.git
cd ton-api-mcp
# Install dependencies
yarn install
# Build the project
yarn build
# Run with API key
node bin/ton-api-mcp-server.js --api-key YOUR_API_KEY
# Run with specific API modules
node bin/ton-api-mcp-server.js --api-key YOUR_API_KEY --modules blockchain,accounts
If you've installed the package from npm, you can run the MCP server directly using npx:
npx ton-api-mcp --api-key AFPJTKEBPOX3AIYAAAAKA2HWOTRNJP5MUCV5DMDCZAAOCPSAYEYS3CILNQVLF2HWKED6USY --modules blockchain
This is especially convenient for integrating with AI assistants like Claude in Cursor.
--api-key <key> TON API key (can also be set via the TON_API_KEY environment variable)
--testnet, -t Use testnet instead of mainnet
--modules <list> Comma-separated list of API modules (e.g., "blockchain,accounts,nft")
--help, -h Show help
For integration with Cursor (or other development environments supporting MCP):
Run the MCP server in the background using npx:
npx ton-api-mcp --api-key AFPJTKEBPOX3AIYAAAAKA2HWOTRNJP5MUCV5DMDCZAAOCPSAYEYS3CILNQVLF2HWKED6USY --modules blockchain
In Cursor:
npx ton-api-mcp --api-key AFPJTKEBPOX3AIYAAAAKA2HWOTRNJP5MUCV5DMDCZAAOCPSAYEYS3CILNQVLF2HWKED6USY --modules blockchain
After successful connection, you can access any TON API methods directly through the AI assistant.
TON API MCP provides access to the following modules:
Module | Description |
---|---|
accounts | Operations with TON accounts, getting balances, wallet information, and transaction history |
blockchain | Access to blockchain data, blocks, transactions, masterchain, and validators |
dns | Working with DNS records and domains in TON |
jettons | Operations with Jetton tokens (similar to ERC-20 in TON) |
nft | Operations with NFT collections and tokens |
staking | Staking operations and operations with nominators |
wallet | Managing wallets and transactions |
// Request to AI assistant
"Get information about the latest block in the TON blockchain"
// The assistant uses the blockchain_getMasterchainInfo tool
// Request to AI assistant
"Check the balance of wallet EQDrjaLahLkMB-hMCmkzOyBuHJ139ZUYmPHu6RRBKnbdLIYI"
// The assistant uses the accounts_getAccount tool
// Request to AI assistant
"Provide information about the Jetton token with master address EQB-MPwrd1G6WKNkLz_VnV7-UFKi8PtMd8AmYHZEZRQC4POW"
// The assistant uses the jettons_getInfo tool
Make sure that:
yarn build
)This usually indicates a connection or initialization problem with the MCP server. Try:
MIT
npx ton-api-mcp --api-key AFPJTKEBPOX3AIYAAAAKA2HWOTRNJP5MUCV5DMDCZAAOCPSAYEYS3CILNQVLF2HWKED6USY --modules blockchain