{
  "markdown": "<!-- mcp-name: io.github.atomno-mcp/mcp-cbr-rates -->\n\n# mcp-cbr-rates\n\n> A Model Context Protocol (MCP) server that exposes public Bank of Russia\n> (Центральный банк РФ, **CBR**) data — currency quotes, key rate, inflation\n> and a compact macro snapshot — to AI agents.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/atomno-mcp-cbr-rates.svg)](https://pypi.org/project/atomno-mcp-cbr-rates/)\n[![GitHub release](https://img.shields.io/github/v/release/atomno-mcp/mcp-cbr-rates.svg)](https://github.com/atomno-mcp/mcp-cbr-rates/releases)\n[![Tests](https://img.shields.io/badge/tests-52%20passed-brightgreen.svg)](tests/)\n[![Coverage](https://img.shields.io/badge/coverage-84%25-brightgreen.svg)](tests/)\n![Python](https://img.shields.io/badge/python-3.11%2B-blue.svg)\n![MCP](https://img.shields.io/badge/MCP-compatible-brightgreen.svg)\n[![Glama](https://img.shields.io/badge/Glama-listed-7c3aed.svg)](https://glama.ai/mcp/servers/atomno-mcp/mcp-cbr-rates)\n\n<a href=\"https://glama.ai/mcp/servers/atomno-mcp/mcp-cbr-rates\">\n  <img width=\"380\" height=\"200\" src=\"https://glama.ai/mcp/servers/atomno-mcp/mcp-cbr-rates/badge\" alt=\"mcp-cbr-rates MCP server\" />\n</a>\n\n`mcp-cbr-rates` is part of the [atomno](https://atomno-mcp.ru) family of MCP\nservers focused on the Russian fintech ecosystem. It is fully open-source,\nrequires no API keys, and is built on top of the official public CBR\nendpoints.\n\n---\n\n## Features\n\n- Five high-quality MCP tools, each with a strict Pydantic schema:\n  `get_rate`, `history_rates`, `key_rate`, `inflation`, `statistics`.\n- Built-in TTL (Time-To-Live) cache: 1 hour for daily quotes, 24 hours for\n  historical series, to be polite to the source.\n- Async ``httpx`` transport with automatic retries on 5xx errors.\n- Safe XML parsing via ``defusedxml``.\n- 50+ unit tests with ``respx``-mocked HTTP, ≥80 % coverage.\n- No secrets, no telemetry, no third-party trackers.\n\n---\n\n## Quick start\n\n### Install from PyPI (recommended)\n\n```bash\npipx install atomno-mcp-cbr-rates\natomno-mcp-cbr-rates  # starts the MCP server over stdio\n```\n\nOr with `uv`:\n\n```bash\nuv tool install atomno-mcp-cbr-rates\n```\n\n### Install from source\n\n```bash\ngit clone https://github.com/atomno-mcp/mcp-cbr-rates.git\ncd mcp-cbr-rates\npip install -e .\natomno-mcp-cbr-rates  # starts the MCP server over stdio\n```\n\n### Use with Cursor\n\nAdd the following to `.cursor/mcp.json` (or your global `~/.cursor/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"cbr-rates\": {\n      \"command\": \"atomno-mcp-cbr-rates\"\n    }\n  }\n}\n```\n\n### Use with Claude Desktop\n\nAdd to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"cbr-rates\": {\n      \"command\": \"atomno-mcp-cbr-rates\"\n    }\n  }\n}\n```\n\nOn Windows the config lives at\n`%APPDATA%\\Claude\\claude_desktop_config.json`; on macOS at\n`~/Library/Application Support/Claude/claude_desktop_config.json`.\n\n### Use with Claude Code\n\n```bash\nclaude mcp add cbr-rates -- atomno-mcp-cbr-rates\n```\n\n---\n\n## Tools\n\n| Name | Inputs | Returns |\n|---|---|---|\n| `get_rate` | `char_code: str`, `on_date?: date` | `CurrencyRate` — single quote on the given (or latest) date |\n| `history_rates` | `char_code: str`, `date_from: date`, `date_to: date` | `HistoryRates` — series of daily quotes |\n| `key_rate` | `date_from?: date`, `date_to?: date` | `KeyRateHistory` — CBR key-rate series |\n| `inflation` | `year_from?: int`, `year_to?: int` | `InflationData` — monthly year-over-year CPI in percent |\n| `statistics` | _(none)_ | `MacroSnapshot` — combined dashboard: key rate + USD/EUR/CNY + inflation |\n\nExamples in plain English:\n\n> *\"What was the official EUR rate on April 25, 2024?\"*\n> Tool: `get_rate(char_code=\"EUR\", on_date=\"2024-04-25\")`\n\n> *\"Plot the daily USD-RUB rate over the last 90 days.\"*\n> Tool: `history_rates(char_code=\"USD\", date_from=..., date_to=...)`\n\n> *\"Give me the latest key rate, USD/EUR/CNY, and inflation in one go.\"*\n> Tool: `statistics()`\n\nThe `history_rates` window is capped at 366 days; for longer periods, call\nthe tool repeatedly.\n\n---\n\n## Configuration\n\nAll settings are optional and read from environment variables:\n\n| Variable | Default | Description |\n|---|---|---|\n| `MCP_CBR_HTTP_TIMEOUT` | `15` | HTTP timeout in seconds for CBR calls. |\n| `MCP_CBR_CACHE_DAILY_TTL` | `3600` | Cache TTL for daily quotes (seconds). |\n| `MCP_CBR_CACHE_HISTORY_TTL` | `86400` | Cache TTL for historical series and SOAP responses. |\n| `MCP_CBR_LOG_LEVEL` | `INFO` | Standard Python log level. |\n\nLegacy `CBR_*` names are still accepted for compatibility, but new configs should use `MCP_CBR_*`.\n\nThere are no API keys to configure — all CBR endpoints used here are public.\n\n---\n\n## Development\n\n```bash\ngit clone https://github.com/atomno-mcp/mcp-cbr-rates.git\ncd mcp-cbr-rates\npython -m venv .venv && source .venv/bin/activate  # or .\\.venv\\Scripts\\activate on Windows\npip install -e \".[dev]\"\npytest --cov=src/mcp_cbr_rates\n```\n\nLayout:\n\n```\napps/mcp-cbr-rates/\n├── src/mcp_cbr_rates/\n│   ├── server.py        # FastMCP entry point, tool registration\n│   ├── tools.py         # high-level async tools with caching\n│   ├── client.py        # httpx wrapper around CBR XML / SOAP / HTML endpoints\n│   ├── schemas.py       # Pydantic v2 models for inputs & outputs\n│   ├── cache.py         # async TTL cache\n│   ├── currency_codes.py # static ISO → CBR id map (with dynamic fallback)\n│   └── errors.py        # typed exception hierarchy\n└── tests/               # respx-mocked unit tests + fixtures\n```\n\n---\n\n## Data sources\n\n* `https://www.cbr.ru/scripts/XML_daily.asp` — daily currency quotes.\n* `https://www.cbr.ru/scripts/XML_dynamic.asp` — historical currency series.\n* `https://www.cbr.ru/scripts/XML_valFull.asp` — currency code lookup.\n* `https://www.cbr.ru/DailyInfoWebServ/DailyInfo.asmx` — SOAP service for the\n  CBR key rate.\n* `https://www.cbr.ru/hd_base/infl/` — monthly year-over-year inflation table.\n\nAll endpoints are read-only and free of charge.\n\n---\n\n## Disclaimer\n\nThis project is **not affiliated with the Bank of Russia** in any way. It is\nan unofficial, best-effort wrapper around publicly available data. Use at your\nown risk; the authors disclaim any responsibility for the freshness, accuracy\nor applicability of the data delivered through this server.\n\nIf CBR's HTML or XML schemas change, individual tools may stop working until\nthis package is updated. Please open an issue if you notice a regression.\n\n---\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n",
  "bytes": 6495,
  "sha": "875736bb1d3bae788a10311ff87e85cea0a3b6365f8de7e7783095ed07832a50",
  "repo_slug": "atomno-mcp/mcp-cbr-rates",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_atomno_mcp_mcp_cbr_rates_bd896ff0/readme"
}