TronScan MCP Server 使用指南
TronScan MCP Server 是基于 Model Context Protocol (MCP) 的 TRON 区块链数据查询服务,提供 105 个工具接口,覆盖区块、账户、合约、交易、代币、见证人、钱包、统计、深度分析等全维度链上数据查询能力。
快速开始
MCP 服务地址
| 环境 | 地址 |
|---|---|
| 线上 | https://mcp.tronscan.org/mcp |
协议
- MCP 协议版本: 2025-06-18
- 传输协议: Streamable HTTP
客户端配置
Claude Desktop
编辑配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"tronscan": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.tronscan.org/mcp"
]
}
}
}如需传入 API Key:
{
"mcpServers": {
"tronscan": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.tronscan.org/mcp",
"--header",
"TRON-PRO-API-KEY:<your-api-key>"
]
}
}
}Claude Code
方式一:CLI 命令
claude mcp add --transport http tronscan https://mcp.tronscan.org/mcp方式二:项目配置文件
在项目根目录创建 .mcp.json:
{
"mcpServers": {
"tronscan": {
"type": "http",
"url": "https://mcp.tronscan.org/mcp"
}
}
}通用 HTTP 调用
# 1. 初始化连接
curl -X POST https://mcp.tronscan.org/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": {"name": "my-client", "version": "1.0"}
},
"id": 1
}'
# 2. 调用工具(需携带返回的 mcp-session-id)
curl -X POST https://mcp.tronscan.org/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: <session-id>" \
-d '{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "getBlocks",
"arguments": {"limit": 1, "sort": "-number"}
},
"id": 2
}'API Key 说明
- 通过 HTTP 请求头
TRON-PRO-API-KEY传入 - 获取 API Key:https://tronscan.org 注册后申请
最后更新于: