桥接度量MCP
提供实时跨链桥接指标的MCP服务器,使AI代理能够分析区块链网络的流动性、交易流和性能。
特性
- 列表链:从DeFi Llama中检索所有链段的列表,按总锁定值(TVL)降序排列。
- 列出桥梁:获取所有桥梁,可选择包括链故障,按24小时数量排序。
- 历史卷:获取桥梁或链的历史体积数据,日期格式为
YYYY-MM-DD HH:MM:SS. - 每日代币统计:检索24小时代币数量细分,包括代币ID、符号、小数、存款/取款金额和美元价值,按存款美元价值排序。
- 过桥交易:获取特定网桥的交易摘要,包括交易哈希、时间戳和美元值等详细信息。
- 提示:包括用于分析桥梁体积和根据每周体积等指标比较桥梁的示例提示。
先决条件
- python:版本3.10或更高版本。
- 紫外线:Python的包和虚拟环境管理器(建议用于依赖关系管理)。
安装
- 克隆存储库:
git clone https://github.com/kukapay/bridge-metrics-mcp.git
cd bridge-metrics-mcp- 安装依赖项:
uv sync- 安装到Claude桌面:
将服务器安装为Claude Desktop应用程序:
uv run mcp install main.py --name "Bridge Metrics"配置文件作为参考:
{
"mcpServers": {
"Bridge Metrics": {
"command": "uv",
"args": [ "--directory", "/path/to/bridge-metrics-mcp", "run", "main.py" ]
}
}
}替换 /path/to/bridge-metrics-mcp 使用您的实际安装路径。
工具和用法
服务器提供以下工具,可通过JSON-RPC或兼容客户端中的自然语言提示访问:
list_chains:
- 描述:列出DeFiLlama中的所有链段,按TVL排序。 - 参数:没有。 - 输出:带列的表 Name, Gecko ID, Token Symbol, Chain ID, TVL.
list_bridges:
- 描述:列出所有桥梁,按24小时体积排序,可选包含链。 - 参数: include_chains (布尔值,默认值 False). - 输出:带列的表 ID, Name, Display Name, Last 24h Volume, Chains.
get_historical_volumes:
- 描述:获取链或桥的历史卷,日期格式为 YYYY-MM-DD HH:MM:SS. - 参数: chain (字符串,必填), bridge_id (整数,可选)。 - 输出:带列的表 Date, Deposit USD, Withdraw USD, Deposit Txs, Withdraw Txs.
get_day_stats:
- 描述:检索24小时代币交易量明细,按存款美元价值排序。 - 参数: timestamp (整数,必填), chain (字符串,必填), bridge_id (整数,可选)。 - 输出:带列的表 Token ID, Symbol, Decimals, Deposit Amount, Deposit USD Value, Withdraw Amount, Withdraw USD Value.
get_transactions:
- 描述:获取网桥的事务摘要,按时间戳排序。 - 参数: bridge_id (整数,必填), start_timestamp, end_timestamp, source_chain, address, limit (全部可选)。 - 输出:带列的表 Tx Hash, Timestamp, Block, From, To, Token, Amount, Type, Chain, Bridge Name, USD Value.
- 提示:
- analyze_bridge_volume:分析特定桥梁的体积数据。 - compare_bridges:根据指定的度量比较两个网桥(例如。, weeklyVolume).
交互示例
以下是在兼容的MCP客户端中使用自然语言提示的交互示例,以及预期结果。
示例1:列出所有链
提示:
List all chains available on DeFiLlama.工具调用: list_chains
结果:
+----------------+-------------+---------------+-----------+-------------+
| Name | Gecko ID | Token Symbol | Chain ID | TVL |
+================+=============+===============+===========+=============+
| Ethereum | ethereum | ETH | 1 | 50000000000 |
| Binance Smart | binance-smart-chain | BNB | 56 | 15000000000 |
| Polygon | polygon | MATIC | 137 | 5000000000 |
+----------------+-------------+---------------+-----------+-------------+示例2:用链条列出桥梁
提示:
Show all bridges with their supported chains, sorted by 24-hour volume.工具调用: list_bridges(include_chains=True)
结果:
+----+-------------+---------------+-----------------+----------------------------------+
| ID | Name | Display Name | Last 24h Volume | Chains |
+====+=============+===============+=================+==================================+
| 1 | polygon | Polygon | 1000000 | Ethereum, Polygon, Binance Smart |
| 2 | optimism | Optimism | 750000 | Ethereum, Optimism |
| 3 | arbitrum | Arbitrum | 500000 | Ethereum, Arbitrum |
+----+-------------+---------------+-----------------+----------------------------------+示例3:链的历史交易量
提示:
Get historical volumes for the Ethereum chain.工具调用: get_historical_volumes(chain="ethereum")
结果:
+---------------------+---------------+---------------+---------------+---------------+
| Date | Deposit USD | Withdraw USD | Deposit Txs | Withdraw Txs |
+=====================+===============+===============+===============+===============+
| 2025-09-12 00:00:00 | 1000000.0 | 500000.0 | 150 | 100 |
| 2025-09-11 00:00:00 | 1200000.0 | 600000.0 | 180 | 120 |
| 2025-09-10 00:00:00 | 900000.0 | 450000.0 | 130 | 90 |
+---------------------+---------------+---------------+---------------+---------------+示例4:网桥的每日令牌统计
提示:
Show the 24-hour token stats for bridge ID 1 on Ethereum for September 12, 2025.工具调用: get_day_stats(timestamp=1752499200, chain="ethereum", bridge_id=1)
结果:
+----------------+--------+----------+------------------+-------------------+------------------+-------------------+
| Token ID | Symbol | Decimals | Deposit Amount | Deposit USD Value | Withdraw Amount | Withdraw USD Value|
+================+========+==========+==================+===================+==================+===================+
| 0xa0b869... | USDC | 6 | 2000000 | 2000000.0 | 0 | 0.0 |
| 0xc02aaa... | ETH | 18 | 1000000000000000 | 1500000.0 | 500000000000000 | 750000.0 |
| 0xdac17f... | DAI | 18 | 0 | 0.0 | 1000000000000000 | 1000000.0 |
+----------------+--------+----------+------------------+-------------------+------------------+-------------------+示例5:分析桥梁体积
提示:
Analyze the volume data for the Polygon bridge using historical volumes.工具调用: get_historical_volumes(chain="polygon", bridge_id=1),随后 analyze_bridge_volume
结果:
Analyze the following volume data for the bridge 'Polygon':
+---------------------+---------------+---------------+---------------+---------------+
| Date | Deposit USD | Withdraw USD | Deposit Txs | Withdraw Txs |
+=====================+===============+===============+===============+===============+
| 2025-09-12 00:00:00 | 800000.0 | 400000.0 | 120 | 80 |
| 2025-09-11 00:00:00 | 900000.0 | 450000.0 | 140 | 90 |
| 2025-09-10 00:00:00 | 700000.0 | 350000.0 | 100 | 70 |
+---------------------+---------------+---------------+---------------+---------------+
Key insights:
- The Polygon bridge shows consistent deposit and withdrawal activity over the past three days.
- Deposits are roughly double the withdrawals in USD value, indicating higher inflow than outflow.
- Transaction counts are stable, with deposits averaging 120 transactions per day.许可证
该项目根据MIT许可证获得许可。请参阅 许可证 文件以获取详细信息。
