Skip to main content
Glama
akki91
by akki91

MCP Badge

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 中的设置

  1. 启动 Claude Desktop。

  2. 从主菜单导航至 Settings(设置)。

第 2 步:更新开发者设置

  1. 打开 Developer Settings(开发者设置)。

  2. 编辑包含 MCP 服务器定义的配置文件。

  3. 如果已经列出了 MCP 服务器,请将您的 Ankr MCP 配置附加到现有列表中。否则,复制并粘贴上述整个 Ankr MCP 服务器配置。

第 3 步:重启 Claude Desktop

  1. 关闭 Developer Settings(开发者设置)菜单。

  2. 重启 Claude Desktop 以应用更改。

第 4 步:验证集成

  1. Claude Desktop 重启后,点击聊天输入框下方的 Tools Icon(工具图标)。

  2. 验证 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 tool
get_token_balances_on_networkB

Gets all token balances for a given address on a specific network

ParametersJSON Schema
NameRequiredDescriptionDefault
addressYesThe address to check token balances for
networkYesThe blockchain network (e.g., "ethereum", "base")

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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. 1 tool updatev1.0.0
    • First observedget_token_balances_on_network

TDQS

B3.2/5.0

Scored across 1 tool

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count2/5

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.

Completeness1/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers