Back to MCP directory
publicPublicdnsLocal runtime

alchemy-mcp-server

Alchemy MCP Server是一个连接AI代理与Alchemy区块链API的协议服务器,使代理无需编写代码即可直接查询区块链数据,包括代币价格、NFT所有权、交易历史等多链功能。

article

README

🚀 Alchemy MCP 服务器

Alchemy MCP 服务器是一个模型上下文协议(MCP)服务器,它能让 AI 代理以结构化的方式与 Alchemy 的区块链 API 进行交互。借助该服务器,代理无需编写代码就能直接查询区块链数据,极大地提升了操作的便捷性。

🚀 快速开始

此 MCP 服务器在 AI 代理和 Alchemy 的区块链 API 之间搭建了桥梁,支持代理进行以下操作:

  • 查询代币价格及价格历史
  • 获取 NFT 所有者信息
  • 查看交易记录
  • 检查多个区块链网络中的代币余额
  • 检索资产转移
  • 还有更多功能!

快速设置

若要快速设置 MCP 服务器,请在您的 MCP 配置文件(通常位于 Claude Desktop 或 Cursor 设置中)使用以下配置:

{
  "mcpServers": {
    "alchemy": {
      "command": "npx",
      "args": [
        "-y",
        "@alchemy/mcp-server"
      ],
      "env": {
        "ALCHEMY_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

该配置可让您无需手动克隆仓库就能使用服务器。

✨ 主要特性

您可以提示 AI 代理使用以下方法:

代币价格方法

  1. fetchTokenPriceBySymbol
    • 功能:根据符号获取当前代币价格数据
    • 示例:"ETH 和 BTC 当前价格是多少?"
  2. fetchTokenPriceByAddress
    • 功能:根据合约地址获取当前代币价格数据
    • 示例:"0x1234...5678 地址的 ETH 价格是多少?"
  3. fetchTokenPriceHistoryBySymbol
    • 功能:获取代币的历史价格数据
    • 示例:"显示 BTC 在 2023 年 1 月 1 日到 2 月 1 日之间的每日价格历史"

多链代币方法

  1. fetchTokensOwnedByMultichainAddresses
    • 功能:获取多个网络地址的代币余额
    • 示例:"0xabc...123 在 Ethereum 和 Base 网络上持有哪些代币?"

交易记录方法

  1. fetchMultichainWalletAddressTransactionHistory
    • 功能:获取多链钱包地址的交易历史
    • 示例:"显示 0xdef...456 地址在 Ethereum 网络上的近期交易记录"
  2. fetchTransfers
    • 功能:获取地址的代币转移数据
    • 示例:"显示所有 ERC - 20 转移到或从 0xghi...789 的记录"

NFT 方法

  1. fetchNftsOwnedByMultichainAddresses
    • 功能:获取多个地址的所有 NFT
    • 示例:"0xjkl...012 地址拥有哪些 NFT?"
  2. fetchNftContractDataByMultichainAddress
    • 功能:获取多个地址的 NFT 合约数据
    • 示例:"0xmno...345 地址参与了哪些 NFT 收藏系列?"

📦 安装指南

安装

  1. 克隆仓库
git clone https://github.com/alchemyplatform/alchemy-mcp.git
cd alchemy-mcp
  1. 安装依赖项
npm install

运行测试

npm test

构建项目

npm run build

本地开发服务器启动

npm start

💻 使用示例

基础用法

以下是一些使用示例:

  1. 查询代币价格:
curl -X POST http://localhost:3000/api/v1/queryTokenPrice \
  -H "Content-Type: application/json" \
  -d '{"symbol": "ETH"}'
  1. 获取 NFT 信息:
curl -X POST http://localhost:3000/api/v1/getNfts \
  -H "Content-Type: application/json" \
  -d '{"address": "0xjkl...012"}'

📚 详细文档

完整的 API 文档请参考 API DOCS

📄 许可证

该项目受 MIT License 的保护。


通过以上内容,您可以轻松开始使用 Alchemy MCP 服务器与区块链进行交互。

开源贡献

我们欢迎社区的贡献!请参考 CONTRIBUTING.md 了解如何参与。

READY-TO-PASTE CONFIG

MCP client config generator

Choose your client, fill the required environment variables, then copy a config generated from this server's published metadata

terminal
data_object

This entry does not contain a standard command or remote URL, so a safe client config cannot be generated automatically

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client