uniswap_prices
Provides tools for reading Uniswap V1/V2/V3 pool reserves directly from the Ethereum blockchain via a public RPC endpoint, enabling on-chain token price data without requiring an API key.
uniswap_prices
MCP server based on FastMCP. Runs over stdio by default, or as a local HTTP service (see Running over HTTP (Docker)). Reads Uniswap V1/V2/V3 reserves directly on-chain via a public, unauthenticated Ethereum RPC endpoint — no API key required.
Scope
This server does exactly one thing: read Uniswap pool reserves straight from the chain.
Genuinely zero-auth. No API key, no account, no sign-up — not even for the underlying data source. Most "crypto price" MCP servers are thin wrappers around a paid/rate-limited pricing API (CoinGecko, 1inch, etc.) that still needs a key. This one talks directly to a public Ethereum RPC endpoint and reads the pool contracts' own storage — there's no intermediary to authenticate to, and nothing to keep secret.
Uniswap only, on purpose. It doesn't try to be a universal multi-DEX or multi-chain price server. It knows Uniswap V1/V2/V3 and nothing else. If you need broader coverage, compose it with other narrow, single-purpose MCP servers instead.
Related MCP server: uniswap-pools-mcp
Tools
get_v1_reserves(token)— ETH/token reserves of a token's Uniswap V1 exchange (V1 pairs are always ETH<->token).get_v2_reserves(token_a, token_b)— reserves of a Uniswap V2 pair viagetReserves().get_v3_reserves(token_a, token_b, fee=None)— on-chain reserves (pool token balances) of Uniswap V3 pool(s); iffeeis omitted, all standard fee tiers are checked.
token/token_a/token_b accept either a mainnet ERC20 contract address or a known
symbol (ETH, WETH, USDC, USDT, DAI, WBTC).
By default the server talks to https://ethereum-rpc.publicnode.com; override with the
UNISWAP_PRICES_RPC_URL env var.
Setup
git clone <this-repo-url>
cd uniswap_prices
conda create -n uniswap_prices python=3.12 -y
conda activate uniswap_prices
pip install -e .Run
python -m uniswap_prices.serveror, if configured as an entry point in an MCP client:
{
"command": "python",
"args": ["-m", "uniswap_prices.server"]
}Running over HTTP (Docker)
The server can also run as a local HTTP service (streamable-http transport) instead of stdio — useful for MCP clients that connect over HTTP, or for running the server as a standalone daemon.
Without Docker:
UNISWAP_PRICES_TRANSPORT=http UNISWAP_PRICES_HTTP_HOST=127.0.0.1 UNISWAP_PRICES_HTTP_PORT=8000 \
python -m uniswap_prices.serverThe MCP endpoint is then available at http://127.0.0.1:8000/mcp.
With Docker:
docker compose up --build
# or, to bind a different host port (e.g. if 8000 is already taken):
UNISWAP_PRICES_HOST_PORT=8001 docker compose up --buildor plain Docker, picking any free host port yourself:
docker build -t uniswap_prices .
docker run -p 8000:8000 uniswap_pricesEnv vars (all optional):
UNISWAP_PRICES_TRANSPORT—stdio(default) orhttp.UNISWAP_PRICES_HTTP_HOST— bind host for HTTP mode (default127.0.0.1; the Docker image sets this to0.0.0.0).UNISWAP_PRICES_HTTP_PORT— bind port for HTTP mode (default8000).UNISWAP_PRICES_RPC_URL— override the Ethereum RPC endpoint.
Development
Tools are defined in
src/uniswap_prices/tools/.Each tool's logic is kept separate from the
@mcp.tool()decorator so it can be unit tested.Do not use
print()for debugging: it breaks the stdio protocol. Useloggingorsys.stderrinstead.
Tests
pip install -e ".[dev]"
pytestLicense
Available Tools
3 toolsget_v1_reservesA
Reads the on-chain ETH/token reserves of a token's Uniswap V1 exchange.
Uniswap V1 pairs are always ETH<->token. token is a mainnet ERC20
contract address or a known symbol (e.g. "USDC", "DAI", "WBTC").
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly says this is a read operation on on-chain data, implying no side effects. It also clarifies that V1 pairs are always ETH<->token, which prevents callers from expecting arbitrary pair types. It does not discuss error behavior for unsupported tokens, but that is a minor gap for a read tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact, front-loaded with the core action, and each sentence adds distinct value: what it reads, the V1 pair invariant, and how to specify token. No filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read tool with a single parameter, the description is complete. It gives the input format, network assumption, and pair structure. The absence of an output schema is acceptable because the description already names what is read (ETH/token reserves), and the tool name reinforces the return concept.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description fully compensates by defining the only parameter: token is a mainnet ERC20 contract address or known symbol (e.g. USDC, DAI, WBTC). This informative explanation is more than enough for an agent to correctly construct the call.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: reading on-chain ETH/token reserves from a token's Uniswap V1 exchange. It includes the key distinguishing fact that V1 pairs are always ETH<->token, which separates it from sibling v2/v3 reserve tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: this is for Uniswap V1 exchanges, where pairs are always ETH<->token, and token must be a mainnet ERC20 address or symbol. It does not explicitly state when not to use it or name alternatives, but the V1-specific framing and sibling tool names make the intended usage clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_v2_reservesA
Reads the on-chain reserves of a Uniswap V2 pair via getReserves().
token_a/token_b are mainnet ERC20 contract addresses or known symbols
(e.g. "WETH", "USDC").
| Name | Required | Description | Default |
|---|---|---|---|
| token_a | Yes | ||
| token_b | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It clearly frames this as a read-only operation ('Reads') and adds that token_a/token_b can be mainnet addresses or known symbols. It does not disclose potential revert behavior, token ordering effects, or return format, but the simple on-chain read nature is adequately conveyed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short, front-loaded sentences with no filler. The first establishes what the tool does, and the second explains parameter semantics. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter read-only tool, the description is nearly complete: it identifies the operation, the pair version, the network (mainnet), and accepted token inputs. Minor gaps remain around token ordering and what exactly is returned, but the absence of an output schema is mitigated by the clear statement that reserves are read.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It does: 'token_a'/'token_b' are explicitly said to be mainnet ERC20 contract addresses or known symbols, with examples 'WETH' and 'USDC'. This adds essential meaning beyond the bare schema properties, though it leaves ordering and normalization details unstated.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb ('Reads'), a clear resource ('on-chain reserves of a Uniswap V2 pair'), and the exact method used ('getReserves()'). It is immediately distinguishable from the V1/V3 siblings because the pair version is explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool by scoping it to Uniswap V2 pairs, which an agent can infer from the sibling names. However, it does not explicitly state 'use this for V2 pairs, use get_v1_reserves or get_v3_reserves for other versions' or give exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_v3_reservesA
Reads the on-chain reserves (pool token balances) of Uniswap V3 pool(s).
token_a/token_b are mainnet ERC20 contract addresses or known symbols.
fee is the fee tier in hundredths of a bip (e.g. 3000 = 0.3%); if
omitted, all standard fee tiers (100, 500, 3000, 10000) are checked and
every pool that exists is returned.
| Name | Required | Description | Default |
|---|---|---|---|
| fee | No | ||
| token_a | Yes | ||
| token_b | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a read operation and details the fee-tier scanning behavior, which is useful. However, it does not mention return format, error handling, network dependencies, or whether it mutates anything (though 'Reads' implies no mutation). The description adds some value but lacks comprehensive behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with two clear paragraphs: the first states the core purpose, the second details parameter semantics and default behavior. It is concise, uses backticks for parameter names, and avoids fluff. It could be slightly tighter, but it earns its length by packing necessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the main behavior and parameters well, but since there is no output schema, it should describe the return format (e.g., an array of pool objects with addresses and reserve amounts). It only says 'every pool that exists is returned,' leaving the structure ambiguous. Also, it does not mention potential errors (e.g., when a pool doesn't exist). For a read tool with no output schema, this is a notable gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It thoroughly explains token_a/token_b (addresses or known symbols, mainnet) and fee (hundredths of a bip, examples, and the full behavior when omitted, including the list of tiers checked). This goes well beyond the bare schema, giving an agent everything it needs to populate parameters correctly.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Reads'), the resource ('on-chain reserves (pool token balances) of Uniswap V3 pool(s)'), and explicitly mentions 'Uniswap V3', which distinguishes it from v1/v2 siblings. It also clarifies what 'reserves' means, leaving no ambiguity about the tool's function.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides guidance on how to use the fee parameter (including the default behavior when omitted), but it does not explicitly explain when to choose this tool over get_v1_reserves or get_v2_reserves. The name and the explicit 'Uniswap V3' reference imply the use case, but there is no direct comparison or 'use this for V3' statement.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool targets a distinct Uniswap version with explicit version-specific parameters (V1 token, V2 token_a/token_b, V3 fee tiers), so there is no ambiguity. Names and descriptions clearly signal which contract type is accessed.
All three tools follow an identical get_v{version}_reserves pattern, making the API predictable and easy to navigate. No mixed casing or inconsistent verbs are present.
Three tools map cleanly to the three major Uniswap versions, and each serves a distinct endpoint type. The count is well-scoped for a narrow read-only reserves server.
The set covers all three Uniswap versions but only exposes raw reserves; V1/V2 reserves are sufficient to compute prices, while V3 prices require sqrtPriceX96 which is not provided. A direct current-price or quote tool would close this notable gap.
Maintenance
Related MCP Connectors
MCP server for Fuse Network: balances, tokens, staking, DeFi data, swaps and on-chain transactions.
MCP server for Renzo protocol data, including chains, vaults, operators, and ezETH metrics.
MCP server for Boson Protocol — on-chain agentic commerce for physical & digital goods.
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that delivers real-time token prices from Uniswap V3 across multiple chains.3MIT
- AlicenseAqualityDmaintenanceAn MCP server for querying Uniswap pools/pairs by token address, delivering clean, structured results for easy integration and analysis.54MIT
- AlicenseAqualityDmaintenanceMCP server for the AKKA Finance DEX aggregator — swap quotes, routes, and execution across EVM chains.995MIT
- AlicenseAqualityBmaintenanceA keyless MCP server that builds unsigned Uniswap v3 liquidity-position transactions and optionally simulates them via eth_call; it never holds keys or signs.8126Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ema-0/uniswap_prices'
If you have feedback or need assistance with the MCP directory API, please join our Discord server