boc-valet-mcp

boc-valet-mcp

Provides LLM agents with live access to Canadian economic and financial data (exchange rates, interest rates, inflation, etc.) through the Bank of Canada Valet API, with no API key required.

Category
Visit Server

README

šŸ‡ØšŸ‡¦ Bank of Canada Valet MCP Server

Python 3.10+ MCP License: MIT CI

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.

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 Field constraints on every parameter
  • Tested — offline unit tests, no network needed for CI

Tools

Tool What it does
boc_list_series Search / list the available data series (start here)
boc_list_groups Search / list curated groups of related series
boc_get_series_info Fetch metadata (label, description) for one series
boc_get_observations Core: get data points for one or more series, by date range or most-recent
boc_get_group_observations 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-mcp

Inspect it interactively

The MCP Inspector is the fastest way to click through the tools:

npx @modelcontextprotocol/inspector boc-valet-mcp

Use 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 .        # lint

How 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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured