|
| 1 | +# ecb-mcp |
| 2 | + |
| 3 | +European Central Bank data for AI agents. Exchange rates, interest rates, yield curves, inflation, money supply, and 100+ more datasets from the ECB — directly inside Claude, Cursor, Windsurf, or any MCP client. |
| 4 | + |
| 5 | +No API key. No registration. No config. Just `npx ecb-mcp`. |
| 6 | + |
| 7 | +[](https://www.npmjs.com/package/ecb-mcp) |
| 8 | +[](https://opensource.org/licenses/MIT) |
| 9 | + |
| 10 | +## Why |
| 11 | + |
| 12 | +The ECB publishes 100+ statistical datasets via a free, public API — exchange rates for 40+ currencies, key interest rates, yield curves, HICP inflation, monetary aggregates, banking statistics, and much more. |
| 13 | + |
| 14 | +But the API uses SDMX, a format nobody memorizes. You need to know dataflow IDs, dimension key structures, and query syntax just to get a single number. |
| 15 | + |
| 16 | +ecb-mcp translates natural questions into the right SDMX queries. Your AI agent asks "What's the current EUR/USD rate?" and gets a clean answer from live ECB data. No SDMX knowledge required. |
| 17 | + |
| 18 | +## Quick Start |
| 19 | + |
| 20 | +Add to your MCP client config: |
| 21 | + |
| 22 | +```json |
| 23 | +{ |
| 24 | + "mcpServers": { |
| 25 | + "ecb": { |
| 26 | + "command": "npx", |
| 27 | + "args": ["-y", "ecb-mcp"] |
| 28 | + } |
| 29 | + } |
| 30 | +} |
| 31 | +``` |
| 32 | + |
| 33 | +That's it. No API key, no environment variables, no account creation. |
| 34 | + |
| 35 | +### Where to add this config |
| 36 | + |
| 37 | +- **Claude Desktop:** `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows) |
| 38 | +- **Claude Code:** `claude mcp add ecb-mcp -- npx -y ecb-mcp` |
| 39 | +- **Cursor:** Settings > MCP Servers |
| 40 | +- **Windsurf:** `~/.windsurf/config.json` |
| 41 | + |
| 42 | +## What you can ask |
| 43 | + |
| 44 | +Once installed, just ask your AI agent questions in natural language: |
| 45 | + |
| 46 | +> "What's the current EUR/USD exchange rate?" |
| 47 | +> |
| 48 | +> "Show me ECB interest rate changes since 2022" |
| 49 | +> |
| 50 | +> "What's the eurozone inflation rate?" |
| 51 | +> |
| 52 | +> "Convert 5000 USD to GBP using ECB rates" |
| 53 | +> |
| 54 | +> "What's the 10-year euro area government bond yield?" |
| 55 | +> |
| 56 | +> "How has M3 money supply grown over the past year?" |
| 57 | +> |
| 58 | +> "What ECB datasets are available about bank lending?" |
| 59 | +> |
| 60 | +> "Explain the structure of the EXR dataset" |
| 61 | +
|
| 62 | +## Tools |
| 63 | + |
| 64 | +### get_exchange_rates |
| 65 | + |
| 66 | +EUR reference rates for 40+ currencies. Daily, monthly, or annual. The same rates used by European institutions and businesses. |
| 67 | + |
| 68 | +``` |
| 69 | +"What's the EUR/USD rate?" |
| 70 | +"Show me EUR/GBP rates for the last 30 days" |
| 71 | +"EUR/JPY monthly averages for 2024" |
| 72 | +``` |
| 73 | + |
| 74 | +### get_interest_rates |
| 75 | + |
| 76 | +The ECB's key policy rates — the ones that move markets and drive eurozone monetary policy. |
| 77 | + |
| 78 | +``` |
| 79 | +"What is the current ECB deposit facility rate?" |
| 80 | +"Show me the history of ECB rate changes" |
| 81 | +"When did the ECB last change the main refinancing rate?" |
| 82 | +``` |
| 83 | + |
| 84 | +### get_yield_curve |
| 85 | + |
| 86 | +Euro area government bond yield curve. AAA-rated sovereign spot rates from 3 months to 30 years. |
| 87 | + |
| 88 | +``` |
| 89 | +"What's the 10-year euro area yield?" |
| 90 | +"Show me the 2-year yield over the past 6 months" |
| 91 | +"Compare 5Y and 10Y yields since January" |
| 92 | +``` |
| 93 | + |
| 94 | +### get_inflation |
| 95 | + |
| 96 | +HICP inflation — the official eurozone inflation measure. Available for the euro area as a whole or individual countries. |
| 97 | + |
| 98 | +``` |
| 99 | +"What's the current eurozone inflation rate?" |
| 100 | +"Germany's inflation over the past year" |
| 101 | +"Compare inflation in France vs Spain" |
| 102 | +``` |
| 103 | + |
| 104 | +### get_money_supply |
| 105 | + |
| 106 | +Euro area monetary aggregates (M1, M2, M3). Outstanding amounts or annual growth rates. |
| 107 | + |
| 108 | +``` |
| 109 | +"What's the current M3 money supply?" |
| 110 | +"M1 growth rate over the past year" |
| 111 | +"How has M3 evolved since 2020?" |
| 112 | +``` |
| 113 | + |
| 114 | +### convert_currency |
| 115 | + |
| 116 | +Convert any amount between currencies using official ECB reference rates. Supports EUR-direct, inverse, and cross-currency conversions (e.g., USD to GBP via EUR triangulation). |
| 117 | + |
| 118 | +``` |
| 119 | +"Convert 1000 EUR to USD" |
| 120 | +"How much is 500 GBP in JPY?" |
| 121 | +"What was 10000 USD worth in CHF on 2025-01-15?" |
| 122 | +``` |
| 123 | + |
| 124 | +### search_datasets |
| 125 | + |
| 126 | +Search across all 100+ ECB statistical datasets by keyword. The ECB publishes far more than exchange rates — banking statistics, balance of payments, government debt, payment systems, insurance data, and much more. |
| 127 | + |
| 128 | +``` |
| 129 | +"What ECB datasets are about bank lending?" |
| 130 | +"Find datasets related to government debt" |
| 131 | +"What data does the ECB publish about payments?" |
| 132 | +``` |
| 133 | + |
| 134 | +### explain_dataset |
| 135 | + |
| 136 | +Understand any ECB dataset's structure — its dimensions, valid values, and how to query it. This is the key to unlocking the full 100+ datasets beyond the built-in tools. |
| 137 | + |
| 138 | +``` |
| 139 | +"Explain the EXR dataset structure" |
| 140 | +"What dimensions does the BSI dataset have?" |
| 141 | +"What are the valid currency codes?" |
| 142 | +``` |
| 143 | + |
| 144 | +## Data Source |
| 145 | + |
| 146 | +All data comes directly from the [ECB Data Portal API](https://data.ecb.europa.eu/help/api/overview) (SDMX 2.1 REST). |
| 147 | + |
| 148 | +- No intermediary, no proxy — live data from the European Central Bank |
| 149 | +- No authentication or API key required |
| 150 | +- Exchange rates updated daily at 16:00 CET |
| 151 | +- Other datasets updated at various frequencies (monthly, quarterly) |
| 152 | + |
| 153 | +## Configuration |
| 154 | + |
| 155 | +ecb-mcp works with zero configuration. Optional settings: |
| 156 | + |
| 157 | +| Environment Variable | Default | Description | |
| 158 | +|---|---|---| |
| 159 | +| `ECB_API_URL` | `https://data-api.ecb.europa.eu/service` | API base URL. Only change this if you're proxying the ECB API. | |
| 160 | +| `DEBUG` | — | Set to any value to enable debug logging to stderr. | |
| 161 | + |
| 162 | +## Development |
| 163 | + |
| 164 | +```bash |
| 165 | +git clone https://github.com/scka-de/ecb-mcp.git |
| 166 | +cd ecb-mcp |
| 167 | +npm install |
| 168 | +npm test # unit tests (fixtures, no API calls) |
| 169 | +INTEGRATION=true npm test # integration tests (live ECB API) |
| 170 | +npm run build # compile to dist/ |
| 171 | +npm run dev # run in dev mode |
| 172 | +npm run lint # check code style |
| 173 | +``` |
| 174 | + |
| 175 | +## How It Works |
| 176 | + |
| 177 | +ecb-mcp translates your AI agent's natural language questions into SDMX series key queries against the ECB API. For example, when Claude asks for the EUR/USD rate, ecb-mcp: |
| 178 | + |
| 179 | +1. Builds the SDMX key: `D.USD.EUR.SP00.A` |
| 180 | +2. Fetches CSV from `https://data-api.ecb.europa.eu/service/data/EXR/D.USD.EUR.SP00.A?format=csvdata` |
| 181 | +3. Parses the response and returns clean, human-readable data |
| 182 | + |
| 183 | +For dataset discovery, ecb-mcp fetches and parses XML metadata from the ECB's structure definition endpoints, letting your agent explore all 100+ datasets without knowing SDMX. |
| 184 | + |
| 185 | +## License |
| 186 | + |
| 187 | +MIT |
0 commit comments