@fetchswap/cardano-mcp
v0.1.0
Published
Model Context Protocol server for the Fetch Cardano DEX aggregator — token search, prices, swap quotes, swap building, trade history, and DeFi yield, all over the public Fetch API.
Maintainers
Readme
@fetchswap/cardano-mcp
A Model Context Protocol server for the Fetch Cardano DEX aggregator. It lets any MCP-capable AI client (Claude Desktop, Claude Code, Cursor, Windsurf, Zed, …) search tokens, read prices, quote and build swaps across 13+ Cardano DEXes, pull trade history, and browse DeFi yield — all through the public Fetch API.
No account is required: every tool runs on the API's public tier. Add a free partner key (FETCH_API_TOKEN) for higher rate limits and rebate attribution.
Quick start
The server speaks MCP over stdio. Point your client at it with npx — no clone or global install needed:
// Claude Desktop: claude_desktop_config.json
{
"mcpServers": {
"fetchswap-cardano": {
"command": "npx",
"args": ["-y", "@fetchswap/cardano-mcp"]
}
}
}For Claude Code:
claude mcp add fetchswap-cardano -- npx -y @fetchswap/cardano-mcpTools
| Tool | What it does |
|------|--------------|
| cardano_search_tokens | Resolve a ticker/name → policyId + nameHex candidates (needed by every other tool). |
| cardano_latest_price | Current exchange rate for a token pair. |
| cardano_aggregate_quote | Preview the best swap route — output, splits, price impact, fees. Builds no transaction. |
| cardano_build_swap | Build an unsigned swap transaction (CBOR). You sign + submit with your own wallet. |
| cardano_trade_history | Recent on-chain trades for a pair. |
| cardano_yield_opportunities | Lending/borrowing yields (Liqwid, Indigo, Surf) with APY/TVL/utilization. |
Cardano assets are identified by policyId + nameHex. ADA is { "policyId": "lovelace", "nameHex": "" }. Amounts are in the smallest unit (1 ADA = 1,000,000 lovelace). Tickers are only accepted by cardano_search_tokens — different tokens can share a ticker, so resolve first and confirm before trading.
Configuration
| Variable | Default | Purpose |
|----------|---------|---------|
| FETCH_API_URL | https://cardano.fetchswap.io | Base URL of the Fetch Cardano API. Override for local/staging. |
| FETCH_API_TOKEN | (unset) | Optional partner key. Raises rate limits and attaches rebate attribution to built swaps. |
To use a partner key, add it under env:
{
"mcpServers": {
"fetchswap-cardano": {
"command": "npx",
"args": ["-y", "@fetchswap/cardano-mcp"],
"env": { "FETCH_API_TOKEN": "your-token" }
}
}
}Safety
- This server never holds private keys and never submits transactions.
cardano_build_swapreturns unsigned CBOR; signing and submission stay with the user's wallet. - It only calls the public read/quote/build endpoints — no cancel, limit, merchant, or account-management surface.
- Not financial advice. Always review the quote, amounts, and price impact before signing anything.
Build from source
git clone https://github.com/ADA-Markets/fetch-cardano-mcp.git
cd fetch-cardano-mcp
npm install
npm run build # tsc → build/
npm start # run the compiled server
npm run dev # watch-run from sourceTo point a client at a local build instead of npm:
{
"mcpServers": {
"fetchswap-cardano": {
"command": "node",
"args": ["/absolute/path/to/fetchswap-cardano-mcp/build/index.js"]
}
}
}License
MIT
