chainlink-feeds-mcp

chainlink-feeds-mcp

An MCP server that provides real-time access to Chainlink's decentralized on-chain price feeds, optimized for seamless integration into AI agents and autonomous systems.

Category
访问服务器

README

Chainlink Feeds MCP Server

An MCP server that provides real-time access to Chainlink's decentralized on-chain price feeds, optimized for seamless integration into AI agents and autonomous systems

License Node.js Status

Features

  • Query Latest Price: Fetch the latest price for a specified price feed pair (e.g., FIL/ETH) on a given chain (e.g., ethereum), including price, decimals, round ID, and timestamp.
  • Query Price by Round ID: Retrieve price data for a specific round ID (currently a placeholder due to on-chain historical data limitations).
  • List Supported Chains: Get a comma-separated list of supported blockchain networks (e.g., ethereum,base).
  • List All Feeds: Retrieve a Markdown-formatted list of all chains and their price feed names (e.g., - ethereum: FIL/ETH,FDUSD/USD).
  • List Feeds by Chain: Obtain a comma-separated list of price feed names for a specific chain (e.g., FIL/ETH,FDUSD/USD for ethereum).
  • Configurable Feeds: Define price feeds and RPC endpoints in a feeds.json file, supporting multiple chains and feed categories.

Supported Chains and Feeds

The server supports 9 blockchain networks with a total of 329 price feeds, as defined in feeds.json:

  • Ethereum: 107 feeds (e.g., FIL/ETH, BTC/USD, USDC/USD)
  • BNB Chain (bsc): 80 feeds (e.g., DOT/USD, CAKE/USD, BUSD/BNB)
  • Base: 52 feeds (e.g., AXL/USD, USDC/USD, WIF/USD)
  • Starknet: 9 feeds (e.g., ETH/USD, BTC/USD, WSTETH/ETH)
  • Linea: 15 feeds (e.g., ETH/USD, FOXY/USD, MATIC/USD)
  • Mantle: 6 feeds (e.g., MNT/USD, USDT/USD, BTC/USD)
  • Scroll: 22 feeds (e.g., SCR/USD, STETH/USD, WBTC/BTC)
  • zkSync: 16 feeds (e.g., ZK/USD, PEPE/USD, TRUMP/USD)
  • Celo: 22 feeds (e.g., CELO/USD, CUSD/USD, NGN/USD)

Additional chains and feeds can be added by updating feeds.json with new network configurations and proxy addresses from Chainlink's Price Feeds documentation.

Prerequisites

  • Node.js: Version 18.x or higher.
  • npm: For dependency installation.
  • Infura API Key: Obtain a key from the MetaMask Developer Dashboard with access to supported networks (e.g., Ethereum, Base).
  • MCP Inspector (optional): For testing the server locally.
  • Claude Desktop (optional): For integration with Anthropic's Claude interface.

Installation

  1. Clone the Repository:

    git clone https://github.com/kukapay/chainlink-feeds-mcp.git
    cd chainlink-feeds-mcp
    
  2. Install Dependencies:

    npm install
    

    The project requires:

    • @modelcontextprotocol/sdk: For MCP server functionality.
    • ethers: Version 6.x for blockchain interactions.
    • zod: For input validation.
    • dotenv: For environment variable management.
  3. Configure MCP Client: To use this server with an MCP client like Claude Desktop, add the following to your config file (or equivalent):

    {
      "mcpServers": {
        "chainlink-feeds-mcp": {
          "command": "node",
          "args": ["path/to/chainlink-feeds-mcp/index.js"],
          "env": { "INFURA_API_KEY": "your_api_key_here" }
        }
      }
    }   
    

Usage

The server exposes five tools via the MCP protocol, accessible through Claude Desktop (for natural language queries) or MCP Inspector (for JSON inputs). Below are the tools, with examples in both natural language (via Claude Desktop) and JSON formats.

Tool: getLatestPrice

  • Description: Fetches the latest price for a given pair on a specified chain, returns a JSON object like this:

    {
      "chain": "ethereum",
      "pair": "FIL/ETH",
      "price": 0.01234,
      "decimals": 18,
      "roundId": "123456",
      "timestamp": "2025-04-17T12:00:00.000Z",
      "proxyAddress": "0x0606Be69451B1C9861Ac6b3626b99093b713E801",
      "feedCategory": "medium"
    }
    
  • Parameters:

    • pair (string): The price feed pair, e.g., FIL/ETH.
    • chain (string): The blockchain network, e.g., ethereum.
  • Natural Language Example (Claude Desktop):

    Input: "What��s the latest FIL/ETH price on Ethereum?"

    Output: "The latest FIL/ETH price on Ethereum is 0.01234, with 18 decimals, round ID 123456, updated at 2025-04-17 12:00:00 UTC."

Tool: queryPriceByRound

  • Description: Queries the price for a given pair and round ID on a specified chain, returns a JSON object like this:

    {
      "chain": "ethereum",
      "pair": "FDUSD/USD",
      "price": 1.0001,
      "decimals": 8,
      "roundId": "123",
      "timestamp": "2025-04-17T12:00:00.000Z",
      "proxyAddress": "0xfAA9147190c2C2cc5B8387B4f49016bDB3380572",
      "feedCategory": "medium"
    }
    
  • Parameters:

    • roundId (string): The round ID for the price data.
    • pair (string): The price feed pair, e.g., FDUSD/USD.
    • chain (string): The blockchain network, e.g., ethereum.
  • Natural Language Example (Claude Desktop):

    Input: "Can you get the FDUSD/USD price for round ID 123 on Ethereum?"

    Output: "For round ID 123, the FDUSD/USD price on Ethereum is 1.0001, with 8 decimals, updated at 2025-04-17 12:00:00 UTC. Note: This is a placeholder response due to historical data limitations."

Tool: listSupportedChains

  • Description: Returns a comma-separated list of all supported blockchain networks.

  • Parameters: None.

  • Natural Language Example (Claude Desktop):

    Input: "Which blockchain networks does this server support?"

    Output: "The server supports the following networks: ethereum, bsc, base, starknet, linea, mantle, scroll, zksync, celo."

Tool: listSupportedFeeds

  • Description: Returns a Markdown list of all supported chains and their price feed names.

  • Parameters: None.

  • Natural Language Example (Claude Desktop):

    Input: "Can you list all the price feeds supported by the server?"

    Output: "Here are the supported price feeds by chain:

    • Ethereum: FIL/ETH, FDUSD/USD, UNI/ETH, ...
    • BNB Chain: DOT/USD, CAKE/USD, BUSD/BNB, ...
    • Base: AXL/USD, USDC/USD, WIF/USD, ...
    • Starknet: ETH/USD, BTC/USD, WSTETH/ETH, ...
    • Linea: ETH/USD, FOXY/USD, MATIC/USD, ...
    • Mantle: MNT/USD, USDT/USD, BTC/USD, ...
    • Scroll: SCR/USD, STETH/USD, WBTC/BTC, ...
    • zkSync: ZK/USD, PEPE/USD, TRUMP/USD, ...
    • Celo: CELO/USD, CUSD/USD, NGN/USD, ..."

Tool: listSupportedFeedsByChain

  • Description: Returns a comma-separated list of price feed names for a specified blockchain network.

  • Parameters:

    • chain (string): The blockchain network, e.g., base.
  • Natural Language Example (Claude Desktop):

    Input: "What price feeds are available on the Base chain?"

    Output: "The Base chain supports the following price feeds: AXL/USD, USDC/USD, WIF/USD, CBETH/ETH, ..."

License

This project is licensed under the MIT License.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选