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
验证
Available Tools
1 toolget_token_balances_on_networkB
Gets all token balances for a given address on a specific network
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The address to check token balances for | |
| network | Yes | The blockchain network (e.g., "ethereum", "base") |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'Gets' which implies a read operation, but fails to describe critical behaviors such as rate limits, authentication requirements, error handling, or what 'all token balances' entails (e.g., pagination, format). This leaves significant gaps for an agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that directly states the tool's purpose without any unnecessary words. It is appropriately sized and front-loaded, making it easy to parse.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (2 simple parameters) and no output schema, the description is minimally adequate but incomplete. It lacks details on behavioral aspects and output format, which are important for a read operation with no annotations to rely on.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, clearly documenting both parameters. The description adds no additional semantic context beyond what the schema provides, such as examples or constraints, so it meets the baseline for high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Gets') and the resource ('all token balances for a given address on a specific network'), making the purpose specific and understandable. However, since there are no sibling tools mentioned, it cannot distinguish from alternatives, which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or exclusions. It simply states what the tool does without context for usage decisions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
get_token_balances_on_network
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The tool's purpose is clearly defined and distinct by default.
A single tool inherently has perfect naming consistency, as there are no other tools to compare it against. The name 'get_token_balances_on_network' follows a clear verb_noun pattern.
One tool is too few for a server named 'Ankr API MCP Server', which suggests a broader API scope. This minimal set severely limits functionality and likely leaves significant gaps in coverage for blockchain-related operations.
The tool surface is severely incomplete for an API server. It only provides token balances, missing essential operations like querying transactions, network status, smart contract interactions, or other common blockchain API functions, leading to dead ends for agents.
Maintenance
Related MCP Connectors
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server giving AI agents one-connection access to crypto & DeFi data: DeFi protocol TVL, stableco
MCP server for AI dialogue using various LLM models via AceDataCloud
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that connects Claude for Desktop with blockchain functionality, allowing users to check balances and send tokens on EVM and Solana chains through natural language interactions.-
- AlicenseBqualityDmaintenanceAn MCP server that enables LLMs to perform blockchain operations on the Base network through natural language commands, including wallet management, balance checking, and transaction execution.454 npm3MIT
- AlicenseAqualityFmaintenanceAn MCP server that empowers AI agents to inspect any wallet’s balance and onchain activity across major EVM chains and Solana chain.39MIT
- AlicenseBqualityDmaintenanceAn MCP server providing comprehensive access to Ethereum blockchain data across 72+ networks via Etherscan's V2 API. It enables users to check balances, track transactions, analyze smart contracts, and monitor gas prices through natural language.2415 npm1MIT