Labsco
UniRate-API logo

UniRate MCP

from UniRate-API

Currency conversion and exchange rates for AI assistants. 170+ currencies, historical data back to 1999, free tier, MIT-licensed.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedPaid serviceAdvanced setup

UniRate MCP Server

A Model Context Protocol server for the UniRate API β€” give Claude, Cursor, Continue, and any MCP-compatible AI assistant first-class access to currency conversion and exchange rates.

  • πŸ”„ Real-time conversion between 170+ currencies (fiat + major crypto)
  • πŸ“ˆ Historical rates back to 1999 (Pro plan)
  • πŸ†“ Free tier, no credit card required β€” get a key at unirateapi.com
  • 🧩 Four tools, fully-typed inputs (Zod schemas), structured outputs
  • 🌐 Stdio + Streamable HTTP/SSE transports β€” run locally or host as a remote MCP endpoint
  • ⚑ Pure Node 18+, single dependency on @modelcontextprotocol/sdk

Why this exists

Most "currency for AI" workflows today involve hand-rolled fetch wrappers in custom tools, or generic HTTP MCP servers that hand the model raw JSON. This server gives models a tight, typed, currency-aware tool surface β€” they ask "what was 100 USD in EUR on 2020-03-15?" and get back a formatted answer plus a structured payload they can chain into other tool calls.

Tools

convert

Convert an amount from one currency to another at the latest rate.

ParamTypeRequiredNotes
fromstringyesISO 4217 code (e.g. USD)
tostringyesISO 4217 code (e.g. EUR)
amountnumberyesPositive amount in from

Example call:

{ "name": "convert", "arguments": { "from": "USD", "to": "EUR", "amount": 100 } }

Response: human-readable text plus structured { from, to, amount, result }.

latest_rate

Get current exchange rate(s).

ParamTypeRequiredNotes
fromstringyesBase currency
tostringnoTarget. Omit to get rates for all currencies

historical_rate (Pro plan)

Get the exchange rate that was in effect on a specific date. Coverage back to 1999-01-04 for major fiat pairs.

ParamTypeRequiredNotes
datestringyesYYYY-MM-DD (e.g. 2020-03-15)
fromstringyesSource currency
tostringyesTarget currency
amountnumbernoDefaults to 1

Free-tier keys receive a clear error pointing to unirateapi.com for upgrade.

list_currencies

Returns the array of supported currency codes (170+) with no parameters. Useful for autocomplete or validating user-supplied codes.

Errors

All UniRate API failures are mapped to friendly tool errors:

HTTPError classWhat the model sees
400InvalidRequestError"Invalid request parameters"
401AuthenticationError"Missing or invalid API key"
403ProPlanRequiredError"…requires Pro… upgrade at https://unirateapi.com"
404InvalidCurrencyError"Currency not found or no data available"
429RateLimitError"Rate limit exceeded"
503APIError"Service unavailable"

Network/timeout errors are wrapped in UnirateError. Tool calls always return a response object with isError: true rather than throwing protocol-level errors, so the model can recover gracefully.

Development

npm install
npm run build       # compile TypeScript to dist/
npm test            # 24 mock tests
UNIRATE_LIVE=1 UNIRATE_API_KEY=... npm run test:live  # +4 live free-tier tests

Other UniRate clients

UniRate ships official client libraries and framework integrations across the ecosystem. The repos below are all maintained under the UniRate-API org.

Get a free API key at unirateapi.com.