swiss-courts-mcp
This server provides read-only access to Swiss court decisions (federal and cantonal) with full-text search, structured filters, and an offline fallback โ no API key required.
Search all Swiss court decisions (
search_court_decisions): Full-text search across federal and all 26 cantonal courts, with filters for canton, court level, date range, and language (German, French, Italian). Returns up to 50 results.Retrieve a specific decision (
get_court_decision): Fetch detailed info using a decision's unique signature.Search Federal Supreme Court decisions (
search_bger_decisions): Targeted search within BGer/BGE rulings, with optional chamber filter.Find decisions citing a law article (
search_by_law_reference): Multi-stage search for case law referencing a legal norm (e.g., "Art. 8 BV", "Art. 328 OR", "Art. 25 DSG").List indexed courts (
list_courts): Browse all courts, optionally filtered by canton.Get recent decisions (
get_recent_decisions): Retrieve the latest decisions, filterable by canton and court level.Get decision statistics (
get_decision_statistics): Aggregated statistics on indexed decisions by canton and/or year.Check offline fallback status (
get_fallback_status): Inspect the offline dump cache state (coverage, version, pre-warming) for transparency when the live source is unreachable.
Offline fallback provides limited coverage (Federal Supreme Court only, metadata/regesten, 2007โ2024) when entscheidsuche.ch is unavailable; every response declares its origin (source: live | dump). Pairs well with fedlex-mcp for combined legislation + case law research.
Provides access to Swiss court decision metadata from the Zenodo SCD dump as an offline fallback when the primary source (entscheidsuche.ch) is unavailable.
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-courts-mcpSearch Swiss Federal Supreme Court decisions on data protection from 2023"
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-courts-mcp
MCP Server for Swiss court decisions โ Federal Supreme Court (BGer), Federal Administrative Court (BVGer), Federal Criminal Court (BStGer), and all 26 cantonal courts via entscheidsuche.ch
Overview
Access Swiss court decisions from all judicial levels through a single MCP interface. Combines full-text search with structured filters for canton, court level, date range, and law references.
๐ฏ Anchor demo query: "Find Federal Supreme Court case law on data protection (Art. 25 DSG) since 2020 โ and if entscheidsuche.ch is down, still answer from the offline dump, clearly flagged."
Source | Coverage | Data |
entscheidsuche.ch (live, default) | Federal + 26 cantons | Court decisions since ~2000 |
SCD dump (offline fallback) | Federal Supreme Court only, 2007โ2024 | Metadata/regesten, no full text |
Synergy with fedlex-mcp: Legislation (SR) + case law = complete legal research.
Availability: entscheidsuche.ch is non-profit infrastructure without an SLA. When it is unreachable, the server transparently falls back to a cached public dump (see Offline fallback). Every response declares its origin (source: "live" | "dump"), and dump answers carry a coverage_note โ the fallback is partial, not equivalent.
Related MCP server: Entscheidsuche MCP Server
Features
Full-text search across all Swiss court decisions
Multi-stage law reference search with regex parser and Elasticsearch boost scoring
Dedicated Federal Supreme Court search with chamber filter
Canton and court level filtering
Recent decisions feed
Court taxonomy listing
Decision statistics with aggregations
Trilingual support (German, French, Italian)
Offline fallback to a cached public dump when entscheidsuche.ch is unreachable โ with explicit provenance on every response
No API key required
Prerequisites
Python 3.11 or higher
An MCP-compatible client (Claude Desktop, Cursor, Windsurf, etc.)
Installation
pip install swiss-courts-mcpOr install from source:
git clone https://github.com/malkreide/swiss-courts-mcp.git
cd swiss-courts-mcp
pip install -e ".[dev]"Quickstart
# Run directly
swiss-courts-mcp
# Or via Python module
python -m swiss_courts_mcpConfiguration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"swiss-courts": {
"command": "python",
"args": ["-m", "swiss_courts_mcp"]
}
}
}Cloud Deployment (HTTP transport)
The HTTP transport is off by default. The default bind host is 127.0.0.1
(loopback only) โ 0.0.0.0 must be opted into explicitly (the Dockerfile does
this). Running HTTP without authentication logs a warning; only do so behind an
authenticating reverse proxy.
# Local HTTP (loopback), no auth โ development only
swiss-courts-mcp --http --port 8000
# Container (binds 0.0.0.0, auth enabled) โ see Dockerfile
docker build -t swiss-courts-mcp .
docker run -p 8000:8000 -e MCP_AUTH_SECRET="$(openssl rand -hex 32)" swiss-courts-mcpRelevant environment variables (see .env.example):
Variable | Default | Purpose |
|
| Bind host. Set to |
|
| Bind port. |
|
| Suppress the |
|
| Stateless HTTP โ horizontal scaling without sticky sessions. |
|
| Enable bearer-token auth for HTTP. |
| โ | HS256 signing key (dev). |
| โ | JWKS URL for RS256 validation (production). |
| โ | Comma-separated required scopes. |
| โ | Comma-separated allowed origins (no wildcard in prod). |
Authentication validates the user identity from the JWT sub claim only; see
ADR 0001.
Offline fallback (env)
Variable | Default | Purpose |
|
| Master switch. |
|
| Force the dump path (skip live) โ for pre-warming the cache or offline testing. |
|
| Override the cache directory for the downloaded dump. |
|
| Zenodo record id of the SCD dump to use. |
Pre-warm the cache (downloads the ~120 MB SCD CSV once, so the first real outage does not pay the download cost):
SWISS_COURTS_FORCE_DUMP=1 python -m swiss_courts_mcp # then issue one searchMCP Protocol Version
This server pins MCP protocol version 2025-11-25 (constant
PROTOCOL_VERSION in server.py). A regression test detects drift against the
installed SDK so a protocol bump is a conscious change (version + CHANGELOG +
this section). SDK updates land monthly via Dependabot.
Project Phase
Phase 1 โ read-only (see ROADMAP.md). All tools are
readOnlyHint: true; there are no writing or destructive operations. A move to
Phase 2 (write) requires a clean re-audit and the gates listed in the roadmap.
Available Tools
Court Decision Search
Tool | Description |
| Full-text search across all court decisions with canton, court level, and date filters |
| Retrieve a single decision by its unique signature |
| Search Federal Supreme Court decisions with optional chamber filter |
| Find decisions citing a specific law article (e.g., "Art. 8 BV") |
Court Information
Tool | Description |
| List all indexed courts, optionally filtered by canton |
| Latest decisions, filterable by canton and court level |
| Statistics on indexed decisions by canton and year |
| Offline-dump cache state, coverage, version, pre-warming (read-only) |
Tool Annotations
All eight tools share the same hints โ they are read-only, idempotent, non-destructive, and reach an external system:
Annotation | Value |
|
|
|
|
|
|
|
|
A rechtsrecherche prompt is also provided (a second MCP primitive
alongside tools).
Example Use Cases
Use Case | Tool Chain |
Research case law on data protection |
|
Find practice on a constitutional right |
|
Latest Federal Supreme Court rulings |
|
Combined: Law text + case law |
|
โ More use cases by audience โ
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Client (LLM) โ
โ Claude / Cursor / Windsurf โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Protocol
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ swiss-courts-mcp โ
โ 8 tools ยท Pydantic validation โ
โ Elasticsearch query builder โ
โ Provenance envelope: source = live | dump โ
โโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโ
โ โ live (default) โ โก fallback
โ HTTPS POST/GET โ on bot-block / 5xx / 429 /
โ โ timeout, or SWISS_COURTS_FORCE_DUMP=1
โโโโโโโโโผโโโโโโโโโโโโโโโโโโโ โโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ entscheidsuche.ch โ โ SCD dump โ Zenodo 14867950 (CC BY) โ
โ Elasticsearch backend โ โ lazy download โ platformdirs cache โ
โ Federal + 26 cantons โ โ โ local SQLite search โ
โ no auth ยท no SLA โ โ BGer only ยท 2007โ2024 ยท no full text โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโArchitecture decision
This server uses Architecture C (metadata-only offline fallback), delivered via lazy download (Option A mechanics) โ decided after a live probe on 2026-07-19:
Live-first, always. entscheidsuche.ch remains the sole source on success; its behaviour is unchanged. The fallback only engages on an availability failure (bot-block, HTTP 5xx/429, timeout, connect error) or when forced.
Source: the SCD dump (Zenodo
10.5281/zenodo.14867950, Version 2024-3, CC BY 4.0), the ~120 MB CSV โ metadata/regesten only, no full text. The 375 MB full-text Parquet and its heavypyarrowdependency were rejected: a partial fallback does not justify the footprint, and full text would fake an equivalence that does not exist (BGer only).A second candidate was rejected: Zenodo
5529712("SwissJudgmentPrediction") is CC BY-NC-SA 4.0 โ incompatible with this MIT project.Consequences: the CSV is cached on disk (
platformdirs) and searched via SQLite; update detection uses the Zenodo versions API (conceptrecid7793043). Every response declaressource(live/dump) and dump responses add acoverage_note. CC-BY attribution ships in the tool output, not only here.
Offline fallback
The fallback is a behaviour of the existing tools, not a separate search
tool (only get_fallback_status was added, for transparency). It is
partial, not equivalent to the live source:
Only the Federal Supreme Court (BGer/BGE), 2007โ2024, no full text.
Bundesverwaltungsgericht, Bundesstrafgericht and all 26 cantons are NOT covered. A cantonal or non-BGer query in dump mode returns an explicit "not covered" answer โ never a silent empty result.
get_court_decisionis best-effort in dump mode: SCD case ids (docref, e.g.1C_517/2016) differ from entscheidsuche signatures, so some lookups are honestly reported as non-resolvable.If neither live nor dump is available, tools return a clear, actionable error (no crash, no stack trace).
Inspect the cache and coverage at any time with get_fallback_status.
Safety & Limits
Aspect | Details |
Access | Read-only ( |
Personal data | No personal data โ all decisions are public court rulings |
Rate limits | Built-in per-query caps (max 50 results per search, 50 aggregation buckets) |
Timeout | 30 seconds per API call |
Data source auth | No API keys required โ entscheidsuche.ch is publicly accessible |
HTTP transport auth | Optional bearer-token auth (JWT, |
Egress | Code-layer allow-lists ( |
Error masking | Internal exceptions are logged server-side only; clients receive friendly messages |
Secrets | No secrets in code/logs; |
Licenses | Court decisions are public domain under Swiss law (BGG Art. 27) |
Terms of Service | Subject to entscheidsuche.ch usage terms โ please be kind to the server |
Project Structure
swiss-courts-mcp/
โโโ src/
โ โโโ swiss_courts_mcp/
โ โโโ __init__.py
โ โโโ __main__.py
โ โโโ server.py # MCP server, 8 tools + 1 prompt, lifespan, auth wiring
โ โโโ api_client.py # HTTP client, ES query builder, egress allow-list
โ โโโ fallback.py # offline dump layer (Zenodo โ cache โ SQLite)
โ โโโ auth.py # JWT bearer-token verifier (HTTP transport)
โ โโโ config.py # Settings object (env-driven)
โ โโโ logging_config.py # structured logging on stderr
โ โโโ models.py # structured response envelope (provenance: live|dump)
โโโ tests/ # unit (respx-mocked) + live + security tests
โโโ docs/ # egress, secret-management, ADRs
โโโ .github/workflows/ # ci ยท security (gitleaks) ยท live ยท publish
โโโ Dockerfile # hardened container (non-root, 0.0.0.0 only here)
โโโ ROADMAP.md
โโโ pyproject.toml ยท CHANGELOG.md ยท LICENSE
โโโ CONTRIBUTING.md ยท CONTRIBUTING.de.md
โโโ SECURITY.md ยท SECURITY.de.md
โโโ README.md ยท README.de.mdNote (single-file tools): the 8 tools live in
server.pyrather than atools/package. At this count a single module stays readable; the registry (register_tools) keeps registration declarative. This is a deliberate deviation from the "split when > 5 tools" convention and will be revisited if the tool count grows. The offline-fallback logic is isolated infallback.py, cleanly separated from the live client.
Known Limitations
Search is limited to decisions indexed by entscheidsuche.ch (not all decisions are publicly available)
Full-text document content is not returned โ only metadata, title, and abstract
Statistics depend on Elasticsearch aggregation support of the backend
The court taxonomy structure from
Facetten_alle.jsonmay vary
Offline fallback (partial coverage โ read this): the fallback is a safety net for availability, not an equivalent mirror of the live source:
Court scope: Federal Supreme Court only (BGer/BGE). Bundesverwaltungsgericht, Bundesstrafgericht and all 26 cantonal courts are not covered.
Time span: 2007 โ December 2024 (the SCD dump's range). Decisions outside this window are not in the dump.
Content: metadata/regesten only โ no full text offline.
Update latency: the SCD dump is refreshed roughly quarterly on Zenodo, so the offline data lags the live index.
get_fallback_statusreports the cached version and can check Zenodo for a newer one.Law-reference search offline only matches references named in the decision's subject/regest (
topic/issue) โ there is no offline cited-law index.Responses always disclose their origin via
source(live/dump) and acoverage_note; the server never silently narrows coverage.
Testing
Unit tests mock all HTTP with respx; live tests hit the real API and run in a
separate nightly workflow (live.yml), never
blocking PRs.
Run from the project root with PYTHONPATH=src:
# Unit tests (HTTP mocked) โ what CI runs
PYTHONPATH=src pytest tests/ -v -m "not live"
# Live API tests (real entscheidsuche.ch + Zenodo)
PYTHONPATH=src pytest tests/ -v -m live
# Linting
ruff check src/ tests/
ruff format src/ tests/The offline-fallback tests use a small committed schema fixture
(tests/fixtures/scd_sample.csv) and mock the Zenodo download with respx โ
the full ~120 MB dump is never committed or downloaded in CI.
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md.
Security
See SECURITY.md for the security posture and how to report a vulnerability.
License
Author
Hayal Oezkan ยท malkreide
Credits & Related Projects
entscheidsuche.ch โ Swiss court decision search engine (live source)
Swiss Federal Supreme Court Dataset (SCD) โ offline fallback source, CC BY 4.0: Geering, F. & Merane, J. (2025). Swiss Federal Supreme Court Dataset (SCD), Version 2024-3. Zenodo. https://doi.org/10.5281/zenodo.14867950
fedlex-mcp โ MCP Server for Swiss federal law (legislation synergy)
zurich-opendata-mcp โ MCP Server for Zurich open data
Model Context Protocol โ Open protocol for AI tool integration
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-courts-mcp": {
"command": "uvx",
"args": [
"swiss-courts-mcp"
]
}
}
}Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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-courts-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server