Ankr API MCP Server
Ankr API MCP 服务器
通过 Ankr API 获取区块链数据的 MCP (Model Context Protocol) 服务器。
概述
Ankr MCP 服务器通过 Ankr API 获取链上数据。它实现了 MCP 协议,允许 LLM 查询 20 多条链上的区块链数据。
Related MCP server: Base Network MCP Server
功能
该服务器提供了涵盖所有 Ankr 高级 API 类别的 21 种工具:
代币操作
获取代币余额 (
get_token_balances):获取特定区块链上钱包的所有代币余额获取货币列表 (
get_currencies):列出区块链上所有可用的货币获取代币价格 (
get_token_price):获取任何代币的当前美元价格获取代币持有者 (
get_token_holders):列出代币的持有者地址获取代币持有者数量 (
get_token_holders_count):获取历史持有者数量数据获取代币转账记录 (
get_token_transfers):获取地址的代币转账历史获取代币价格历史 (
get_token_price_history):获取随时间变化的历史价格数据解释代币价格 (
explain_token_price):解析代币价格的构成方式
NFT 操作
按所有者获取 NFT (
get_nfts_by_owner):获取钱包拥有的所有 NFT获取 NFT 元数据 (
get_nft_metadata):获取特定 NFT 的元数据(名称、图片、特征)获取 NFT 持有者 (
get_nft_holders):获取 NFT 合集的所有持有者获取 NFT 转账记录 (
get_nft_transfers):获取 NFT 转账历史
查询操作
获取区块链统计信息 (
get_blockchain_stats):获取链统计信息(交易、区块时间等)获取区块 (
get_blocks):获取区块范围内的完整区块数据获取日志 (
get_logs):获取历史事件日志数据按哈希获取交易 (
get_transactions_by_hash):通过哈希查找交易按地址获取交易 (
get_transactions_by_address):获取地址的所有交易获取交互记录 (
get_interactions):列出钱包交互过的所有链获取历史账户余额 (
get_account_balance_historical):获取过去某个区块高度的余额按区块获取内部交易 (
get_internal_transactions_by_block):获取区块内的内部交易按父哈希获取内部交易 (
get_internal_transactions_by_parent_hash):获取来自父交易的内部交易
安装
npm install @akki91/ankr-mcp使用方法
环境设置
通过登录 ANKR API 文档门户设置您的 ANKR API 令牌。
export ANKR_API_TOKEN=your_api_token_here运行服务器
可以直接从命令行运行服务器:
npx @akki91/ankr-mcp与 LLM 工具配合使用
该服务器实现了模型上下文协议 (MCP),允许将其用作兼容 AI 模型的工具提供程序。
与 AI 模型集成
要将此服务器与支持 MCP 的 AI 应用程序集成,请将以下内容添加到应用程序的服务器配置中:
{
"mcpServers": {
"ankr-mcp": {
"command": "npx",
"args": [
"@akki91/ankr-mcp"
],
"env": {
"ANKR_API_TOKEN": "your_api_token_here"
}
}
}
}在 Claude Desktop 中集成 Ankr MCP 工具
请按照以下说明更新设置,并确保您的 MCP 服务器在 Claude Desktop 中可用。
第 1 步:访问 Claude Desktop 中的设置
启动 Claude Desktop。
从主菜单导航至 Settings(设置)。
第 2 步:更新开发者设置
打开 Developer Settings(开发者设置)。
编辑包含 MCP 服务器定义的配置文件。
如果已经列出了 MCP 服务器,请将您的 Ankr MCP 配置附加到现有列表中。否则,复制并粘贴上述整个 Ankr MCP 服务器配置。
第 3 步:重启 Claude Desktop
关闭 Developer Settings(开发者设置)菜单。
重启 Claude Desktop 以应用更改。
第 4 步:验证集成
Claude Desktop 重启后,点击聊天输入框下方的 Tools Icon(工具图标)。
验证 Ankr MCP 服务器提供的工具列表是否可见且可访问。
按照这些步骤操作后,您的 Ankr MCP 配置现在应该已集成到 Claude Desktop 中,允许您直接通过界面访问其工具。
示例聊天提示词
以下是您可以在 Claude 或任何兼容的 AI 中使用此 MCP 服务器的示例提示词:
代币查询
What are the token balances for 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 on Ethereum?What's the current price of USDC on Ethereum?Show me the price history of ETH over the last 30 days.How many holders does the LINK token have on Ethereum?Show me recent token transfers for vitalik.eth on Polygon.NFT 查询
What NFTs does 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 own?Get me the metadata for Bored Ape #1234.Who holds NFTs from the CryptoPunks collection?Show me recent NFT transfers for this wallet on Ethereum.区块链与交易查询
What are the current stats for Ethereum and Polygon?Which blockchains has wallet 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 interacted with?Look up transaction 0x1234abcd... and decode the logs.Show me the latest blocks on Arbitrum with transactions included.What were the internal transactions in Ethereum block 19000000?What was my wallet balance at block 17000000?开发
从源码构建
# Clone the repository
git clone https://github.com/akki91/ankr-mcp.git
cd ankr-mcp
# Install dependencies
npm install
# Build the project
npm run build运行测试
npm test调试模式
本项目支持使用 MCP Inspector 进行调试
npm run debug来源
本项目灵感来源于此处创建的服务器列表 here
验证
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
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/akki91/ankr-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server