nbp-currency-mcp

pilpat/nbp-currency-mcp

3.2

If you are the rightful owner of nbp-currency-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The NBP Currency Exchange MCP Server provides natural language access to Polish National Bank (NBP) currency exchange rates, offering buy and sell rates for 13 major currencies from Table C.

Tools
4
Resources
0
Prompts
0

NBP Currency Exchange MCP Server

Natural language access to Polish National Bank (NBP) currency exchange rates. Get buy and sell rates for 13 major currencies from Table C with simple queries.

Features

  • =ã Natural Language Queries - Ask in plain English: "What's the USD rate?"
  • Buy & Sell Rates - Complete Table C data from NBP
  • Historical Data - Access rates from any date since 2002
  • ¡ Smart Caching - 5-minute cache for optimal performance
  • < 13 Major Currencies - USD, EUR, GBP, CHF, AUD, CAD, DKK, NOK, SEK, XDR, CZK, HUF, JPY

Quick Start

# Run the server
fastmcp run nbp_currency_server.py

# Install to Claude Desktop
fastmcp install claude-desktop nbp_currency_server.py --server-name "NBP Currency"

# HTTP server mode
fastmcp run nbp_currency_server.py --transport http --port 8000

Example Queries

# Basic rate queries
"USD rate"
"EUR exchange rate"
"What's the GBP rate?"

# Specific rate types
"USD buy rate"
"EUR sell price"

# Historical queries
"USD rate yesterday"
"EUR rate 2024-09-25"

# All currencies
"all currencies"
"show all exchange rates"

Available Tools

  • get_currency_rate_tool(currency, rate_type, date) - Get specific currency rates
  • query_exchange_rates(query) - Natural language currency queries
  • list_available_currencies() - List all supported currencies
  • get_all_current_rates() - Complete current Table C

Available Resources

  • currencies://available - List of supported currencies
  • rates://current - Current exchange rates table
  • help://queries - Query examples and syntax
  • api://documentation - NBP API documentation
  • setup://installation - Installation guide

Supported Currencies

CodeCurrency
USDUS Dollar
EUREuro
GBPBritish Pound
CHFSwiss Franc
AUDAustralian Dollar
CADCanadian Dollar
DKKDanish Krone
NOKNorwegian Krone
SEKSwedish Krona
XDRSpecial Drawing Rights
CZKCzech Koruna
HUFHungarian Forint
JPYJapanese Yen

Output Format

All responses include:

  • currency_name - Full currency name
  • currency_code - 3-letter ISO code
  • table_effective_date - Publication date
  • buy_rate - Bank buying rate (bid)
  • sell_rate - Bank selling rate (ask)

Data Source

This server uses the official NBP Web API which provides:

  • Real-time exchange rates
  • Historical data since January 2, 2002
  • Official rates used in Poland
  • No authentication required
  • Daily updates (working days)

Deployment

FastMCP Cloud

fastmcp deploy nbp_currency_server.py --name "NBP Currency Rates"

Local Development

# Install dependencies
uv add fastmcp httpx pydantic python-dateutil

# Run locally
fastmcp run nbp_currency_server.py --transport http --port 8000

Requirements

  • Python 3.12+
  • Internet connection for NBP API access
  • No API keys required

Technical Details

  • Framework: FastMCP 2.0
  • HTTP Client: httpx (async)
  • Validation: Pydantic models
  • Caching: 5-minute TTL using FastMCP Context
  • Date Parsing: python-dateutil

Error Handling

  • Weekend/holiday data: NBP doesn't publish on non-working days
  • Invalid currencies: Clear error messages with supported list
  • Network issues: Automatic retry and graceful degradation
  • Cache failures: Fallback to direct API calls

License

MIT License - see the official NBP API terms for data usage.