@cyanheads/exchange-rates-mcp-server
Enables SQL analytics over long exchange rate time-series by staging historical FX data into DuckDB-backed DataCanvas tables, supporting read-only queries, aggregations, joins, and window functions.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
Public Hosted Server: https://exchange-rates.caseyjhand.com/mcp
Overview
Daily exchange rates from Frankfurter v1, with current currency discovery and historical coverage from 1999-01-04. Convert amounts, pull point-in-time or historical rates, summarize a full date range, and run SQL over staged series. Historical availability includes retired currencies and is checked against the requested data. Responses identify source: "Frankfurter v1" and rate_type: "Daily rate (Frankfurter v1)"; the v1 payload does not identify individual providers. No API key required.
Tools
Tool | Description |
| Current currency discovery with full names and the latest served rate date |
| Snapshot of all rates for a base currency at latest or a historical date |
| Exchange rate for a single currency pair at latest or a historical date |
| Convert an amount between two currencies at latest or a historical rate |
| Historical daily rates for a currency pair over a date range |
| List DataCanvas tables and columns staged by a prior |
| Run a read-only SQL SELECT against a staged DataCanvas table |
| Remove one staged DataCanvas table or view (opt-in, destructive) |
DataCanvas (DuckDB) is on by default. Set CANVAS_PROVIDER_TYPE=none to turn it off: the three fx_dataframe_* tools then drop out of tools/list, and fx_get_timeseries returns ranges inline when canvas_id is omitted; explicit staging fails canvas_unavailable. The Claude Desktop bundle (.mcpb) ships without DuckDB's native binding, so it runs with DataCanvas off. fx_dataframe_drop additionally needs FX_ENABLE_CANVAS_DROP=true.
The four rate and conversion tools accept base as an alias of base_currency; pair tools also accept quote for quote_currency. Send either spelling for a field, never both. Advertised schemas use the canonical names.
Currency values, including symbols, are trimmed and uppercased. Point dates accept YYYY-MM-DD or literal latest (also the default); range dates require YYYY-MM-DD. Advertised date patterns preserve handler-level invalid_date_format errors for malformed, blank or impossible calendar dates. Future range errors recommend an end_date today or earlier; end_date remains required.
Resources
Resource | Description |
| All supported currencies as a stable reference document |
| Latest rates snapshot for a base currency as a stable URI |
All resource data is also reachable via tools — use fx_list_currencies or fx_get_rates for programmatic access.
Skill
exchange-rates-guide covers historical currency coverage, observed-day summaries, paging and SQL comparisons. It ships with npm, Docker and MCPB installs and is available over MCP at skill://exchange-rates-guide/SKILL.md.
Cancelling a tool call or resource read stops its upstream fetch, response-body read, and retry backoff. V1 requests retain two retries and a 10-second timeout per attempt within a 12-second total budget per read. Optional coverage metadata gets one 1-second request without retries.
Related MCP server: frankfurter-mcp
Capability reference
fx_list_currencies tool
Optional
include_retired(defaultfalse) adds historical codes absent from current v1 discoveryReturns
currencies: [{ code, name, start_date?, end_date? }],count,sourceandas_of(the latest served daily rate date), sorted alphabetically by code. Coverage dates come from optional official ECB metadata and describe outer bounds, not uninterrupted availability. A datedend_datedoes not itself imply retirement.Metadata is cached for a day and queried only for the default official v1 base. Unavailable metadata leaves current discovery intact with a notice; valid v1 rate requests never depend on metadata.
Default discovery lists current currencies;
include_retired: trueadds historical codes when metadata is available. Historical requests validate against their unfiltered EUR snapshot or raw served range, so retired codes remain usable on dates where they have observations. Unknown codes failunsupported_currencywith sorted accepted/rejected codes and the input field; current currencies without historical observations failupstream_no_data.
fx_get_rates tool
base_currencyrequired;dateoptional (default latest, history from 1999-01-04, no future dates); optionalsymbolsarray narrows the response and must name at least one codeReturns a
ratesmap (quote code → rate), the actualrate_date, anddate_snapped: truewhen a weekend/holiday request snapped to the prior business dayNaming the base currency in
symbolsis valid — answered locally with a rate of 1 rather than sent upstreamMissing observations from a served snapshot identify the offending
fieldand sorted, deduplicatedmissing_codes; unknown currencies retainunsupported_currencyprecedence. A response without any snapshot remains an unattributedupstream_no_datafailure.Typed failures:
invalid_date_format,unsupported_currency,date_out_of_range,upstream_no_data
fx_get_rate tool
base_currency,quote_currencyrequired;dateoptional (default latest, history from 1999-01-04, no future dates)Returns
rate,rate_date, anddate_snapped: truewhen a weekend/holiday request snapped to the prior business dayEvery pair uses quote EUR leg / base EUR leg from one unfiltered EUR snapshot without intermediate rounding; EUR's leg is 1. Same-currency pairs return 1 only on actual observation dates.
Typed failures:
invalid_date_format,unsupported_currency,date_out_of_range,upstream_no_data
fx_convert_currency tool
base_currency,quote_currency,amount(must be > 0) required;dateoptional (default latest, history from 1999-01-04, no future dates)Handles EUR↔any, any↔EUR, and cross-rate pairs (e.g. USD→JPY) in a single upstream call
Returns
quote_amountas the unrounded JavaScript-numberamount * rateproduct,rate,rate_date,date_snapped, plusrate_typeandsourceprovenance. No currency minor-unit rounding policy is applied; formatted rates use quote currency per base currency.Typed failures:
invalid_date_format,unsupported_currency,date_out_of_range,upstream_no_data
fx_get_timeseries tool
base_currency,quote_currency,start_date,end_daterequired (history from 1999-01-04, no future dates, start ≤ end); optionalcanvas_idappends to an existing canvasOptional integer
limit(default 500, minimum 0) bounds returned observations, clamping values above 500 with a notice.limit: 0returns summary and metadata with emptyrates; a nonempty inline result then pointsnext_start_dateat the first observation. Repeat with a positive limit to advance. Counts, summary, bounds, staging eligibility and complete staged tables are independent of the limit.Inline results page at up to 500 observed publication days —
rate_countis always the range total;truncated: trueplusnext_start_datecontinue the pageRanges over
FX_TIMESERIES_CANVAS_THRESHOLD_DAYS(default 90 days) are considered for DataCanvas staging. Series over the 40,000-character preview budget returnspilled: true,canvas_id, andtable_name; smaller series and deployments withCANVAS_PROVIDER_TYPE=nonepage inlineA same-currency pair returns 1 on actual observation dates. Every non-identity row requires both EUR legs on that same date; missing legs never fabricate observations. Membership uses all raw served dates before inclusive clipping, preserving weekend-only empty windows.
Missing either leg on a served in-window day produces a notice with the affected day count and first/last dates. Each day counts once, even if both legs are absent; weekends, holidays and clipped prior dates do not count. Statistics cover observed days only. Coverage and delivery notices coexist;
truncateddescribes omitted observations in delivery, not missing upstream coverage.An empty range (only weekends/holidays) returns
rate_count: 0with an explanatorynotice, distinguishable from an errorLong ranges that fit the inline preview release their newly acquired canvas; failed or cancelled staging does too. A supplied canvas remains available.
An explicit
canvas_idalways stages the complete result, including short and empty ranges, usingrate DOUBLE. Each table name has a fresh identifier suffix; repeated and concurrent calls preserve all earlier tables. Unknown IDs failcanvas_not_found; disabled DataCanvas failscanvas_unavailable.truncatedis false when the preview includes every observation.Nonempty results include
summary: { mean, min: { rate, date }, max: { rate, date }, first: { rate, date }, last: { rate, date }, change_pct }. It covers all observations in the requested interval before paging or staging; a continuation summarizes its shorter requested interval. Tied extrema select the earliest date; singleton and identity movement is 0. Empty series omit summary. Mean is the unweighted arithmetic average of daily observations, not a tax-authority or accounting-policy prescription.
fx_dataframe_describe tool
canvas_idrequired (from a priorfx_get_timeseriescall)Returns each staged table's
kind,row_count, and column schema (name,type,nullable), plusexpires_atRequired first step before
fx_dataframe_query; unregistered whenCANVAS_PROVIDER_TYPE=nonecanvas_not_foundwhen the ID doesn't exist or has expired
fx_dataframe_query tool
canvas_idand a read-only SQLqueryrequired;row_limitis a positive integer (default 150). Values above 10,000 clamp to 10,000 with requested/effective values in a notice; clamping and truncation notices coexist and paging guidance uses the effective limit.Supports aggregations, GROUP BY, window functions, and JOINs across tables from multiple
fx_get_timeseriescallsReturns at most
row_limitrows;truncated: trueplus anoticegive theORDER BY <column> LIMIT <n> OFFSET <m>shape for the next page — ORDER BY is required for stable pagingMarkdown table cells are escaped so pipes, angle brackets, and line breaks stay inside their cell;
structuredContentkeeps raw valuesUnregistered when
CANVAS_PROVIDER_TYPE=none; typed failures:canvas_not_found,missing_table,invalid_query
fx_dataframe_drop tool
canvas_idand exacttable_name(fromfx_dataframe_describe) requiredRemoves one staged table or view; upstream rate data is untouched and the series can be re-staged via
fx_get_timeseriesReturns
dropped: true/falsedepending on whether the table existedDisabled unless
FX_ENABLE_CANVAS_DROP=true— otherwise absent fromtools/list, named with its enable hint only in the startup log and the HTTP landing page; also unregistered whenCANVAS_PROVIDER_TYPE=none
fx://currencies resource
No parameters; returns current discovery with optional coverage dates,
count,source,as_ofand any metadata-unavailability notice asapplication/json. Usefx_list_currencieswithinclude_retired: truefor historical discovery.Listed as a single static resource
fx://rates/latest/{base} resource
baseis an ISO 4217 currency code in the URIReturns
base_currency,rate_date, aratesmap,rate_type, andsourcefor the latest served daily snapshotListed with four sample URIs (EUR, USD, GBP, JPY) as discovery hints
Features
Built on @cyanheads/mcp-ts-core: stdio and Streamable HTTP transports, pluggable auth (none / jwt / oauth), swappable storage (in-memory, filesystem, Supabase, Cloudflare KV/R2/D1), structured logging with optional OpenTelemetry tracing.
Rate data:
Keyless daily data via Frankfurter v1
Local cross-rate calculation from one unfiltered EUR data request per snapshot or range; the same response supplies historical membership
Weekend/holiday date semantics:
date_snappedsurfaces when the API returns a different date than requestedIdentity rates are computed locally as 1 on the currency's observed publication dates
Long time-series that exceed the inline preview budget stage on DataCanvas (DuckDB, on by default) for SQL aggregation over the full range
Agent-friendly output:
Rate provenance on every response —
rate_type,source,rate_date, anddate_snappedso agents can reason about trust and freshnessStructured error contracts — typed
reasonfields (unsupported_currency,date_out_of_range,invalid_query, …) let callers branch on failure type, not string parsingBounded responses — inline time-series pages continue from
next_start_date, and SQL results cap atrow_limit, so no call returns an unbounded payloadSuccess-path
noticeenrichment — explains an empty series, where to continue a paged series, or which tools read a staged one, so a legitimate zero-result never reads as a failure
Getting started
Public Hosted Instance
A public instance is available at https://exchange-rates.caseyjhand.com/mcp — no installation required. Point any MCP client at it via Streamable HTTP:
{
"mcpServers": {
"exchange-rates-mcp-server": {
"type": "streamable-http",
"url": "https://exchange-rates.caseyjhand.com/mcp"
}
}
}Self-Hosted / Local
No API key required — Frankfurter is keyless. Add the following to your MCP client configuration file:
{
"mcpServers": {
"exchange-rates-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/exchange-rates-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with npx (no Bun required):
{
"mcpServers": {
"exchange-rates-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/exchange-rates-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info"
}
}
}
}Or with Docker:
{
"mcpServers": {
"exchange-rates-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"ghcr.io/cyanheads/exchange-rates-mcp-server:latest"
]
}
}
}DataCanvas (DuckDB) is on by default for long time-series SQL analytics. To turn it off, add CANVAS_PROVIDER_TYPE=none: the dataframe tools drop out of tools/list, and fx_get_timeseries pages inline when canvas_id is omitted. Explicit staging fails canvas_unavailable.
{
"mcpServers": {
"exchange-rates-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/exchange-rates-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"CANVAS_PROVIDER_TYPE": "none"
}
}
}
}For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 bun run start:http
# Server listens at http://localhost:3010/mcpPrerequisites
Bun v1.4.0 or higher (or Node.js v24+).
No API key — Frankfurter is free and keyless.
Installation
Clone the repository:
git clone https://github.com/cyanheads/exchange-rates-mcp-server.gitNavigate into the directory:
cd exchange-rates-mcp-serverInstall dependencies:
bun installConfigure environment:
cp .env.example .env
# edit .env as needed (all vars are optional — no keys required)Configuration
All configuration is validated at startup via Zod schemas. Environment variables:
Variable | Description | Default |
| Frankfurter API base URL. Override for local testing or a self-hosted instance. |
|
| Day range above which |
|
| Enable the destructive |
|
| Canvas engine. |
|
| Transport: |
|
| Port for HTTP server. |
|
| HTTP session mode: |
|
| Auth mode: |
|
| Opt-in key (≥ 32 bytes, the same on every instance) that seals the | — |
| Log level (RFC 5424: |
|
| Log each failed tool call's arguments and result (redacted by key name only). |
|
| Per-payload cap for |
|
| Enable OpenTelemetry instrumentation. |
|
| OTLP base URL; traces go to | — |
| Opt-in OTLP log export (e.g. | — |
See .env.example for the full list of optional overrides including storage, session, and telemetry vars.
Running the server
Local development
Build and run:
bun run rebuild bun run start:stdio # or bun run start:httpRun checks and tests:
bun run devcheck # Lint, format, typecheck, security, changelog sync bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t exchange-rates-mcp-server .
docker run --rm -p 3010:3010 exchange-rates-mcp-serverThe Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/exchange-rates-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them. Production dependencies, DuckDB's native binding included, are cross-installed for the target platform in a separate deps stage, so multi-arch builds never run Bun under emulation and the runtime image carries node_modules/, dist/ and the published skills/ tree.
Project structure
Directory | Purpose |
|
|
| Server-specific environment variable parsing and validation with Zod. |
| Tool definitions ( |
| Resource definitions — |
| Frankfurter HTTP client, retry logic, and domain types. |
| Module-level DataCanvas accessor for |
| Output helpers — Markdown table-cell escaping for |
| Unit and integration tests mirroring |
| Published agent guidance for historical FX analysis. |
| Design document and idea notes. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
Handlers throw, framework catches — no
try/catchin tool logicUse
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storageRegister new tools and resources via the barrels in
src/mcp-server/*/definitions/index.tsWrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
Preserve the
rate_type: "Daily rate (Frankfurter v1)"andsource: "Frankfurter v1"provenance in every response
Contributing
Issues are welcome. Run checks and tests before submitting:
bun run devcheck
bun run testLicense
Apache-2.0 — see LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
Exchange MCP — wraps the Frankfurter currency exchange API (free, no auth)
Frankfurter MCP — wraps Frankfurter API (api.frankfurter.dev)
ExchangeRate MCP — wraps open.er-api.com (free, no auth)
Convert currencies on the daily European Central Bank reference rates. No API key, no signup.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceMCP server that provides real exchange-rate data from the European Central Bank, including latest rates, currency conversion, historical rates, and time series.-
- AlicenseNot gradedqualityBmaintenanceMCP server for the Frankfurter exchange-rate API, enabling currency conversion and rate queries.42 npm5MIT
- FlicenseNot gradedqualityCmaintenanceEnables MCP clients to convert amounts between currencies using live ECB daily reference rates and to validate IBAN structure and checksum.-
- AlicenseAqualityCmaintenanceEnables MCP clients to access exchange rates for 160+ currencies, currency conversion, historical rates, time series, crypto, metal and stock prices, usage checks, and rate alerts.17169 npmMIT