boc-valet-mcp
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., "@boc-valet-mcp what's the latest USD/CAD exchange rate?"
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.
šØš¦ Bank of Canada Valet MCP Server
An MCP server that gives LLM agents (Claude, and any other MCP-compatible client) live access to Canadian economic and financial data through the Bank of Canada Valet API ā exchange rates, interest rates, inflation series, and thousands more.
The Valet API is free and requires no API key, so this server runs out of the box.
Ask "What's the latest USD/CAD exchange rate?" or "Chart CORRA over the last month" and the agent pulls the numbers straight from the source.
Why this exists
Large language models don't know today's exchange rate ā their training data is frozen in the past. MCP closes that gap by letting a model call live tools. This server is a small, focused, production-shaped example of that pattern: clean tool design, input validation, actionable errors, and tests.
Related MCP server: mcp-statscan
Features
5 well-scoped tools covering discovery ā metadata ā data retrieval
No API key ā the Valet API is public
Dual output ā human-readable Markdown or structured JSON, per call
Search + pagination over the large series/group catalogue
Multi-series comparison ā pull several series side by side in one call
Agent-friendly errors ā every failure explains what to try next
Typed & validated ā Pydantic
Fieldconstraints on every parameterTested ā offline unit tests, no network needed for CI
Tools
Tool | What it does |
| Search / list the available data series (start here) |
| Search / list curated groups of related series |
| Fetch metadata (label, description) for one series |
| Core: get data points for one or more series, by date range or most-recent |
| Get every series in a group in a single call |
Architecture
src/boc_valet_mcp/
āāā server.py # MCP tool definitions (the interface agents see)
āāā client.py # Async httpx client + centralized, actionable errors
āāā formatting.py # Markdown / JSON rendering (shared by every tool)The separation keeps each layer testable: tools stay thin, HTTP concerns live in one place, and presentation logic is unit-tested offline against representative payloads.
Quickstart
git clone https://github.com/Chatusvi-Karnati/boc-valet-mcp.git
cd boc-valet-mcp
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .Run it directly (it speaks MCP over stdio):
boc-valet-mcpInspect it interactively
The MCP Inspector is the fastest way to click through the tools:
npx @modelcontextprotocol/inspector boc-valet-mcpUse it with Claude Desktop
Add this to your claude_desktop_config.json (see examples/):
{
"mcpServers": {
"bank-of-canada": {
"command": "boc-valet-mcp"
}
}
}Restart Claude Desktop and ask it something like "Compare the USD/CAD and EUR/CAD rates over the past week."
Example
Calling boc_get_observations with series_names="FXUSDCAD", recent=1:
**Series:**
- `FXUSDCAD` ā US dollar to Canadian dollar daily exchange rate
| Date | FXUSDCAD |
|------------|----------|
| 2024-06-03 | 1.3654 |
_1 observation(s)._Development
pip install -e ".[dev]"
pytest # run the test suite
ruff check . # lintHow it was built
Designed and built following Anthropic's MCP server best practices ā comprehensive tool coverage, readOnly/idempotent annotations, Pydantic-validated inputs, and error messages written for an agent audience. Developed with an AI-assisted workflow using Claude Code.
License
MIT ā see LICENSE.
Acknowledgements
Data is provided by the Bank of Canada Valet API. This project is not affiliated with or endorsed by the Bank of Canada. Please review the Bank of Canada's terms of use for the data.
Available Tools
5 toolsboc_get_group_observationsARead-onlyIdempotent
Retrieve observations for every series in a group in one call.
For example group_name='FX_RATES_DAILY', recent=1 returns the latest daily exchange rate for all published currencies at once.
Inputs: group_name (required), recent, response_format. Returns: result
boc_get_observationsARead-onlyIdempotent
Retrieve observations (the actual data points) for one or more series.
This is the core tool. Supply a date range with 'start_date'/'end_date', or ask for the latest values with 'recent'. Multiple comma-separated series are returned side by side for easy comparison.
Example: series_names='FXUSDCAD', recent=1 returns the latest USD/CAD rate.
Inputs: series_names (required), recent, end_date, start_date, +1 more. Returns: result
boc_get_series_infoARead-onlyIdempotent
Get the label and description metadata for a single series.
Useful for confirming a series is what you expect before pulling its observations.
Inputs: name (required), response_format. Returns: result
boc_list_groupsARead-onlyIdempotent
Discover available data groups (curated bundles of related series).
Groups collect related series ā for example 'FX_RATES_DAILY' bundles the daily exchange rates for many currencies. Feed a returned group name into 'boc_get_group_observations'.
Inputs: limit, offset, search, response_format. Returns: result
boc_list_seriesARead-onlyIdempotent
Discover available data series in the Bank of Canada Valet API.
Use this first when you do not already know a series name. Filter with 'search' to narrow the (large) catalogue, then feed a returned name into 'boc_get_observations'. Returns a paginated list of series with their name, label, and description.
Inputs: limit, offset, search, response_format. Returns: result
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 has a clear, distinct purpose: listing series, listing groups, getting series metadata, getting observations for series, and getting observations for groups. No overlap.
All tools follow a consistent 'boc_verb_noun' pattern (e.g., boc_list_series, boc_get_observations), making it easy to infer functionality.
With 5 tools, the server is focused and each tool earns its place. The count is ideal for a read-only economic data API.
Covers discovery and retrieval for both individual series and groups. Missing a dedicated tool for group metadata, but the list tool provides enough context.
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.
Canadian public-sector data and legal information for AI agents, paid per call in USDC over x402
60+ units, live FX, timezones, and date arithmetic for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to access SEC EDGAR filings, US Treasury rates, BLS labor statistics, and economic indicators without API keys.626 npmMIT
- AlicenseNot gradedqualityFmaintenanceProvides access to Statistics Canada official statistics without authentication, enabling AI agents to query Canadian economic and demographic data.6 npmMIT
- AlicenseAqualityCmaintenanceProvides live access to Canadian economic data via the Bank of Canada's Valet API, including exchange rates, policy interest rates, CPI, bond yields, and commodity prices.452 npmMIT
- AlicenseAqualityBmaintenanceEnables AI assistants and agents to query official Mexican economic data from Banxico, including USD/MXN exchange rates, inflation (INPC), UDIS, and interest rates.624 PyPI6MIT