链表MCP服务器
一个MCP服务器,使AI代理能够快速访问经过验证的EVM链信息,包括RPC URL、链ID、探索者和本地令牌——来源于Chainlist.org。
特性
- 高效的数据获取:缓存Chainlist API数据以最大限度地减少请求。
- 灵活搜索:使用正则表达式进行不区分大小写的关键字匹配
getChainsByKeyword. - 结构化输出:带表格的Markdown响应
rpc和explorers为了可读性。
安装
先决条件
- python:版本3.10或更高版本。
- 紫外线:建议用于管理Python项目和依赖关系(通过安装
pip install uv或跟随 紫外线文件).
步骤
- 克隆存储库:
git clone https://github.com/kukapay/chainlist-mcp.git
cd chainlist-mcp- 再进行:
uv sync- 安装到克劳德桌面:
将服务器安装为Claude Desktop应用程序:
uv run mcp install cli.py --name "Chainlist MCP"配置文件作为参考:
{
"mcpServers": {
"Chainlist MCP": {
"command": "uv",
"args": [ "--directory", "/path/to/chainlist-mcp", "run", "main.py" ]
}
}
}替换 /path/to/chainlist-mcp 使用您的实际安装路径。
用法
服务器通过MCP协议公开两个工具,可通过MCP兼容客户端或MCP检查器访问。
工具
getChainById
- 描述:通过链ID检索区块链的详细信息。
- 参数:
- chain_id (整数):区块链的唯一标识符(例如,以太坊主网为1)。
- 退货:带有链详细信息或错误消息的Markdown字符串。
示例提示 (在MCP客户端中):
Get the details for the blockchain with chain ID 1.示例响应:
**Chain Details**
- **Name**: Ethereum Mainnet
- **Chain ID**: 1
- **Native Currency**: Ether (ETH, 18 decimals)
- **TVL**: 134376951329.85631
**RPC Endpoints**:
| URL | Tracking |
|----------------------------------------------|----------|
| https://eth.llamarpc.com | none |
| https://go.getblock.io/... | none |
...
**Explorers**:
| Name | URL | Standard |
|------------|----------------------------|----------|
| etherscan | https://etherscan.io | EIP3091 |
...getChainsByKeyword
- 描述:按关键字搜索区块链(不区分大小写的部分匹配)。
- 参数:
- keyword (string):要搜索的关键字或部分名称(例如“eth”)。 - limit (整数,可选):最大结果数(默认值:5)。
- 退货:Markdown字符串列表最多为
limit匹配链或错误消息。
示例提示 (在MCP客户端中):
Find blockchains with 'eth' in their name, limit to 2 results.示例响应:
**Matching Chains**
### Chain 1
**Chain Details**
- **Name**: Ethereum Mainnet
- **Chain ID**: 1
- **Native Currency**: Ether (ETH, 18 decimals)
- **TVL**: 134376951329.85631
**RPC Endpoints**:
| URL | Tracking |
|----------------------------------------------|----------|
| https://eth.llamarpc.com | none |
...
**Explorers**:
| Name | URL | Standard |
|------------|----------------------------|----------|
| etherscan | https://etherscan.io | EIP3091 |
...
### Chain 2
**Chain Details**
- **Name**: Ethereum Goerli
- **Chain ID**: 5
- **Native Currency**: Ether (ETH, 18 decimals)
- **TVL**: N/A
**RPC Endpoints**:
| URL | Tracking |
|----------------------------------------------|----------|
| https://goerli.infura.io/... | yes |
...
**Explorers**:
| Name | URL | Standard |
|------------|----------------------------|----------|
| etherscan | https://goerli.etherscan.io | EIP3091 |
...许可证
该项目根据MIT许可证获得许可。请参阅 许可证 文件以获取详细信息。
