Skip to main content
Glama
frankfurter-mcp

frankfurter-mcp

README.md
# frankfurter-mcp

![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)
![Node 22](https://img.shields.io/badge/node-22+-green.svg)
![Cloudflare Workers](https://img.shields.io/badge/deploy-Cloudflare%20Workers-orange.svg)

Currency conversion and exchange-rate history for Claude, Cursor and ChatGPT.

## Data source and disclaimer

This MCP server reads **reference exchange rates** from the public [Frankfurter](https://frankfurter.dev) API (`https://api.frankfurter.dev/v2`). Rates are published by central banks and other official sources; they are suitable for billing, invoicing, and reporting context—not live trading or transaction execution.

- **Unofficial** third-party integration; not affiliated with Frankfurter or the European Central Bank (ECB).
- Where upstream data includes ECB statistics, attribution follows provider terms: *Source: ECB statistics.*
- Provider figures are not modified except for documented conversion arithmetic on the `convert_amount` tool.
- This repository does **not** include Claude, ChatGPT, or other directory submission assets (third-party API).

## Quickstart

Remote URL (placeholder until you deploy):

```json
{
  "mcpServers": {
    "frankfurter": {
      "url": "https://YOUR_SUBDOMAIN.workers.dev/mcp"
    }
  }
}
```

Local development (no deploy):

```bash
npm ci
npm run dev
# MCP endpoint: http://localhost:8787/mcp
```

## Tools

All tools are read-only (`readOnlyHint: true`). Only **fiat** ISO 4217 codes from Frankfurter’s `type: currency` list are accepted.

| Tool | Title | Purpose |
|------|-------|---------|
| `get_latest_rates` | Get latest exchange rates | Latest reference rates for a base and optional quotes |
| `convert_amount` | Convert an amount between currencies | Amount conversion with documented rounding |
| `get_historical_rates` | Get rates on a past date | Snapshot rates for a calendar date |
| `get_rate_time_series` | Get a rate time series | Up to 366 days, optional week/month grouping |
| `list_currencies` | List supported currencies | Discover valid fiat codes |

**Example prompts**

1. “Using frankfurter-mcp, what is the latest EUR to USD reference rate and which providers contributed?”
2. “Convert 12,500 USD to GBP as of 2024-06-30 with reference-rate attribution.”
3. “List currencies matching ‘franc’ and show weekly EUR/CHF rates from 2026-01-01 to 2026-03-31.”

## Design notes

- **Rounding:** `convert_amount` uses round half-even (bankers rounding) to 4 decimal places.
- **Caching (Workers Cache API):** 10 minutes for latest rates; 24 hours for historical dates and the fiat currency list.
- **Validation:** `^[A-Z]{3}$` codes; non-fiat assets are rejected with a neutral message pointing to `list_currencies`.
- **Attribution:** Successful tool payloads include `source`, `as_of`, and a fixed `notes` reference-rate disclaimer.
- **Rate limiting:** 60 requests/minute per client IP by default (`RATE_LIMIT_PER_MINUTE` in `wrangler.jsonc`).

## Pre-flight results

Run directory pre-flight checks (Streamable HTTP, tool metadata, injection scan):

```bash
npm run dev   # in another terminal, or use in-process tests
node scripts/preflight.mjs http://localhost:8787/mcp
```

`npm test` also runs pre-flight against the Worker `fetch` handler in-process (no network, `--auth none`).

## Deploy to your own Cloudflare account

1. Install dependencies: `npm ci`
2. Add your account id and route in a **local** `wrangler.jsonc` override (not committed).
3. `npx wrangler deploy` from your machine when ready.
4. `server.json` / `glama.json` are prepared for registry and Glama claim flows but are **not published** from this repository.

## Registry

Prepared name: `io.github.konstantinbozukov/frankfurter-mcp` in `server.json` (unpublished).

## Development

```bash
npm run typecheck
npm test
LIVE=1 npm run test:live   # optional network smoke (not in CI)
```

## Need a server like this for your API?

mcp.edge.report

---

Built with AI assistance and human review. Part of the mcp.edge.report showcase. MIT licensed.