Give your LLM agent live FX rates over MCP
exchangerate.dev runs a Model Context Protocol server so an LLM agent can request currency rates as structured tool calls, without writing a line of REST client code.
Connect your agent to https://api.exchangerate.dev/v1/mcp and it gains five tools: discover supported currencies, fetch the latest rate for a pair, convert an amount, pull a historical series, or search the docs for canonical answers. The server counts each tool call against the same per-minute rate limit and monthly quota as your REST key, so plan capacity the same way you would for any API integration.
https://api.exchangerate.dev/v1/mcp, server name exchangerate-dev.list_currencies, get_rate, convert, and get_range cover the FX use cases, and search_docs answers questions about the API itself.What MCP gives an LLM agent
The Model Context Protocol lets an LLM call external tools during inference without manual HTTP wiring. Rather than asking a developer to build a REST client, the agent discovers the tool list from the server and invokes tools by name. exchangerate.dev exposes its rate data this way: the server at /v1/mcp describes five tools, the agent picks the right one for the task, and the result comes back as structured JSON that feeds straight into the next reasoning step.
This is useful when the agent needs rates dynamically. A user might ask "how much is 500 USD in JPY right now?"; the agent calls convert and answers from the response, with no hard-coded rate in the prompt.
The five tools and when to use each
Each tool maps to a specific REST endpoint on the API. The agent chooses between them based on what the task requires.
A typical agent workflow runs list_currencies once at setup or when the user names an unfamiliar code. After that it calls get_rate or convert per user query, get_range when a trend, comparison, or historical context is needed, and search_docs when the user asks how the API itself works — pricing, freshness, or where the data comes from.
Combine FX with live metals data
When an agent needs both raw FX and live metals, connect the goldprice.dev MCP server alongside exchangerate.dev. Keep the tools separate: use goldprice.dev for metal prices and exchangerate.dev for currency rates, then preserve the underlying observation and source fields from both responses in the final answer.
Configuring an MCP client
Most MCP clients accept a JSON config block. The dedicated MCP quickstart has copy-paste setup for Claude Code, Claude Desktop, and Cursor. Point the client at the server URL and pass your API key in the Authorization header:
Replace exr_live_... with your key from the dashboard. The server name exchangerate-dev is what surfaces in the agent's tool list. Some clients (Claude for Desktop, Cursor) support an npm package for local (stdio) connections instead of the HTTP URL; the five tools and their behaviour are identical either way.
Authorization header still works for a quick test; anonymous calls are capped per IP address. Add a key at https://exchangerate.dev/signup to raise the limit to 10,000 calls a month and for production use.Quota and rate limits
Every tool call counts as one API call against your key. The free tier allows 10,000 calls per month at 12 requests per minute. An agent that calls get_rate on every user message in a busy chat interface can exhaust the per-minute limit quickly. Design the agent to batch or cache where the task allows.
get_range is efficient for historical work: one call returns a full date series for multiple symbols rather than one call per day. If an agent needs rates for the past two weeks across three pairs, a single get_range call covers it.
Reading freshness from tool responses
Each tool response includes source and market_session. source tells the agent where the rate came from: live for aggregated spot (updated ~60s through the trading week), ecb_daily for the European Central Bank reference fix, or fred_daily for the Federal Reserve daily series. market_session is open, weekend, or interbank_closed for a known non-weekend closure.
These fields let the agent give honest context to the user. Rather than stating a number without qualification, the agent can note that the rate is from the ECB daily fix or that the market is currently closed. The notice field on every response carries the indicative disclaimer the agent should surface when presenting rates to end users.
Indicative rates only
notice field.This applies to the agent's output too. If users ask "should I exchange my money now?" or for a forecast, the agent should decline rather than extrapolate from the rate data. The tools provide the current or historical number; any forward-looking interpretation is out of scope.