tron-event-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tron-event-mcpShow me the top 10 most active contracts in the last 24 hours."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tron-event-mcp
TRON blockchain event data query MCP Server — let AI assistants analyze on-chain data directly.
Works with event-plugin: event-plugin writes TRON on-chain events into MongoDB in real time, and this project exposes that data to AI assistants (Claude, Cursor, etc.) via the Model Context Protocol (MCP), enabling natural-language-driven on-chain data analysis.
Data Source
event-plugin listens to a Java-tron node and writes the following 7 event types into MongoDB:
Collection | Description | Unique Index |
| Block event, triggered for every new block |
|
| Transaction event, triggered for every packaged transaction |
|
| Contract event, triggered when a smart contract emits an event (ABI-decoded) |
|
| Contract raw log, not ABI-decoded (hex data) |
|
| Solidity trigger, fired when a block is finalized |
|
| Solidified contract event, same structure as |
|
| Solidified contract raw log, same structure as |
|
Related MCP server: mcp-server-tron
Available Tools
Metadata
Tool | Description |
| Return field descriptions, index info, and business meaning for all collections |
| Return document count and earliest/latest timestamps per collection |
Query
Tool | Description |
| Query events/logs for a specific contract, with event name and time range filters |
| General-purpose query with arbitrary filters and field projection |
| Quickly count documents matching given criteria |
| Look up a block by height |
| Look up a transaction by hash |
Aggregation & Analytics
Tool | Description |
| Compute sum / avg / min / max on a specified field |
| Group-by aggregation for address rankings, event distribution, etc. |
| Time-series aggregation (hour / day / week) with optional sum field |
| Leaderboard of most active contracts in a time range |
Cross-Collection
Tool | Description |
| Full transaction view: details + associated contract events |
| Address activity profile across sender, receiver, and contract caller roles |
Distribution Analysis
Tool | Description |
| Numeric field bucketing with auto or manual boundaries |
| Compute percentiles (P50 / P90 / P95 / P99, etc.) |
Recommended Indexes
event-plugin itself only creates unique indexes (for data deduplication/upsert). To get optimal query performance with this MCP Server's analytics tools, add the following indexes to MongoDB:
// contractevent (highest query volume)
db.contractevent.createIndex({ contractAddress: 1, eventName: 1, timeStamp: -1 });
db.contractevent.createIndex({ contractAddress: 1, timeStamp: -1 });
db.contractevent.createIndex({ timeStamp: -1 });
// solidityevent
db.solidityevent.createIndex({ contractAddress: 1, eventName: 1, timeStamp: -1 });
db.solidityevent.createIndex({ contractAddress: 1, timeStamp: -1 });
db.solidityevent.createIndex({ timeStamp: -1 });
// transaction
db.transaction.createIndex({ timeStamp: -1 });
db.transaction.createIndex({ result: 1 });
// block
db.block.createIndex({ timeStamp: -1 });
// contractlog / soliditylog
db.contractlog.createIndex({ contractAddress: 1, timeStamp: -1 });
db.soliditylog.createIndex({ contractAddress: 1, timeStamp: -1 });The create_index.js file in the project root contains the complete index creation script (unique + analytics indexes). Run it directly:
mongosh mongodb://host:27017/tron create_index.jsQuick Start
Prerequisites
Python >= 3.11
MongoDB >= 7.0 (the
percentilestool uses the$percentileaggregation operator, which requires 7.0+; all other tools work with 5.0+)
Installation
cd tron-event-mcp
make setupConfiguration
Edit the .env file (make setup copies it from .env.example automatically):
# MongoDB connection (strongly recommended to use a read-only user)
MONGO_URI=mongodb://readonly_user:password@host:27017/dbname?authSource=admin
MONGO_DB=tron
# Maximum documents per query (prevents fetching massive datasets)
MAX_RESULT_LIMIT=500
# Query timeout in milliseconds
QUERY_TIMEOUT_MS=10000Running
# stdio mode (for local clients like Claude Code, Cursor, etc.)
make run
# SSE mode (for remote access)
make run-sseIntegration with Claude Code
Add the following to your Claude Code MCP configuration:
{
"mcpServers": {
"tron-events": {
"command": "/path/to/tron-event-mcp/.venv/bin/python",
"args": ["-m", "tron_event_mcp"]
}
}
}Integration with Cursor
In Cursor Settings > MCP, add the same configuration as above.
Usage Examples
Once connected, you can ask questions in natural language:
"What are the most active contracts in the last 24 hours?"
"Show me the hourly USDT Transfer event volume trend"
"Analyze the on-chain activity of address TXxx..."
"What does the energy consumption distribution look like for transactions?"
"Show me the full details of transaction abc123..."
The AI assistant will automatically select the right combination of tools to answer.
Project Structure
tron-event-mcp/
├── src/tron_event_mcp/
│ ├── server.py # MCP Server entry point; registers all tools and resources
│ ├── config.py # Configuration management (env vars / .env)
│ ├── db/ # MongoDB connection and query layer
│ ├── tools/
│ │ ├── schema.py # describe_schema, get_collection_stats
│ │ ├── query.py # get_recent_events, get_block, get_transaction, query_events
│ │ ├── analytics.py # search_contract_activity, aggregate_field, group_by_field, etc.
│ │ ├── cross_collection.py # get_transaction_full, get_address_profile
│ │ └── distribution.py # histogram, percentiles
│ └── resources/ # MCP Resources (documentation resources)
├── tests/
├── pyproject.toml
├── Makefile
└── .env.exampleSecurity Notes
Use a read-only MongoDB user — this tool only performs queries, no write access needed
Query filters forbid
$where,$function,$accumulatorand other code-execution operatorsMAX_RESULT_LIMITcaps documents per request, protecting database performanceQUERY_TIMEOUT_MSenforces query timeout, preventing slow queries from blocking
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/0xbigapple/tron-event-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server