This guide explains how to build and run the NBP MCP Server using Docker or Podman.
Using Podman:
podman build -t nbp-mcp-server:latest .
# export VER=1.0.1
# podman build --platform linux/arm64 -t quay.io/migi/nbp-mcp-server:${VER}-arm64 .
# podman build --platform linux/amd64 -t quay.io/migi/nbp-mcp-server:${VER}-amd64 .
# podman manifest create quay.io/migi/nbp-mcp-server:${VER}
# podman push quay.io/migi/nbp-mcp-server:${VER}-arm64
# podman push quay.io/migi/nbp-mcp-server:${VER}-amd64
# podman manifest add quay.io/migi/nbp-mcp-server:${VER} docker://quay.io/migi/nbp-mcp-server:${VER}-amd64
# podman manifest add quay.io/migi/nbp-mcp-server:${VER} docker://quay.io/migi/nbp-mcp-server:${VER}-arm64
# podman manifest push quay.io/migi/nbp-mcp-server:${VER} docker://quay.io/migi/nbp-mcp-server:${VER}Using Docker:
docker build -t nbp-mcp-server:latest .Run in foreground:
podman run --rm -p 8000:8000 nbp-mcp-server:latestRun in background:
podman run -d --name nbp-mcp-server -p 8000:8000 nbp-mcp-server:latestRun in foreground:
docker run --rm -p 8000:8000 nbp-mcp-server:latestRun in background:
docker run -d --name nbp-mcp-server -p 8000:8000 nbp-mcp-server:latestThe server supports two transport modes:
The Docker container runs with streamable-http transport by default on port 8000.
This mode is suitable for:
- Web-based MCP clients
- Remote access
- Production deployments
To run with stdio transport (for testing with MCP Inspector):
podman run --rm -it nbp-mcp-server:latest python main.py --transport stdioYou can override the default host and port:
podman run --rm -p 3000:3000 nbp-mcp-server:latest \
python main.py --transport streamable-http --host 0.0.0.0 --port 3000podman logs nbp-mcp-server
# or
docker logs nbp-mcp-serverpodman stop nbp-mcp-server
# or
docker stop nbp-mcp-serverpodman rm nbp-mcp-server
# or
docker rm nbp-mcp-serverThe server should start and display:
INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: StreamableHTTP session manager started
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Once the server is running, MCP clients can connect to:
http://localhost:8000/mcp
Important: The MCP endpoint is at /mcp, not at the root path.
For connections from other Docker containers on the same network (e.g., n8n):
http://nbp:8000/mcp
The server implements the MCP streamable-HTTP protocol and exposes the following tools:
get_currency_rate- Get current exchange rate for a currencyget_exchange_table- Get current exchange rate tableget_currency_rate_history- Get historical exchange ratesget_currency_rate_last_n- Get last N exchange ratesget_gold_price- Get current gold priceget_gold_price_history- Get historical gold pricesget_gold_price_last_n- Get last N gold prices
To test the containerized server with MCP Inspector:
Terminal 1 - Start the container:
podman run --rm -p 8000:8000 nbp-mcp-server:latest
# or with docker-compose:
docker-compose upTerminal 2 - Connect the inspector:
npx @modelcontextprotocol/inspector http://localhost:8000/mcpNote: The MCP endpoint is at /mcp, not at the root path.
The inspector will open in your browser and allow you to test all available tools interactively.
The server uses the following environment variables (optional):
PYTHONUNBUFFERED=1- Enables unbuffered Python output (set by default in Dockerfile)
- The container runs as a non-root user by default (Python's default user)
- Port 8000 is exposed for HTTP communication
- The image is based on
python:3.13-slimfor minimal size - Dependencies are managed using
uvfor faster installation