Purpose
honest-nbp-mcp is a local MCP (Model Context Protocol) server that wraps the public REST API of the National Bank of Poland (NBP) (api.nbp.pl), providing exchange rate and gold fixing queries. It is aimed at Polish accounting scenarios: when a Polish JDG owner receives a foreign-currency invoice, tax law requires converting it to PLN using the NBP mid rate from the last business day before the invoice date. This tool lets an AI assistant complete the lookup and conversion in a single tool call, replacing the monthly manual browser-based table lookup for each invoice.
Main capabilities
- get_rate: queries the NBP exchange rate for a given currency on a specified date (or the latest), supporting tables A / B / C.
- list_rates: queries the entire exchange rate table for a specified date (or the latest).
- get_rate_history: queries the exchange rate history for a currency over a date range (≤367 days).
- get_gold: queries the gold fixing for a specified date (or the latest) (per gram of 1000 purity, in PLN).
- get_gold_history: queries historical gold prices over a date range.
- convert: converts an amount between two currencies using the NBP mid rate; you can specify an exact date (rate_date), or use the last exchange rate table published before a given date (before_date, e.g. the invoice date). Supports PLN on either side, cross rates via PLN, and A/B table fallback for less common currencies.
Data source and table descriptions
The endpoint api.nbp.pl is the public REST API of the National Bank of Poland, requiring no API key, no registration, and no rate limits. Table A contains daily mid rates for major currencies (USD, EUR, GBP, CHF, JPY, etc.), which is the table used for accounting; Table B contains weekly (Wednesday) rates for less common currencies; Table C contains daily buy/sell spreads, applicable to actual foreign exchange transactions rather than bookkeeping.
Usage
After installation, run it locally and register it with Claude Code or Claude Desktop (claude_desktop_config.json). On Windows, use venv\Scripts\pip and venv\Scripts\python instead of venv/bin/pip and venv/bin/python. Example calls:
- get_rate(currency="USD", date="2026-03-14"): returns the mid rate and effective date; if NBP did not publish on that day (weekend/holiday), returns an explicit 404 payload prompting the caller to try the previous business day.
- convert(amount=1240.50, from_currency="EUR", before_date="2026-07-15"): returns the PLN amount, the rate used, and the effective date of the NBP exchange rate table it came from (the last table strictly before 2026-07-15, searched back up to 14 days).
- convert(..., rate_date="2026-07-15"): uses only the table published on that day; returns an error payload on weekends/holidays. rate_date and before_date cannot be used together.
- get_rate_history(currency="EUR", start_date="2026-04-01", end_date="2026-06-30"): returns the full daily series.
Use cases
Aimed at Polish accounting and JDG owners. Under Article 11a(1–2) of the Polish PIT Act (Article 12(2) and Article 15(1) of the CIT Act), foreign currency amounts should be converted to PLN using the NBP mid rate published on the last business day before the income is earned or the cost is incurred, not the rate for that day—a common source of manual errors. Passing the invoice date to convert(..., before_date="YYYY-MM-DD") performs the lookup automatically and returns the effective date of the rate table used for record-keeping.
Limitations
Data flows only between the user's machine and NBP—no cloud relay, no login, no telemetry. The project is MIT licensed. The author, Bartosz Kuć, is a Warsaw-based developer and JDG owner who runs skanfirmy.pl and offers consulting on Polish tax and business integrations (KSeF, GUS/NFZ/GIOŚ APIs, mBank data), MCP server design, and AI-assisted tools.