CBR Currency Rate
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CBR Currency Rate what is the official USD to RUB rate today?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
# CBR Currency Rate — MCP server
Ask your AI assistant "what is the official dollar rate today, and what was it a month ago?" and get the numbers the Central Bank actually published — not a plausible figure from training data.
This server wraps the public Bank of Russia (CBR) XML feeds — no key, no account, no registration — and exposes them as five read-only MCP tools: look up one rate, convert amounts, read the whole daily table, pull a history series, and search the currency directory.
Languages: English · Español · Русский
Why this exists
Exchange rates are exactly the kind of fact a language model will invent confidently. Worse, the numbers it invents look right: a dollar rate of 82 roubles is believable in a way that 8 200 is not.
This server answers from the official feed, and it is explicit about the cases that are easy to get wrong:
The rouble is the base, not a row. The CBR quotes everything against the rouble, so
RUBnever appears in the feed. It is accepted everywhere and always equals1.0.Nominals are not always 1. The yen is quoted per 100, the dong per 10 000. Reporting "55.12 roubles" for the yen instead of "0.55 roubles per yen" is the classic error; every row here carries both the quoted value and the per-unit rate.
A non-publication day is not a zero. The CBR publishes on business days only. Asking for a day it did not publish returns the rates of the most recent day it did, and the response says so with
date_adjusted: trueand amessageinstead of pretending that day had rates of its own.The rouble has no history series. Asking for
RUBhistory returnserror: "base_currency"with an explanation, not an empty list.
Related MCP server: UZCBU MCP Server
Tools
get_currency_rate
Argument | Type | Default | Description |
| string | — | ISO code: |
| string | latest |
|
{
"currency": "USD",
"name": "US Dollar",
"name_en": "US Dollar",
"name_ru": "Доллар США",
"numeric_code": "840",
"nominal": 1,
"quoted_value_rub": 82.313,
"rub_per_unit": 82.313,
"units_per_rub": 0.01214875,
"date": "2026-11-26",
"requested_date": "2026-11-26",
"date_adjusted": false,
"base_currency": "RUB",
"source": "Bank of Russia",
"source_url": "https://www.cbr.ru/currency_base/daily/"
}quoted_value_rub is what the CBR printed — roubles per nominal units.
rub_per_unit is that value divided by the nominal, which is the number you can
do arithmetic with. For the yen:
{ "currency": "JPY", "nominal": 100, "quoted_value_rub": 55.1234, "rub_per_unit": 0.551234 }convert_currency
Argument | Type | Default | Description |
| number | — | How much to convert |
| string | — | Source ISO code |
| string | — | Target ISO code |
| string | latest | Date of the rates used |
{
"amount": 1000,
"from_currency": "USD",
"to_currency": "EUR",
"result": 865.36,
"rate": 0.86536,
"from": { "currency": "USD", "name": "US Dollar", "nominal": 1, "quoted_value_rub": 82.313, "rub_per_unit": 82.313 },
"to": { "currency": "EUR", "name": "Euro", "nominal": 1, "quoted_value_rub": 95.1234, "rub_per_unit": 95.1234 },
"date": "2026-11-26",
"requested_date": "2026-11-26",
"date_adjusted": false,
"base_currency": "RUB",
"source": "Bank of Russia"
}Both legs are crossed through the rouble, so any two quoted currencies can be
converted — not just pairs involving RUB.
list_currency_rates
Argument | Type | Default | Description |
| array of string | all | Narrow to specific codes, e.g. |
| string | latest | Date of the table |
{
"count": 2,
"total": 54,
"rates": [
{ "currency": "EUR", "name": "Euro", "numeric_code": "978", "nominal": 1, "quoted_value_rub": 95.1234, "rub_per_unit": 95.1234 },
{ "currency": "USD", "name": "US Dollar", "numeric_code": "840", "nominal": 1, "quoted_value_rub": 82.313, "rub_per_unit": 82.313 }
],
"date": "2026-11-26",
"requested_date": "2026-11-26",
"date_adjusted": false,
"base_currency": "RUB",
"source": "Bank of Russia"
}Codes that were asked for but are not quoted come back in missing, so a typo
in a filter never silently returns a shorter list.
get_rate_history
Argument | Type | Default | Description |
| string | — | ISO code |
| string |
| First day, inclusive |
| string | today (Moscow) | Last day, inclusive |
{
"currency": "USD",
"name": "US Dollar",
"start_date": "2026-11-01",
"end_date": "2026-11-26",
"count": 18,
"points": [
{ "date": "2026-11-03", "nominal": 1, "quoted_value_rub": 82.0, "rub_per_unit": 82.0 },
{ "date": "2026-11-05", "nominal": 1, "quoted_value_rub": 83.0, "rub_per_unit": 83.0 }
],
"first": 82.0,
"last": 83.0,
"min_rub_per_unit": 82.0,
"max_rub_per_unit": 83.0,
"change": 1.0,
"change_percent": 1.2195,
"base_currency": "RUB",
"source": "Bank of Russia"
}Only published days appear, so weekends and holidays are gaps, not repeats —
count is the number of business days, not the calendar length. Ranges are
capped at 366 days per request; error: "range_too_long" says by how much.
search_currencies
Argument | Type | Default | Description |
| string |
| Text matched against ISO code, numeric code, English name and Russian name |
| integer |
| 1–100 |
{
"query": "yuan",
"count": 1,
"matches": 1,
"scanned": 79,
"results": [
{ "currency": "CNY", "name_en": "Chinese yuan", "name_ru": "Китайский юань", "numeric_code": "156", "nominal": 1, "quoted": true }
],
"source": "Bank of Russia"
}quoted separates the roughly 79 currencies in the directory from the ~54 that actually
have a daily rate, so the model never suggests a code that the other tools would
then reject. An empty query lists the directory in code order.
Quick start
Try these in order — they cover every tool:
search_currencieswithquery: "yuan"→ learn that the code isCNY.get_currency_ratewithcurrency: "CNY"→ the official rate today.convert_currencywithamount: 5000,from_currency: "CNY",to_currency: "RUB".get_rate_historywithcurrency: "USD"→ the last 30 published days.list_currency_rateswithcurrency_codes: ["USD", "EUR"]→ both at once.
Install
pip install git+https://github.com/tordagaz-ops/cbr-currency-rateor from a clone:
git clone https://github.com/tordagaz-ops/cbr-currency-rate
cd cbr-currency-rate
pip install .Connect it
Claude Desktop / Claude Code
{
"mcpServers": {
"cbr-currency-rate": {
"command": "python",
"args": ["-m", "mcp_cbr_rate"],
"env": { "MCP_LOCALE": "en" }
}
}
}Smithery
The repository ships a smithery.yaml, so Smithery can build and host it
directly — pick the language in the configuration form.
HTTP transport
MCP_TRANSPORT=http MCP_HOST=0.0.0.0 MCP_PORT=8000 python -m mcp_cbr_rate
# endpoint: http://localhost:8000/mcpDocker
docker build -t cbr-currency-rate .
docker run -i --rm cbr-currency-rateExample conversation
You: What's the official dollar rate today?
Assistant: (calls
get_currency_ratewithcurrency: "USD") 82.3130 roubles per dollar, per the Bank of Russia for 26 November 2026.
You: And the yen?
Assistant: (calls
get_currency_ratewithcurrency: "JPY") 0.551234 roubles per yen — the CBR quotes it per 100 yen at 55.1234.
You: Convert 5 000 yuan to roubles.
Assistant: (calls
convert_currency) 5 000 CNY is 57 061.50 roubles at today's official rates.
You: How has the euro moved this month?
Assistant: (calls
get_rate_historywithcurrency: "EUR") Eighteen published days, from 95.12 to 96.40 — up 1.34 % over the period.
You: What's the rate for Sunday?
Assistant: (calls
get_currency_ratewith a Sundaydate) The CBR does not publish that day; these are the most recent published rates, and the response flags the shift withdate_adjusted: true.
Errors
Failures are data, never exceptions or stack traces:
{ "error": "unknown_currency", "message": "…", "currency": "GBP", "date": "2026-11-26" }
| Meaning | What to do |
| No currency supplied | Pass an ISO code |
| Not a plausible code | Use |
| The CBR does not quote it | Call |
| Asked for | Convert another currency to |
| Not a real calendar date | Pass |
| No amount supplied | Pass a number |
| Not a number | Pass |
|
| Swap them |
| More than 366 days | Narrow or split the range |
| Nothing published for that date or the week before | Pick an earlier date |
| A currency has no value that day | Retry later |
| Upstream too slow | Retry |
| Connection failed | Retry |
| The CBR returned 5xx after retries | Retry later |
| The CBR rejected the request | Check arguments |
| Unexpected document shape | Report as a bug |
Every date-bearing success payload also carries date (what was actually
published), requested_date (what you asked for) and date_adjusted (whether
they differ), plus a message explaining the shift when they do.
Behaviour and limits
Caching. A day's table is cached for 10 minutes, the currency directory for 24 hours, history ranges for 30 minutes. Concurrent identical requests share one upstream call.
Retries. 408/425/429/5xx are retried with jittered backoff, honouring
Retry-After; other 4xx are not.Business days only. The CBR publishes once per business day, around 11:30 Moscow time, and its feeds contain only that day's rates. Before publication the server looks back up to seven days and reports the day it used.
Time zones. "Today" means today in Moscow, because that is the calendar the CBR publishes on.
Encoding. The feeds are
windows-1251, not UTF-8; decoding is explicit rather than guessed, so Russian names never arrive as mojibake.Coverage. Precious metals and the rouble itself are not in the daily feed. Neither are currencies the CBR has stopped quoting.
Read-only. No account, no payments, no key.
Languages
Set MCP_LOCALE to en, es or ru. It controls tool titles, descriptions,
parameter text and every error message. Default is English; when MCP_LOCALE is
unset the server falls back to LANGUAGE / LANG, then to English.
Currency names follow the locale: Russian names in Russian, the CBR's English names otherwise (Spanish has no official CBR name list, and inventing one would be worse than using English).
Development
python -m venv .venv
.venv/Scripts/activate # Windows; source .venv/bin/activate elsewhere
pip install -e ".[dev]"
pytest -m "not live and not e2e" # unit: parsing, dates, mocked feeds
pytest -m e2e # end-to-end: real stdio process, real protocol
pytest -m live # live: hits the real CBR feeds
pytest # everythingLayout:
src/mcp_cbr_rate/
server.py FastMCP wiring, tool signatures, error mapping
cbr.py XML parsing, nominal normalisation, cached client
i18n.py en / es / ru strings
core.py HTTP client with retries, TTL cache, locale plumbingAttribution
Exchange rates come from the public XML feeds of the Central Bank of the Russian Federation (Банк России) and remain their data. This project is an independent wrapper, not affiliated with or endorsed by the Bank of Russia.
Rates are the CBR's official accounting figures, not market or trading quotes. This is not financial advice.
License
MIT — see LICENSE.
Available Tools
5 toolsconvert_currencyARead-only
Convert an amount from one currency to another using the official Bank of Russia rates, crossing through the rouble. Both currencies must be quoted by the CBR (or be 'RUB'). Returns the converted amount together with the effective rate. Example: amount=1000, from_currency='USD', to_currency='RUB'.
Inputs: amount (required), to_currency (required), from_currency (required), date. Returns: object
get_currency_rateARead-only
Return the official Bank of Russia rate for one currency: roubles per unit, the inverse, the quoted nominal and both the English and Russian names. 'date' is optional and accepts 2026-11-26, 26.11.2026 or 26/11/2026; without it the latest published day is used. Weekends and holidays fall back to the previous business day and the response says which day was used. 'RUB' is accepted and always equals 1. Example: currency='USD'.
Inputs: currency (required), date. Returns: object
get_rate_historyARead-only
Return a series of official rates for one currency between start_date and end_date, both inclusive. Ranges are capped at 366 days. Only business days are published, so weekends and holidays are absent rather than repeated. Example: currency='USD', start_date='2026-11-01', end_date='2026-11-26'.
Inputs: currency (required), end_date, start_date. Returns: object
list_currency_ratesARead-only
Return the Bank of Russia daily rate table: every quoted currency with its nominal, value and per-unit rate. Pass currency_codes to narrow the list, for example ['USD', 'EUR', 'CNY']. Without it the whole table is returned, sorted by ISO code. Example: currency_codes=['USD', 'EUR'].
Inputs: date, currency_codes. Returns: object
search_currenciesARead-only
Search the Bank of Russia currency directory by ISO code, numeric code, English name or Russian name, and report which of the matches the daily feed actually quotes. Use this when you are not sure of a currency code before calling the rate tools. Example: query='yuan'.
Inputs: limit, query. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool maps to a distinct operation: single-rate lookup, conversion, full table listing, historical series, and directory search. Descriptions explicitly state when to prefer one over another (e.g. search_currencies before rate lookups), leaving no realistic chance of misselection.
All five names follow a strict snake_case verb_noun pattern (get_, convert_, list_, get_..._history, search_) and use consistent domain vocabulary. get_currency_rate vs get_rate_history are differentiated by the noun suffix rather than by arbitrary verb changes.
Five tools is tightly scoped to the CBR rates domain, and each one covers a genuinely different access pattern (point lookup, computation, bulk listing, time series, discovery). Nothing is redundant or padded.
Lookup, reverse rate, conversion, table listing, history and code discovery give full lifecycle coverage for the stated purpose. Minor gaps: convert_currency does not document a date parameter for historical conversion, and there is no batch multi-currency history call, though agents can work around both.
Maintenance
Related MCP Connectors
Live & historical FX rates and currency conversion for AI agents. No API keys.
Live & historical FX rates and currency conversion for AI agents. No API keys.
Russian APIs for AI agents: YooKassa, CDEK, Bitrix24 and more. Ready scenarios with code. No key.
Currency rates, history from 1949, IMF PPP, and FX analytics for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceProvides access to Croatian National Bank exchange rates without needing an API key, enabling currency conversion and rate queries through natural language.54 npmMIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to fetch official Uzbekistan Central Bank currency rates, including current and historical rates, and perform currency conversions via MCP.1-
- AlicenseAqualityCmaintenanceEnables querying Central Bank of Russia data including daily currency rates, exchange rate dynamics, key rate and history, precious metals prices, and currency conversion, with no authorization required.758 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query the Russian central bank’s key-rate history and official exchange rates by currency, date, or date range through live keyless calls.MIT