Token导航 LogoToken导航TokenDH.com
Dune API MCP Server logo
金融服务stdio官方级别未说明来源级核验

Dune API MCP Server

MCP Server

@modelcontextprotocol/inspector

该项目实现了一个模型上下文协议(MCP)服务器,通过Dune API提供区块链数据分析功能,允许LLM代理和其他MCP客户端分析区块链信息。

工具数

8

提示词数

0

GitHub Stars

4

资源数

0
JavaScriptClaude金融数据Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

crazyrabbitLTC

提供方

crazyrabbitLTC

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx @modelcontextprotocol/inspector bun run index.ts

详细介绍

ChatGPT Image May 23, 2025, 10_25_41 AM

沙丘API MCP服务器

该项目实现了一个模型上下文协议(MCP)服务器,该服务器公开了Dune API的功能,允许LLM代理和其他MCP客户端分析区块链信息。

特性

服务器基于Dune API提供以下MCP工具和资源:

EVM工具:

  • get_evm_balances:获取钱包的EVM代币余额。
  • get_evm_activity:获取EVM帐户活动。
  • get_evm_collectibles:获取EVM NFT收藏品。
  • get_evm_transactions:检索细粒度EVM事务详细信息。
  • get_evm_token_info:获取EVM代币的元数据和价格。
  • get_evm_token_holders:发现EVM代币持有者分布。

SVM工具:

  • get_svm_balances:获取SVM令牌余额。
  • get_svm_transactions:获取SVM事务(仅限Solana)。

资源:

  • dune://evm/supported-chains:提供Dune API支持的EVM链的列表。

提示:

  • /evm_wallet_overview {walletAddress}:快速了解EVM钱包。
  • /analyze_erc20_token {chainId} {tokenAddress}:分析特定的ERC20代币。
  • /svm_address_check {walletAddress}:检查SVM地址的基本信息。

快速开始

# Clone the repository
git clone https://github.com/crazyrabbitLTC/mcp-web3-stats.git
cd mcp-web3-stats

# Install dependencies
bun install

# Create .env file with your Dune API key
echo "DUNE_API_KEY=your_actual_dune_api_key_here" > .env

# Start the server
bun start

# In a separate terminal, run the MCP Inspector to test the tools
npx @modelcontextprotocol/inspector bun run index.ts

从npm安装

您可以通过npm全局安装Web3 Stats服务器:

# Install globally
npm install -g mcp-web3-stats

# Set your Dune API key as an environment variable
export DUNE_API_KEY=your_actual_dune_api_key_here

# Run the server
mcp-web3-stats

# In a separate terminal, test with the MCP Inspector
npx @modelcontextprotocol/inspector mcp-web3-stats

或者,您可以直接使用npx运行它:

# Set your Dune API key as an environment variable
export DUNE_API_KEY=your_actual_dune_api_key_here

# Run the server with npx
npx mcp-web3-stats

# In a separate terminal, test with the MCP Inspector
npx @modelcontextprotocol/inspector npx mcp-web3-stats

你能用这个做什么

此MCP服务器允许您和您的AI助手直接分析区块链数据和钱包信息。以下是一些示例用例:

1.检查钱包余额

您可以快速查看任何钱包地址持有的所有代币(包括ERC20和NFT):

Assistant: Let me check the balances in this wallet for you.

[Uses get_evm_balances with walletAddress=0xYourWalletAddress]

This wallet contains:
- 1.25 ETH (~$3,800)
- 500 USDC ($500)
- Several NFTs including a CryptoPunk and two Bored Apes

2.分析代币信息和持有者

您可以研究特定的代币及其分布:

Assistant: Let me analyze this token for you.

[Uses get_evm_token_info with chainId=1 and tokenAddress=0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984]

UNI Token Information:
- Current price: $5.32
- Market cap: $2.7B 
- 24h trading volume: $89M

[Uses get_evm_token_holders with chainId=1 and tokenAddress=0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984]

Top UNI Token Holders:
1. 0x47173B170C64d16393a52e6C480b3Ad8c302ba1e: 5.2% of supply
2. 0x1a9C8182C09F50C8318d769245beA52c32BE35BC: 3.8% of supply
...

3.审查最近的交易

您可以分析任何地址的交易历史:

Assistant: Here's a summary of recent transactions.

[Uses get_evm_transactions with walletAddress=0xYourWalletAddress]

Recent activity:
- Yesterday: Swapped 2 ETH for 3,500 UNI on Uniswap
- 3 days ago: Withdrew 5 ETH from Binance
- Last week: Minted an NFT for 0.08 ETH

4.检查Solana余额

您还可以分析Solana钱包:

Assistant: Let me check your Solana wallet balances.

[Uses get_svm_balances with walletAddress=YourSolanaAddress]

This wallet contains:
- 12.5 SOL (~$875)
- 2,500 USDC ($2,500)
- Several SPL tokens including 150 BONK

使用Claude Desktop或其他MCP客户端配置此服务器,使您的AI助手能够实时检索和分析链上数据。

