Purpose
chainlink-feeds-mcp is an MCP (Model Context Protocol) server designed to provide AI agents and autonomous systems with real-time access to Chainlink decentralized on-chain price feeds. It exposes tools through the MCP protocol, enabling AI clients (such as Claude Desktop) to query blockchain price data in natural language or JSON format.
Main Capabilities
The server provides five tools:
- getLatestPrice: Retrieves the latest price for a specified trading pair on a specified chain, returning a JSON object containing the price, decimals, round ID, timestamp, proxy address, and feed category.
- queryPriceByRound: Queries the price for a specified trading pair by round ID; currently, due to on-chain historical data limitations, this function is a placeholder.
- listSupportedChains: Returns a comma-separated list of all supported blockchain networks.
- listSupportedFeeds: Returns a Markdown-formatted list of all supported chains and their price feed names.
- listSupportedFeedsByChain: Returns a comma-separated list of price feed names for a specified chain.
The server supports 9 blockchain networks with a total of 329 price feeds, defined in feeds.json:
- Ethereum: 107 feeds (such as FIL/ETH, BTC/USD, USDC/USD)
- BNB Chain (bsc): 80 feeds (such as DOT/USD, CAKE/USD, BUSD/BNB)
- Base: 52 feeds (such as AXL/USD, USDC/USD, WIF/USD)
- Starknet: 9 feeds (such as ETH/USD, BTC/USD, WSTETH/ETH)
- Linea: 15 feeds (such as ETH/USD, FOXY/USD, MATIC/USD)
- Mantle: 6 feeds (such as MNT/USD, USDT/USD, BTC/USD)
- Scroll: 22 feeds (such as SCR/USD, STETH/USD, WBTC/BTC)
- zkSync: 16 feeds (such as ZK/USD, PEPE/USD,TRUMP/USD)
- Celo: 22 feeds (such as CELO/USD, CUSD/USD, NGN/USD)
More chains and feeds can be added by updating feeds.json, requiring the new network configuration and the proxy addresses from the Chainlink price feed documentation.
Usage
Environment Requirements
- Node.js: 18.x or higher
- npm: for installing dependencies
- Infura API Key: obtained from the MetaMask Developer Dashboard, must support the target network (such as Ethereum, Base)
- MCP Inspector (optional): for local server testing
- Claude Desktop (optional): for integration with Anthropic's Claude interface
Installation Steps
- Clone the repository:
git clone https://github.com/kukapay/chainlink-feeds-mcp.git cd chainlink-feeds-mcp - Install dependencies:
Project dependencies: @modelcontextprotocol/sdk (MCP server functionality), ethers 6.x (blockchain interaction), zod (input validation), dotenv (environment variable management).npm install - Configure the MCP client: add the following to the configuration file of an MCP client such as Claude Desktop:
{ "mcpServers": { "chainlink-feeds-mcp": { "command": "node", "args": ["path/to/chainlink-feeds-mcp/index.js"], "env": { "INFURA_API_KEY": "your_api_key_here" } } } }
Tool Call Examples
- getLatestPrice:
- Natural language 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."
- queryPriceByRound:
- Natural language 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."
- listSupportedChains:
- Natural language input: "Which blockchain networks does this server support?"
- Output: "The server supports the following networks: ethereum, bsc, base, starknet, linea, mantle, scroll, zksync, celo."
- listSupportedFeeds:
- Natural language input: "Can you list all the price feeds supported by the server?"
- Output: A Markdown-formatted list of chains and price feeds.
- listSupportedFeedsByChain:
- Natural language 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, ..."
Use Cases
- AI agents need to obtain real-time blockchain price data for decision-making.
- Automated systems integrate Chainlink price feeds.
- Query prices in natural language through MCP clients such as Claude Desktop.
Limitations
- queryPriceByRound is currently a placeholder and cannot return real historical prices due to on-chain historical data limitations.
- An Infura API Key is required to access the supported blockchain networks.
- The number of supported chains and price feeds is fixed, and feeds.json must be manually updated to add new networks.
- The project uses the MIT License.