DeFi数据访问服务

一个基于DefiLlama API的MCP服务器,为Claude提供DeFi数据访问能力,包括协议TVL、链TVL、代币价格和稳定币信息等。

  • by dcSpark
  • TypeScript
  • 本地部署
  • 8 星标
  • 更新于
在 GitHub 查看 dcSpark/mcp-server-defillama

使用说明

DefiLama的MCP服务器

该存储库包含一个模型上下文协议(MCP)服务器,该服务器通过DefiLlama API为Claude提供对DeFi数据的访问。该服务器使Claude能够执行检索协议TVL数据、链TVL数据,代币价格和稳定币信息等操作。

概述

MCP服务器向Claude公开了以下工具:

协议数据

  • defillama_get_protocols:列出DefiLama跟踪的所有协议
  • defillama_get_protocol_tvl:获取特定协议的TVL数据

链式数据

  • defillama_get_chain_tvl:获取特定链的TVL数据

令牌数据

  • defillama_get_token_prices:获取代币的当前价格
  • defillama_get_historical_prices:获取代币的历史价格

稳定币数据

  • defillama_get_stablecoins:列出DefiLama追踪的所有稳定币
  • defillama_get_stablecoin_data:获取特定稳定币的数据

先决条件

  • Node.js(v16或更高版本)

运行服务器

选项1:使用npx(推荐)

npx @mcp-dockmaster/mcp-server-defillama 您可以使用npx直接运行MCP服务器,而无需安装: 这将直接从npm下载并执行服务器。

选项2:手动安装

克隆此存储库: git clone https://github.com/mcp-dockmaster/mcp-server-defillama.git 安装依赖项: npm install 构建项目: npm run build

克劳德用法

要配置Claude Desktop以使用此MCP服务器,请执行以下操作:

打开克劳德桌面,导航到设置>开发人员设置>MCP服务器。在那里,您将遇到打开配置JSON文件的按钮。

添加MCP服务器配置:

{
  "mcpServers": {
    "mcp-server-defillama": {
      "command": "npx",
      "args": [
        "@mcp-dockmaster/mcp-server-defillama"
      ]
    }
  }
}

或者,如果您在本地安装了该软件包:

{
  "mcpServers": {
    "mcp-server-defillama": {
      "command": "node",
      "args": [
        "/path/to/your/mcp-server-defillama/build/index.js"
      ]
    }
  }
}