Server data from the Official MCP Registry
Swiss court decisions via entscheidsuche.ch, including federal and cantonal courts
Swiss court decisions via entscheidsuche.ch, including federal and cantonal courts
Valid MCP server (1 strong, 3 medium validity signals). No known CVEs in dependencies. Package registry verified. Imported from the Official MCP Registry.
4 files analyzed ยท 1 issue found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-malkreide-swiss-courts-mcp": {
"args": [
"swiss-courts-mcp"
],
"command": "uvx"
}
}
}From the project's GitHub README.
Part of the Swiss Public Data MCP Portfolio
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
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.
pip install swiss-courts-mcp
Or install from source:
git clone https://github.com/malkreide/swiss-courts-mcp.git
cd swiss-courts-mcp
pip install -e ".[dev]"
# Run directly
swiss-courts-mcp
# Or via Python module
python -m swiss_courts_mcp
Add to your claude_desktop_config.json:
{
"mcpServers": {
"swiss-courts": {
"command": "python",
"args": ["-m", "swiss_courts_mcp"]
}
}
}
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-mcp
Relevant environment variables (see .env.example):
| Variable | Default | Purpose |
|---|---|---|
MCP_HOST | 127.0.0.1 | Bind host. Set to 0.0.0.0 only in containers. |
MCP_PORT | 8000 | Bind port. |
MCP_ALLOW_PUBLIC_BIND | false | Suppress the 0.0.0.0 warning (containers). |
MCP_STATELESS_HTTP | true | Stateless HTTP โ horizontal scaling without sticky sessions. |
MCP_AUTH_ENABLED | false | Enable bearer-token auth for HTTP. |
MCP_AUTH_SECRET | โ | HS256 signing key (dev). |
MCP_OAUTH_JWKS_URL | โ | JWKS URL for RS256 validation (production). |
MCP_REQUIRED_SCOPES | โ | Comma-separated required scopes. |
MCP_CORS_ORIGINS | โ | Comma-separated allowed origins (no wildcard in prod). |
Authentication validates the user identity from the JWT sub claim only; see
ADR 0001.
| Variable | Default | Purpose |
|---|---|---|
SWISS_COURTS_FALLBACK_ENABLED | true | Master switch. 0 disables the dump fallback (live-only). |
SWISS_COURTS_FORCE_DUMP | false | Force the dump path (skip live) โ for pre-warming the cache or offline testing. |
SWISS_COURTS_CACHE_DIR | platformdirs cache | Override the cache directory for the downloaded dump. |
SWISS_COURTS_DUMP_RECORD | 14867950 | 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 search
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.
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.
| Tool | Description |
|---|---|
search_court_decisions | Full-text search across all court decisions with canton, court level, and date filters |
get_court_decision | Retrieve a single decision by its unique signature |
search_bger_decisions | Search Federal Supreme Court decisions with optional chamber filter |
search_by_law_reference | Find decisions citing a specific law article (e.g., "Art. 8 BV") |
| Tool | Description |
|---|---|
list_courts | List all indexed courts, optionally filtered by canton |
get_recent_decisions | Latest decisions, filterable by canton and court level |
get_decision_statistics | Statistics on indexed decisions by canton and year |
get_fallback_status | Offline-dump cache state, coverage, version, pre-warming (read-only) |
All eight tools share the same hints โ they are read-only, idempotent, non-destructive, and reach an external system:
| Annotation | Value |
|---|---|
readOnlyHint | true |
destructiveHint | false |
idempotentHint | true |
openWorldHint | true |
A rechtsrecherche prompt is also provided (a second MCP primitive
alongside tools).
| Use Case | Tool Chain |
|---|---|
| Research case law on data protection | search_court_decisions("Datenschutz") |
| Find practice on a constitutional right | search_by_law_reference("Art. 8 BV") |
| Latest Federal Supreme Court rulings | search_bger_decisions("Arbeitsrecht", date_from="2024-01-01") |
| Combined: Law text + case law | fedlex_search_laws("DSG") then search_by_law_reference("Art. 25 DSG") |
โ More use cases by audience โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
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:
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 heavy pyarrow dependency were rejected: a
partial fallback does not justify the footprint, and full text would fake an
equivalence that does not exist (BGer only).5529712
("SwissJudgmentPrediction") is CC BY-NC-SA 4.0 โ incompatible with this
MIT project.platformdirs) and searched via
SQLite; update detection uses the Zenodo versions API (conceptrecid
7793043). Every response declares source (live/dump) and dump responses
add a coverage_note. CC-BY attribution ships in the tool output, not
only here.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:
get_court_decision is 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.Inspect the cache and coverage at any time with get_fallback_status.
| Aspect | Details |
|---|---|
| Access | Read-only (readOnlyHint: true) โ the server cannot modify or delete any data |
| 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, sub-claim identity); see ADR 0001 |
| Egress | Code-layer allow-lists (entscheidsuche.ch for live; zenodo.org for the offline dump), HTTPS-enforced; see egress policy |
| Error masking | Internal exceptions are logged server-side only; clients receive friendly messages |
| Secrets | No secrets in code/logs; .env git-ignored, Gitleaks on PRs; see secret management |
| 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 |
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.md
Note (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.
Facetten_alle.json may varyOffline fallback (partial coverage โ read this): the fallback is a safety net for availability, not an equivalent mirror of the live source:
get_fallback_status reports the cached
version and can check Zenodo for a newer one.topic/issue) โ there is no offline cited-law index.source (live/dump) and a
coverage_note; the server never silently narrows coverage.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.
See CHANGELOG.md.
See CONTRIBUTING.md.
See SECURITY.md for the security posture and how to report a vulnerability.
Hayal Oezkan ยท malkreide
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"
]
}
}
}
Be the first to review this server!
by Modelcontextprotocol ยท Developer Tools
Web content fetching and conversion for efficient LLM usage
by Toleno ยท Developer Tools
Toleno Network MCP Server โ Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace ยท Developer Tools
Create, build, and publish Python MCP servers to PyPI โ conversationally.