TON BLOCKCHAIN MCP
A Model Context Protocol (MCP) server for natural language interaction with the TON blockchain.
Features
- Natural Language Processing: Understand complex blockchain queries in plain English
- Trading Analysis: Analyze trading patterns, profitability, and strategies
- Hot Trends Detection: Find trending tokens, active pools, and high-activity accounts
- Forensics & Compliance: Conduct blockchain investigations and compliance checks
- Real-time Data: Access live TON blockchain data through TON API
Quick Start
Prerequisites
- Python 3.10+
- TON API key from TONAPI
Installation
- Clone the repository:
git clone https://github.com/devonmojito/ton-blockchain-mcp.git
cd ton-blockchain-mcp
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- You might want to put the API key in .env as well
export TON_API_KEY=your_api_key_here
- Run the server:
python -m src.mcp_server
Using Docker
# Build and run with Docker Compose
docker-compose up --build
Example: Using TON MCP Server with Claude Desktop
You can easily use this MCP server with Claude Desktop for natural language blockchain queries. Below is an example of checking the TON balance for a wallet address:
Claude Desktop Configuration Example
To use this MCP server with Claude Desktop, add the following to your Claude Desktop config:
- You might need to replace the Python env setup with your own.
{
"mcpServers": {
"ton-mcp-server": {
"command": "/Users/devon/ton-mcp/ton-mcp-server/venv/bin/python",
"args": [
"-m",
"tonmcp.mcp_server"
],
"cwd": "/Users/devon/ton-mcp/ton-mcp-server/src",
"env": {
"PYTHONPATH": "/Users/devon/ton-mcp/ton-mcp-server/src"
}
}
}
}
Usage
Basic Queries
import asyncio
from mcp_client import McpClient
async def main():
client = McpClient("http://localhost:8000")
# Analyze an address
result = await client.call_tool("analyze_address", {
"address": "EQD1234...",
"deep_analysis": True
})
print(result)
asyncio.run(main())
Natural Language Examples
- "What's the balance of address EQD1234...?"
- "Find hot trading pairs in the last hour"
- "Analyze trading patterns for this wallet"
- "Show suspicious activity for address ABC"
- "Trace money flow from this address"
Configuration
Configuration can be provided via:
- Environment variables
config/settings.jsonfile- Runtime parameters
Key configuration options:
TON_API_KEY: Your TON API keyMCP_HOST: Server host (default: localhost)MCP_PORT: Server port (default: 8000)LOG_LEVEL: Logging level (default: INFO)
MCP Tools & System Prompts Documentation
Tools
analyze_address
Analyze a TON address for its balance, jetton holdings, NFTs, and recent activity. Optionally performs deep forensic analysis if deep_analysis is True. Use for questions about account overview, holdings, or activity.
Parameters:
address(str): TON address to analyzedeep_analysis(bool, optional): Enable deep forensic analysis
get_transaction_details
Get details and analysis for a specific TON blockchain transaction by its hash. Use for questions about a particular transaction, its participants, value, or type.
Parameters:
tx_hash(str): Transaction hash
find_hot_trends
Find trending tokens, pools, or accounts on the TON blockchain for a given timeframe and category. Use for questions about what's hot, trending, or popular on TON.
Parameters:
timeframe(str, optional): Time period (e.g., 1h, 24h, 7d)category(str, optional): Type of trends (tokens, pools, accounts)
analyze_trading_patterns
Analyze trading patterns for a TON address over a specified timeframe. Use for questions about trading activity, frequency, jetton transfers, or DEX swaps for an account.
Parameters:
address(str): TON addresstimeframe(str, optional): Time period (e.g., 24h)
System Prompts
trading_analysis: Generate trading analysis promptsforensics_investigation: Generate forensics promptstrend_analysis: Generate trend analysis prompts
Contributing
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support, please open an issue on GitHub or contact the author on Telegram: @devonmojito
Metadata
Release files for ton-mcp-server 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ton_mcp_server-0.1.0.tar.gz | 18.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ton_mcp_server-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.1 kB
Release files / ton_mcp_server-0.1.0.tar.gz
| Download URL | ton_mcp_server-0.1.0.tar.gz |
|---|---|
| Size | 18.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85160fe3a6db9bd35b7398d58e07610031d5b3e6e3d624c52fca0d3249e78eb1
|
|
BLAKE2b-256 checksum How to use checksums |
6fc2350fcfe2ea2cac57b6c7ab6a9e043ec554a87417c00c74ed48ad68d6b155
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.14
|
Release files / ton_mcp_server-0.1.0-py3-none-any.whl
| Download URL | ton_mcp_server-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86574c84f10321bbaf0116285de0d311990259a0245930bb7620d1cee3a7198c
|
|
BLAKE2b-256 checksum How to use checksums |
78c469bf4f8b6d567310ce33de90ba3a3dfd8cd0c3201ae1f8e3106803315947
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.14
|
Security for ton-mcp-server 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.