Uniswap V3价格MCP服务器
一个MCP服务器,通过多个链从Uniswap V3提供实时代币价格,针对AI代理和DeFi自动化进行了优化。
特性
- 支撑链以太坊主网(1),多边形(137),仲裁(42161),乐观主义(10)。
- 代币价格获取:通过自动检索小数和符号,查询Uniswap V3池中USDT、USDC或WETH(按此顺序)的代币价格。
- 美元兑换:对于所有报价代币,使用CryptoCompare API进行可选的美元价格转换。
先决条件
- Node.js (建议使用v18或更高版本)以及 npm.
- Infura帐户:获取
INFURA_PROJECT_ID可以访问以太坊、Polygon、Arbitrum和乐观主义(注册网址: 英富拉).
安装
- 克隆存储库:
git clone https://github.com/kukapay/uniswap-price-mcp.git
cd uniswap-price-mcp- 安装依赖项:
npm install- 客户端配置:
{
"mcpServers": {
"Uniswap Price": {
"command": "node",
"args": ["path/to/uniswap-price-mcp/index.js"],
"env": {
"INFURA_PROJECT_ID": "your_infura_project_id"
}
}
}
}替换 your_infura_project_id 使用您的Infura项目ID。
用法
使用MCP兼容客户端与服务器交互。
工具
获取支持链
提示:
Show me a list of all blockchain networks supported by the server, formatted as a table.结果:
| 链ID | 链名称 |
|---|---|
| 1 | 以太坊主网 |
| 137 | 多边形 |
| 42161 | 仲裁 |
| 10 | 乐观 |
getTokenPrice
提示:
What is the current price of DAI in USD on the Ethereum Mainnet?结果:
Price of token DAI on chain 1 in USD: 1.00提示:
Get the USD price of Chainlink (LINK) on the Polygon network.结果:
Price of token LINK on chain 137 in USD: 18.50许可证
该项目根据MIT许可证获得许可。请参阅 许可证 文件以获取详细信息。
