Skip to content
MCP server
Registry

swiss-snb-mcp MCP Server

SNB data portal: exchange rates, balance sheet, policy rates, SARON, monetary aggregates

swiss-snb-mcp scores 66 (Good), licensed MIT and written in Python. It installs as a local process. It declares 11 tools. Filed under AI and memory. GitHub shows 0 stars. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.

by malkreideMITPython0 stars
Trust score
66Good
Trust score 66 of 100, Good

Good trust

66 of 100 from six public signals. Nobody can buy a point.

  • Listed in the official MCP registry.
  • OSI-style license: mit.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 66 comes from

22 + 20 + 0 + 10 + 4 + 10 = 66. Each factor is capped, so no single signal can carry a listing.

Registry22 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 22 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity0 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 0 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "malkreide-swiss-snb-mcp": {      "command": "uvx",      "args": [        "swiss-snb-mcp"      ]    }  }}

Environment variables

This server does not declare environment variables.

Tools11Tool docs quality grade D

All capabilities

About

πŸ‡¨πŸ‡­ Part of the Swiss Public Data MCP Portfolio

🏦 swiss-snb-mcp

Version License: MIT Python 3.11+ MCP Data Source CI

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.

πŸ‡©πŸ‡ͺ Deutsche Version


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 devkum publishes against CHF β€” including two USD forward rates, which are labelled as such
  • SNB 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?"


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+
  • uv or pip
  • MCP-compatible client (Claude Desktop, Claude Code, or any MCP host)

Installation

Via uvx (recommended β€” no permanent installation needed):

uvx swiss-snb-mcp

Via pip:

pip install swiss-snb-mcp

From 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.json
  • Windows: %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:

VariableDefaultDescription
SNB_TIMEOUT15HTTP request timeout in seconds

Available Tools

Phase 1 β€” Dedicated Tools

ToolDescription
snb_get_exchange_ratesMonthly CHF rates for EUR, USD, JPY, GBP, CNY and 22 more currencies
snb_get_annual_exchange_ratesAnnual average rates, data from 1980
snb_get_balance_sheetSNB Bilanz positions in millions CHF (monthly)
snb_convert_currencyConvert any amount to CHF using official SNB rates

Phase 2 β€” Generic Cube Tools

ToolDescription
snb_get_cube_dataGeneric access to any SNB cube by ID
snb_get_cube_metadataInspect dimensions and filter values of any cube

Phase 3 β€” Warehouse API (Banking Statistics) and Balance of Payments

ToolDescription
snb_get_banking_balance_sheetBanking balance sheets by bank group (monthly/annual, assets/liabilities)
snb_get_banking_incomeBanking income statements by bank group (annual)
snb_get_balance_of_paymentsBalance of payments and international investment position (quarterly)
snb_get_warehouse_dataGeneric access to any SNB Warehouse cube by ID
snb_get_warehouse_metadataInspect 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:

URIDescription
data://snb/currenciesAll 28 currency IDs with labels and units
data://snb/balance-sheet-positionsAsset and liability position IDs
data://snb/cubesAll verified Cube-API IDs (Phase 1–2) + discovery guide
data://snb/warehouse-cubesAvailable Warehouse cube IDs (BSTA)
data://snb/bank-groupsAll 12 bank group IDs with labels

Example Use Cases

QueryTool
"What is the current EUR/CHF rate?"snb_get_exchange_rates
"Convert CHF 10,000 to USD"snb_convert_currency
"Show SNB gold reserves over the last year"snb_get_balance_sheet
"What is the current SNB policy rate?"snb_get_cube_data (cube: snbgwdzid)
"How do SNB, Fed and ECB rates compare?"snb_get_cube_data (cube: snboffzisa)
"What is the SARON 3M compound rate?"snb_get_cube_data (cube: zirepo)
"How fast is M3 money supply growing?"snb_get_cube_data (cube: snbmonagg)
"Total assets of all Swiss banks?"snb_get_banking_balance_sheet
"Income statement of cantonal banks?"snb_get_banking_income (bank_group: G10)
"Switzerland's balance of payments?"snb_get_balance_of_payments
"Which cubes are available?"resource data://snb/cubes

β†’ More use cases by audience β†’


Safety & Limits

AspectDetails
AccessRead-only (readOnlyHint: true) β€” the server cannot modify or delete any data
Personal dataNo personal data β€” all sources are aggregated, public macroeconomic statistics
Rate limitsSNB 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)
Timeout15 seconds per API call
AuthenticationNo API keys required β€” both APIs (/api/cube/ and /api/warehouse/cube/) are publicly accessible
Data sourceSwiss National Bank β€” data.snb.ch
Terms of ServiceSubject 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 version

Known 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/cubes resource for verified IDs
  • Historical 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

MCP Protocol Version

This server speaks two protocol eras over the same endpoint. The client's first request on a connection decides which one applies; a later claim from the other era is refused.

EraRevisionWho reaches it
initialize handshake2024-11-05 … 2025-11-25What today's clients speak. The server answers with the revision asked for, or with the 2025-11-25 ceiling when the request asks for something newer.
Per-request envelope2026-07-28A request carrying the 2026-07-28 _meta envelope opens a modern connection.

Both revisions are pinned in tests/test_protocol_version.py and asserted against the installed SDK, so a Dependabot bump of mcp cannot move either one silently.

The table above is measured, not inferred. The same gate drives the server's real serving loop over an in-memory stream pair β€” the loop stdio runs in production β€” and sends actual JSON-RPC frames through it: an enveloped request is served at 2026-07-28, an initialize asking for 2026-07-28 is answered 2025-11-25, and a claim from the other era is refused on an already-decided connection (-32022 one way, -32600 the other). An earlier revision of this section claimed the measurement needed an ASGI app; it does not β€” the modern era has no initialize, and the handshake never rode on HTTP to begin with.

What the server reports about itself is measured the same way, in tests/test_server_identity.py: the package version and the project URL are read back off the wire, not off the constructor.

Note that the SDK's LATEST_PROTOCOL_VERSION is an alias for the modern era, not for the handshake era β€” pinning against it alone would leave the era that current clients actually negotiate free to drift.

Update policy. When the gate fails, do not edit the constant blindly: read the spec changelog between the two revisions, verify the server still behaves, then move the constant, this section, README.de.md and CHANGELOG.md together.


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

The 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

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"
      ]
    }
  }
}

Frequently asked questions

What is swiss-snb-mcp MCP Server?

SNB data portal: exchange rates, balance sheet, policy rates, SARON, monetary aggregates

How do I install swiss-snb-mcp MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. swiss-snb-mcp MCP Server runs locally from the PyPI package swiss-snb-mcp with the command uvx swiss-snb-mcp.

Is swiss-snb-mcp MCP Server free and open source?

Yes. swiss-snb-mcp MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does swiss-snb-mcp MCP Server support remote (HTTP) connections?

No remote endpoint is listed for swiss-snb-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does swiss-snb-mcp MCP Server provide?

swiss-snb-mcp MCP Server provides 11 tools, including snb_convert_currency, snb_get_annual_exchange_rates, snb_get_balance_of_payments, and snb_get_balance_sheet. See the full tool list for descriptions and parameters.

How is swiss-snb-mcp MCP Server's trust score calculated?

swiss-snb-mcp MCP Server scores 66 out of 100 (Good). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

β€”Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server