先决条件

设置

  1. 克隆存储库(如果适用)或确保您拥有项目文件。
  1. 安装依赖项:
   bun install
  1. 配置环境变量:

创建一个 .env 文件,并添加您的Dune API密钥:

   DUNE_API_KEY=your_actual_dune_api_key_here

替换 your_actual_dune_api_key_here 使用您的有效密钥。

运行服务器

  • 要使用Bun直接运行服务器(用于开发/测试):
  bun start

服务器将启动并通过stdio监听MCP消息。

  • 要将服务器构建为JavaScript(对于需要JS的环境):

使用配置的构建脚本,该脚本利用TypeScript编译器(tsc):

  bun run build

此命令执行 bunx tsc 如所定义 package.json. tsc 使用 tsconfig.json 文件以确定入口点(如 index.ts)以及编译选项,将JavaScript文件输出到 ./dist 目录。

然后,您可以使用Node.js或Bun运行构建的服务器:

  node dist/index.js 
  # or
  bun dist/index.js

*或者,如果您希望直接使用Bun的内置bundler(其行为或配置需求可能与Bun不同) tsc),您通常会明确指定入口点:* *bun build ./index.ts --outdir ./dist* *然而,该项目旨在使用 tsc 通过构建 bun run build 脚本。*

MCP检验员测试

一旦服务器运行(例如,通过 bun start 在一个终端)中,您可以使用另一个终端中的MCP检查器连接到它:

# If running the TypeScript source directly
npx @modelcontextprotocol/inspector bun run index.ts

或者,如果您已经构建了服务器并正在运行JavaScript版本:

# If running the built JavaScript version from ./dist
npx @modelcontextprotocol/inspector node dist/index.js

这将启动检查器UI,允许您发现和测试此服务器提供的工具、资源和提示。

与MCP客户端集成(例如,Claude Desktop)

要将此服务器与Claude Desktop等MCP客户端一起使用,您需要配置客户端以启动此服务器。对于Claude Desktop,您可以修改其 claude_desktop_config.json 文件(通常位于 ~/Library/Application Support/Claude/claude_desktop_config.json 在macOS或 %APPDATA%\Claude\claude_desktop_config.json 在Windows上)。

以下是示例配置。您可以选择服务器名称(例如。, dune_api_serverweb3_stats_server)这对你来说是有道理的。

示例1:使用Node.js运行构建的JavaScript版本(推荐用于稳定性)

这假设您已经运行过 bun run build 创建 ./dist 目录。

{
  "mcpServers": {
    "dune_api_server": { // You can name this server entry whatever you like
      "command": "node",
      "args": [
        "/ABSOLUTE/PATH/TO/YOUR/mcp-web3-stats/dist/index.js"
      ],
      "env": {
        "DUNE_API_KEY": "your_actual_dune_api_key_here" // Replace with your key
      }
    }
  }
}

示例2:直接使用Bun运行TypeScript源代码

这便于开发,但可能需要指定Bun可执行文件的完整路径。

{
  "mcpServers": {
    "dune_api_server_dev": { // You can name this server entry whatever you like
      "command": "/full/path/to/your/bun/executable", // e.g., /Users/username/.bun/bin/bun or C:\Users\username\.bun\bin\bun.exe
      "args": [
        "run",
        "/ABSOLUTE/PATH/TO/YOUR/mcp-web3-stats/index.ts"
      ],
      "env": {
        "DUNE_API_KEY": "your_actual_dune_api_key_here" // Replace with your key
      }
    }
  }
}

重要配置说明:

  • API密钥:必须 替换 "your_actual_dune_api_key_here"env 使用您的实际Dune API密钥阻止。虽然服务器脚本包括 dotenv 加载本地 .env 文件,依赖于客户端(如Claude Desktop)通过其配置传递环境变量,对于外部主机启动的服务器来说更可靠。
  • 绝对路径:必须 替换 /ABSOLUTE/PATH/TO/YOUR/... 通过正确和完整的绝对路径 dist/index.js 文件(用于节点)或 index.ts 文件(用于Bun直接执行)和Bun可执行文件(如果直接运行TypeScript)。
  • Bun可执行路径: 如果直接使用Bun(实施例2) command 可能需要是Bun可执行文件的完整、绝对路径(例如。, ~/.bun/bin/bun 在macOS/Linux上,或Windows上的等效路径),如果它不在Claude Desktop等应用程序的path中普遍存在。
  • 重新启动客户端: 保存更改后 claude_desktop_config.json,您必须重新启动Claude Desktop才能使更改生效。

目录标签

目录标签

JavaScriptClaude金融数据区块链分析本地部署EVM工具SVM工具钱包分析代币分析

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

运行时(runtime,运行环境)

Node.js

部署方式(deploymentType,部署类型)

remote-capable

来源包(packageName,安装包名)

@modelcontextprotocol/inspector

工具数量(toolCount,工具数)

8

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-keyremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP