swiss-snb-mcp
The swiss-snb-mcp server provides read-only access to Swiss National Bank (SNB) public data. It offers dedicated tools and generic query capabilities for the following domains:
Exchange Rates: Retrieve monthly average, month-end, and annual CHF exchange rates for 27 currencies; convert amounts to CHF using official SNB rates.
SNB Balance Sheet: Access monthly balance sheet positions (gold, foreign exchange reserves, banknotes, sight deposits) in millions CHF.
Interest Rates & Monetary Policy: Query SNB policy rate, SARON (daily fixing, compound rates), international central bank rates, and money market rates (SOFR, β¬STR, etc.).
Monetary Aggregates: Obtain M1, M2, M3 money supply levels and year-on-year growth.
Banking Statistics: Retrieve banking balance sheets and income statements by bank group (monthly or annually) via Warehouse API.
Balance of Payments: Access quarterly current account, capital account, financial account, and international investment position.
Generic Data Access: Directly query any SNB data cube or warehouse cube by ID; inspect cube metadata and filter dimensions before querying.
Discovery Resources: Catalogs for currencies, balance sheet positions, cube/warehouse IDs, and bank groups to aid exploration.
Key characteristics:
No authentication required β fully public data.
Multilingual support: German, English, French.
Automatic retry with exponential backoff for SNB API rate limits.
Click on "Install 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., "@swiss-snb-mcpWhat is the current EUR/CHF 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.
π¨π Part of the Swiss Public Data MCP Portfolio
π¦ swiss-snb-mcp
MCP server for the Swiss National Bank (SNB) data portal β exchange rates, balance sheet, interest rates, SARON, monetary aggregates, banking statistics, and balance of payments.
Overview
swiss-snb-mcp connects AI models to the official Swiss National Bank data portal at data.snb.ch via the Model Context Protocol (MCP). It provides structured access to SNB's public REST API β no authentication required.
The server covers three tiers of datasets, all confirmed against the live API:
Phase 1 β Dedicated tools:
Exchange rates (monthly averages, month-end rates, annual averages) for the 28 currency series
devkumpublishes against CHF β including two USD forward rates, which are labelled as suchSNB balance sheet (Bilanz): gold reserves, foreign exchange investments, banknotes in circulation, sight deposits, and totals
Phase 2 β Via generic cube tools (snb_get_cube_data + snb_get_cube_metadata):
SNB policy rate (Leitzins) and SARON daily fixing, emergency facility rate, sight deposit rates
SARON compound rates: Overnight, 1M, 3M, 6M
International money market rates: SARON (CH), SOFR (USA), TONA (JP), SONIA (UK), β¬STR/EURIBOR (EZ)
Official central bank rates: SNB, Fed, ECB, Bank of England, Bank of Japan
Monetary aggregates M1, M2, M3: stock levels and year-on-year changes
Phase 3 β Warehouse API (banking statistics) and balance of payments:
Banking balance sheets (BSTA BIL): total assets and liabilities by bank group β annual and monthly
Banking income statements (BSTA EFR): operating income, expenses, taxes by bank group β annual
Balance of payments: current account, capital account, financial account (quarterly)
International investment position: components by investment type (quarterly)
Generic warehouse access: raw access to any SNB Warehouse cube by ID
Anchor demo query: "What was the EUR/CHF exchange rate during the 2015 Franc shock, and where does the SNB policy rate stand today compared to the Fed and ECB?"
Related MCP server: Norges Bank MCP Server
Features
π± Exchange rates β monthly CHF rates for EUR, USD, JPY, GBP, CNY and 23 more series
π Annual averages β year-by-year rates from 1980 onwards
ποΈ SNB balance sheet β gold, foreign exchange investments, banknotes, sight deposits (monthly)
π Currency conversion β convert any amount to CHF using official SNB rates
π Policy rate & SARON β daily fixing, Leitzins, compound rates (1M/3M/6M)
π International rate comparison β SNB, Fed, ECB, Bank of England, Bank of Japan side by side
π° Monetary aggregates β M1, M2, M3 stock levels and year-on-year growth
π¦ Banking statistics β balance sheets and income statements by bank group (12 groups)
π Balance of payments β current account, IIP, and international investment position
π Generic cube access β query any SNB data cube or Warehouse cube by ID
π No authentication required β fully public SNB data portal
Prerequisites
Python 3.11+
uvorpipMCP-compatible client (Claude Desktop, Claude Code, or any MCP host)
Installation
Via uvx (recommended β no permanent installation needed):
uvx swiss-snb-mcpVia pip:
pip install swiss-snb-mcpFrom source:
git clone https://github.com/malkreide/swiss-snb-mcp.git
cd swiss-snb-mcp
pip install -e .Usage / Quickstart
Claude Desktop β add to claude_desktop_config.json:
{
"mcpServers": {
"swiss-snb-mcp": {
"command": "uvx",
"args": ["swiss-snb-mcp"]
}
}
}Config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Try it immediately in Claude Desktop:
"What is the current EUR/CHF exchange rate according to the SNB?" "Show me the SNB balance sheet for the last 12 months β gold and foreign reserves."
Configuration
No API key or authentication required. The SNB data portal is fully public.
Optional environment variable:
Variable | Default | Description |
|
| HTTP request timeout in seconds |
Available Tools
Phase 1 β Dedicated Tools
Tool | Description |
| Monthly CHF rates for EUR, USD, JPY, GBP, CNY and 22 more currencies |
| Annual average rates, data from 1980 |
| SNB Bilanz positions in millions CHF (monthly) |
| Convert any amount to CHF using official SNB rates |
Phase 2 β Generic Cube Tools
Tool | Description |
| Generic access to any SNB cube by ID |
| Inspect dimensions and filter values of any cube |
Phase 3 β Warehouse API (Banking Statistics) and Balance of Payments
Tool | Description |
| Banking balance sheets by bank group (monthly/annual, assets/liabilities) |
| Banking income statements by bank group (annual) |
| Balance of payments and international investment position (quarterly) |
| Generic access to any SNB Warehouse cube by ID |
| Inspect dimensions and last update of a Warehouse cube |
Resources (static catalogs)
Discovery aids served as MCP resources rather than tools so they don't crowd the tool manifest:
URI | Description |
| All 28 currency IDs with labels and units |
| Asset and liability position IDs |
| All verified Cube-API IDs (Phase 1β2) + discovery guide |
| Available Warehouse cube IDs (BSTA) |
| All 12 bank group IDs with labels |
Example Use Cases
Query | Tool |
"What is the current EUR/CHF rate?" |
|
"Convert CHF 10,000 to USD" |
|
"Show SNB gold reserves over the last year" |
|
"What is the current SNB policy rate?" |
|
"How do SNB, Fed and ECB rates compare?" |
|
"What is the SARON 3M compound rate?" |
|
"How fast is M3 money supply growing?" |
|
"Total assets of all Swiss banks?" |
|
"Income statement of cantonal banks?" |
|
"Switzerland's balance of payments?" |
|
"Which cubes are available?" | resource |
β More use cases by audience β
Safety & Limits
Aspect | Details |
Access | Read-only ( |
Personal data | No personal data β all sources are aggregated, public macroeconomic statistics |
Rate limits | SNB Warehouse API has WAF protection (HTTP 503 after ~100 rapid requests); the server retries automatically with exponential backoff (max 3 retries, delays 2/4/8s) |
Timeout | 15 seconds per API call |
Authentication | No API keys required β both APIs ( |
Data source | |
Terms of Service | Subject to SNB's Terms of Use and Copyright; data is free for non-commercial use with source attribution |
Architecture
βββββββββββββββββββ βββββββββββββββββββββββββββββ ββββββββββββββββββββββββ
β Claude / AI ββββββΆβ Swiss SNB MCP ββββββΆβ data.snb.ch β
β (MCP Host) βββββββ (MCP Server) βββββββ β
βββββββββββββββββββ β β β /api/cube/ (JSON) β
β 11 Tools Β· 5 Resources β β /api/warehouse/ β
β Stdio | SSE β β Public Β· No Auth β
β β β β
β Phase 1: dedicated tools β β Exchange rates β
β Phase 2: generic cubes β β Balance sheet β
β Phase 3: warehouse + β β Interest rates β
β banking stats β β Banking statistics β
βββββββββββββββββββββββββββββ β Balance of payments β
ββββββββββββββββββββββββCube Discovery Pattern
The SNB API follows a consistent cube-based structure. Read the data://snb/cubes resource to explore verified cube IDs, then snb_get_cube_metadata to inspect dimensions before querying with snb_get_cube_data. Phase 3 adds the Warehouse API (/api/warehouse/cube/) for granular banking statistics β start from the data://snb/warehouse-cubes and data://snb/bank-groups resources.
Project Structure
swiss-snb-mcp/
βββ src/
β βββ swiss_snb_mcp/
β βββ __init__.py
β βββ server.py # Core tools and FastMCP server (Phase 1β2 + BoP)
β βββ warehouse.py # Warehouse API tools (Phase 3: banking statistics)
βββ scripts/
β βββ record_fixtures.py # records tests/fixtures/* from data.snb.ch
βββ tests/
β βββ fixtures/ # recorded responses + PROVENANCE.md (date, rule, SHA-256)
β βββ fixture_data.py # loader β a missing name is an error, not an empty dict
β βββ test_unit.py # respx-mocked unit tests (run in CI)
β βββ test_live_scenarios.py # 20 live scenarios for Phase 1β2 (nightly)
β βββ test_live_warehouse.py # 20 live scenarios for Phase 3 (nightly)
βββ pyproject.toml # Build configuration (hatchling)
βββ CHANGELOG.md
βββ CONTRIBUTING.md # Contribution guidelines (English)
βββ CONTRIBUTING.de.md # German version
βββ SECURITY.md # Security policy & posture (English)
βββ SECURITY.de.md # German version
βββ LICENSE
βββ README.md # This file (English)
βββ README.de.md # German versionKnown Limitations
Exchange rates: Monthly averages only β no intraday or daily rates available via this API
Balance sheet: Monthly data; some positions may have a publication lag of 1β2 months
Cube access: Cube IDs are not officially documented by the SNB β read the
data://snb/cubesresource for verified IDsHistorical depth: Coverage varies by series; exchange rates go back to 1980, some interest rate series start later
No forecasts: All data is historical/realised β SNB does not publish forecasts via this API
Testing
# Unit tests (no API key required)
PYTHONPATH=src pytest tests/ -m "not live"
# Integration tests (live SNB API)
PYTHONPATH=src pytest tests/ -m "live"
# Re-record the fixtures from data.snb.ch (writes tests/fixtures/PROVENANCE.md)
python scripts/record_fixtures.pyThe unit-test payloads are recorded, not invented. Source, retrieval date,
selection rule and SHA-256 per file are in
tests/fixtures/PROVENANCE.md. A hand-written
mock encodes its author's assumption and can therefore never refute it β
production code and fixture come from the same head, so where both are wrong,
both are wrong together and the suite stays green. Each file keeps every
series and only shortens the value lists: the code reasons about the
dimensions and merely displays the values, so cutting "the first N series"
would have hidden exactly what three of the findings depended on.
Changelog
See CHANGELOG.md
Contributing
See CONTRIBUTING.md for guidelines on reporting issues, suggesting new SNB cube IDs, and contributing code.
Security
This server is read-only, processes no personal data, and talks only to data.snb.ch. See SECURITY.md for the full security posture, audit results, and how to report a vulnerability.
License
MIT License β see LICENSE
Author
Hayal Oezkan Β· github.com/malkreide
Credits & Related Projects
Data: Swiss National Bank β SNB data portal (public REST API)
Protocol: Model Context Protocol β Anthropic / Linux Foundation
Related: zurich-opendata-mcp β MCP server for Zurich city open data
Related: swiss-transport-mcp β Swiss public transport MCP server
Portfolio: Swiss Public Data MCP Portfolio
Installation
Run via uv's uvx β no clone or manual install needed. Add to your MCP client config (mcpServers for Claude Desktop, Cursor and Windsurf; use a top-level servers key for VS Code in .vscode/mcp.json):
{
"mcpServers": {
"swiss-snb-mcp": {
"command": "uvx",
"args": [
"swiss-snb-mcp"
]
}
}
}Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityCmaintenanceEnables LLMs to search, access, and retrieve official Swedish statistics from Statistics Sweden (SCB), providing access to 1,200+ tables covering demographics, economy, environment, labor market, and education with 75+ years of historical data.8
- Alicense-qualityDmaintenanceEnables AI agents to query Norges Bank's open data API for exchange rates, policy rates, government securities, money market data, bank liquidity, and regional network survey data.MIT
- AlicenseAqualityAmaintenanceProvides AI-native access to Swiss Federal Statistical Office datasets through 9 tools for querying education, population, and cross-cantonal comparisons without authentication.152MIT
- Alicense-qualityCmaintenanceProvides access to macroeconomic indicators, FX rates, COT data, commodities, and release calendars through the FXMacroData API for AI agents.MIT
Related MCP Connectors
Live & historical FX rates for AI agents, from European Central Bank data. No API keys.
Live & historical FX rates and currency conversion for AI agents. No API keys.
Macro data for AI agents: GDP, inflation, unemployment & trade, any country. No API keys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/malkreide/swiss-snb-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server