About Uniswap MCP Server Rust
Uniswap MCP Server Rust is an MCP server published by CJ42 in the Blockchain category: interacting with the Uniswap API in Rust.
The repository has 1 stars and 0 forks, with the last commit 6 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/CJ42/uniswap-mcp-server-rustThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Uniswap MCP Server Rust
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
🦄 Uniswap MCP Server Rust 🦀

An MCP (Model Context Protocol) server in Rust that exposes Uniswap Trade API quotes as a tool for AI clients. Built with the official Rust SDK RMCP (rmcp on crates.io).
Prerequisites
- Rust toolchain (
cargo,rustc) - A Uniswap Trade API key as
UNISWAP_API_KEY(see Uniswap docs)
Configuration
Create a .env file next to Cargo.toml (or export the variable in your shell):
UNISWAP_API_KEY=your_key_here
The server loads .env at startup using the crate manifest directory, so it works when MCP hosts run the binary from another working directory.
Build
cargo build --release
How it works
- Transport: stdio (standard for local MCP: the host spawns this process and speaks JSON-RPC over stdin/stdout).
- SDK:
rmcpwithserver+transport-io. - Tool:
uniswap_swap_quote— callsPOST https://trade-api.gateway.uniswap.org/v1/quotewith your API key and returns the JSON quote (pretty-printed text). Usetoken_in_presetto pick the asset you sell on Ethereum mainnet without typing addresses:native_eth,usdc,usdt,wbtc,dai,weth. If you set a preset, it overridestoken_in; otherwise pass a fulltoken_inaddress.
Async runtime: Tokio (required by RMCP and reqwest).
Using with an MCP client
Point your MCP host at the compiled binary. Example for Cursor (.cursor/mcp.json or global MCP settings):
{
"mcpServers": {
"uniswap": {
"command": "/absolute/path/to/uniswap-api-rust/target/release/uniswap-mcp-server-rust",
"env": {
"UNISWAP_API_KEY": "your_key_here"
}
}
}
}
You can omit env if UNISWAP_API_KEY is already in the environment.
To debug with the official inspector (see RMCP examples):
npx @modelcontextprotocol/inspector /absolute/path/to/target/debug/uniswap-mcp-server-rust
Example to test
Run the commands from the previous section and open the MCP Inspector in your browser.
- Enter the following values as example
"tokenIn": "0x0000000000000000000000000000000000000000", // ETH
"tokenOut": "0xdAC17F958D2ee523a2206206994597C13D831ec7", // USDT
"tokenInChainId": 1,
"tokenOutChainId": 1,
"type": "EXACT_INPUT",
"amount": "1000000000000000000", // 1 ETH in wei
"swapper": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", // User's wallet address (vitalik.eth)
- Click on the "Run Tool" button
Learning steps
- MCP server over stdio with RMCP
- Async quote tool via Uniswap Trade API
- Make it I can enter different commands while it is running
(
start,stop,unicorns) - Try to use functionalities from the allow web3 library for Rust.
- Extend with more tools (e.g. supported chains, token metadata)
License
See LICENSE in the repository.
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.