Purpose
uniswap-price-mcp is an MCP (Model Context Protocol) server used to provide real-time token prices from Uniswap V3 to AI agents and DeFi automation workflows. It obtains token quotes by querying Uniswap V3 pools and is suitable for automated tasks that require on-chain price data.
Main Capabilities
- Multi-chain support: Ethereum mainnet (1), Polygon (137), Arbitrum (42161), Optimism (10).
- Token price retrieval: Query Uniswap V3 pools, obtain token prices in the order of USDT, USDC, WETH, and automatically retrieve token decimals and symbols.
- USD conversion: Optionally use the CryptoCompare API to perform USD price conversion for all quoted tokens.
Usage
- Environment requirements: Node.js (v18 or higher recommended) and npm.
- Prepare an Infura account: Obtain an INFURA_PROJECT_ID that can access Ethereum, Polygon, Arbitrum, and Optimism.
- Clone the repository:
git clone https://github.com/kukapay/uniswap-price-mcp.git cd uniswap-price-mcp - Install dependencies:
npm install - Client configuration example:
Replace your_infura_project_id with your Infura project ID.{ "mcpServers": { "Uniswap Price": { "command": "node", "args": ["path/to/uniswap-price-mcp/index.js"], "env": { "INFURA_PROJECT_ID": "your_infura_project_id" } } } } - Use an MCP-compatible client to interact with the server.
Applicable Scenarios
- When AI agents need real-time on-chain token prices.
- When multi-chain price data is needed in DeFi automation workflows.
- When token prices need to be converted to USD pricing.
Limitations
- You need to prepare your own Infura project ID, and that ID must have access to Ethereum, Polygon, Arbitrum, and Optimism.
- USD conversion depends on the CryptoCompare API.
- The project uses the MIT license; see the LICENSE file for details.
- Other feature details, fee information, pricing, and platform support scope are not yet provided.