Skip to main content

A Model Context Protocol (MCP) server written in Python for natural language interaction with the TON blockchain

Project description

TON BLOCKCHAIN MCP

A Model Context Protocol (MCP) server for natural language interaction with the TON blockchain.

TON Blockchain MCP Cover

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

Environment Configuration (.env)

To securely provide sensitive configuration (such as your TON API key), create a .env file in the project root directory. This file will be loaded automatically if present.

Example .env file:

TON_API_KEY=YOUR_TON_API_KEY

Installation

  1. Clone the repository:
git clone https://github.com/devonmojito/ton-blockchain-mcp.git
cd ton-blockchain-mcp
  1. Install dependencies:
pip install -r requirements.txt

Using TON MCP Server with Claude Desktop

You can easily use this MCP server with Claude Desktop for natural language blockchain queries. Below are some example use cases:

Scam Detection Example:

Scam Detection Example

Analyze Address Example:

Analyze Address Example

Get Transaction Details Example:

Get Transaction Details Example

Analyze Trading Patterns Example:

Analyze Trading Patterns Example

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-blockchain-mcp/venv/bin/python",
            "args":
            [
                "-m",
                "tonmcp.mcp_server"
            ],
            "cwd": "/Users/devon/ton-mcp/ton-blockchain-mcp/src",
            "env":
            {
                "PYTHONPATH": "/Users/devon/ton-mcp/ton-blockchain-mcp/src"
            },
            "stdio": true
        }
    }
}

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"

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 analyze
  • deep_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 address
  • timeframe (str, optional): Time period (e.g., 24h)

get_ton_price

Get the current real-time TON price in the specified currency (default: USD) and recent price changes. Use this tool whenever you need the latest TON price for calculations, analysis, or reporting.

Parameters:

  • currency (str, optional): The fiat or crypto currency to get the TON price in (default: 'usd').

get_jetton_price

Get the current price and recent changes for specified jetton tokens (not TON) in the given currency. Provide a list of jetton master addresses as tokens. Use this tool to fetch real-time prices for any token except TON.

Parameters:

  • tokens (list of str): List of jetton master addresses to get prices for (excluding 'ton').
  • currency (str, optional): The fiat or crypto currency to get the price in (default: 'usd').

System Prompts

  • trading_analysis: Generate trading analysis prompts
  • forensics_investigation: Generate forensics prompts
  • trend_analysis: Generate trend analysis prompts

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. 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

⚠️ WARNING: This project is in Beta. Do not trust any numbers provided by the LLM model. Nothing in this project constitutes financial advice. Use at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_ton_blockchain_mcp-0.1.0.tar.gz (24.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_ton_blockchain_mcp-0.1.0-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_ton_blockchain_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_ton_blockchain_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 24.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_ton_blockchain_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 72a3e3af6bd8489ceac148a22074004a1baef101584cfec567489ead76eb5a0b
MD5 417180b6302c43edc05d9a207f76887c
BLAKE2b-256 cc0cfe4e1d42274387c465ef9fbea88cca97c07e1bec08cfed00641182af2dbe

See more details on using hashes here.

File details

Details for the file iflow_mcp_ton_blockchain_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_ton_blockchain_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_ton_blockchain_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3aecec0e09335fc7db75391c3632cd079d4486c9a6257c393548c44df8fec61d
MD5 fd921b2860f8513a6af2198f4b999c70
BLAKE2b-256 6c67688ac8c9ea6e4a1e174a7c314acc5b9897b58df387bb3ccd8da74d92fa2d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page