AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP unreviewed MIT Self-run

Swiss Case Law

mcp-jonashertner-caselaw-repo-1 · by jonashertner

956k Swiss court decisions: full-text search, citation graph, statute lookup (DE/FR/IT)

No reviews yet
0 installs
29 views
0.0% view→install

Install

$ agentstack add mcp-jonashertner-caselaw-repo-1

Open-source listing, not yet scanned by AgentStack. Follow the source repository for install instructions.

Security review

⚠ Flagged

1 finding(s); flagged for manual review. · v1.0.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures
  • high Reads credentials/environment and may exfiltrate them.

What it can access

  • Network access Used
  • Filesystem access Used
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v1.0.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Reliability & compatibility

Not yet reviewed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Swiss Case Law? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Swiss Case Law Open Dataset

The complete machine-readable archive of Swiss case law and legislation — built for humans, designed for AI agents.

991,000+ court decisions · 5,519 federal laws · 15,589 cantonal laws · 8.6 M resolved citation edges (9.2 M extracted) · 11.8 M statute references · 83,958 Botschaft amendment references (5,900+ verbatim Botschaften ingested, scaling) · daily RFC-6962 Merkle root + OpenTimestamps anchor (cryptographic provenance) · cli:ch + ECLI identifiers on every decision

Figures as of 2026-06-21 — corpus refreshed daily; live counts at opencaselaw.ch.

Spans 1875 to today, covers every Swiss federal court and all 26 cantonal court systems (plus regulators: FINMA, ComCo, FDPIC, IndepBC, ElCom, PostCom, ComCom), mirrors federal legislation directly from Fedlex SPARQL and cantonal legislation by direct portal scraping for all 26 cantons (LexWork: 18 cantons; SIL: NE + JU; ZH OpenData; TI RL — the same publishing systems the cantons operate themselves) with LexFind PDF as fallback supplementing 4 cantons for laws missing from their primary portals and as the discovery catalog for 33,000+ legislative texts. Includes 83,958 Botschaft amendment references across 9,139 BBl publications, a Phase 2 verbatim Botschaft corpus (5,900+ documents, ~410K FTS5-indexed paragraphs, scaling via Fedlex SPARQL discovery), per-article Botschaft digests for BV/BGFA, parliamentary debate transcripts for the Bundesverfassung, a resolved citation graph, and 43 MCP tools (41 remote in public mode + 2 local-only) usable from Claude, ChatGPT, Cursor, Gemini, Grok, or any MCP/function-calling client. CC0 public-domain data, MIT-licensed code, no sign-up, no API keys, no paywall.

[](https://github.com/jonashertner/caselaw-repo-1/actions/workflows/ci.yml) [](https://opencaselaw.ch) [](https://huggingface.co/datasets/voilaj/swiss-caselaw) [](https://creativecommons.org/publicdomain/zero/1.0/) [](LICENSE)


Why this exists

Swiss legal research today is fragmented across paywalls, inaccessible to language models, and prohibitively expensive for the people who need it most — law students, independent researchers, and anyone outside the major firms. Commercial databases (Weblaw, Swisslex, Legalis) charge hundreds of francs per month and still don't expose a clean API. LLMs hallucinate statute text because they have no authoritative source. Small cantons publish decisions in PDF archives nobody indexes.

OpenCaseLaw fixes this. Every published Swiss court decision, every federal and cantonal law, the resolved citation graph between them, and 43 MCP tools (41 remote in public mode + 2 local-only) that let any modern LLM act as a Swiss legal research assistant — all free, all open, all refreshed automatically.

What you get

Case law — 991,000+ decisions from 1875 to today across 110 courts, full text + structured metadata, covering:

  • All 7 federal courts (BGer, BVGer, BStGer, BPatGer, BGE, BGE historical, BGE-EGMR)
  • Federal military court (Militärkassationsgericht / MKG, 1,244 decisions 1915–2025)
  • All 26 cantonal court systems (first, second, and third instance)
  • Regulatory decisions (FINMA, ComCo, FDPIC, IndepBC, ElCom, PostCom, ComCom)
  • ECHR/EGMR: 834 Swiss-respondent (HUDOC) + general ECtHR Grand Chamber/Chamber/Committee (1,421 judgments live, full-corpus backfill in progress)
  • Three official languages: German 463,012 (46.7%), French 446,869 (45.1%), Italian 81,796 (8.2%); schema reserves rm for Romansh
  • Deduplicated via docket normalisation + content-length-aware merge
  • Updated daily; BGer decisions available within ~15 minutes of court publication

Legislation — every Swiss law, federal and cantonal, locally mirrored with article-level indexing:

  • 5,519 federal laws / ~133,359 articles in each of DE/FR/IT from the Fedlex SPARQL endpoint
  • 15,589 cantonal laws / 361,430 articles, direct-scraped from all 26 cantons (LexWork covers 18, SIL covers 2, ZH OpenData covers ZH, TI~RL covers TI); LexFind PDF fallback supplements 4 cantons for laws missing from their primary portals
  • Unified SQLite FTS5 search federates both corpora; sub-millisecond article lookup
  • Monthly refresh on the 2nd of each month (the day after laws enter into force)
  • 11.8 M resolved links from decisions to individual statute articles

Citation graph — the only public large-scale citation graph of the Swiss legal system:

  • 8.6 M resolved decision-to-decision citation edges (9.2 M extracted) with confidence scores
  • 11.8 M decision-to-statute links resolved against the current consolidated text
  • Bidirectional lookup, appeal-chain resolution (Instanzenzug), leading-case ranking by citation authority
  • Powers find_leading_cases, find_citations, find_appeal_chain, analyze_legal_trend (top: BGE 125 V 351 with 85,108 incoming citations)

43 MCP tools (41 remote in public mode + 2 local-only) — specialised research tools that run in your LLM of choice:

  • Natural-language decision search (BM25 + synonym expansion + Haiku reranking, MRR@10 = 0.647 on a 100-query golden set)
  • Leading-case discovery, citation networks, appeal chains, jurisprudence evolution
  • Federal + cantonal law article lookup, full-text search across both — with colloquial→legal vocabulary expansion (searching "Vaterschaftsurlaub" finds the statute even though it says "Urlaub des andern Elternteils") and cross-language cantonal search (German query finds French/Italian cantonal laws)
  • Doctrine overviews (statute + authority-ranked BGEs + timeline + Botschaft reference)
  • Legislative history (Materialien) — 83,958 Botschaft amendment references across 9,139 BBl publications and 33,465 distinct (statute, article) pairs; Phase 2 verbatim Botschaft corpus (5,900+ documents, ~410K FTS5-indexed paragraphs) accessible via search_botschaft (topical FTS5 across the verbatim corpus), get_article_purpose (verbatim Botschaft text for a specific article), and get_article_history (chronological timeline composing statute + Botschaft + leading cases + commentary); per-article digests (legislative intent, key arguments, design choices, rejected alternatives) for BV and BGFA; parliamentary debate transcripts for the BV. Full verbatim ingest to ~25K Botschaften via Fedlex SPARQL discovery is scaling.
  • Decision-structure accessget_decision_structure (Sachverhalt + Erwägungen + Dispositiv + Regeste split), get_erwaegung (verbatim Schweizer-citation Einheit, e.g. get_erwaegung("BGE 140 III 86", "2.3")), get_regeste (official BGer/BVGer/BStGer head-note)
  • Scholarly commentary lookup from OnlineKommentar.ch + OpenLegalCommentary.ch (1,131 commentaries)
  • Fallbearbeitung exam questions generated from real BGE fact patterns, with hidden analysis for practice
  • Draft mock decisions from fact patterns (research-only tool for grounding LLM outputs)
  • Structured case briefs (regeste, Sachverhalt, Erwägungen, Dispositiv, cited statutes, authority)

Multiple access paths — same data, two distinct audiences:

For LLM users, researchers and developers — full 24-tool surface:

  • Remote MCP server at mcp.opencaselaw.ch (SSE + Streamable HTTP) — 30-second setup in any MCP client (Claude, ChatGPT, Cursor, Gemini, Windsurf)
  • [OpenAI-compatible tool definitions](docs/openai-tools.json) for Grok/xAI and any function-calling LLM API
  • Local MCP server — full offline capability, 40 tools (38 remote in public mode + 2 local-only), ~65 GB disk
  • 30-route REST API with interactive documentation (Swagger UI + OpenAPI spec)
  • Bulk Parquet download via the HuggingFace dataset (~7 GB)
  • Live dashboard + browsing UI at opencaselaw.ch

For legal practitioners drafting documents — curated practitioner surface:

  • Word add-in — Search decisions and insert correctly-formatted Swiss legal citations directly in Word (no copy-paste). Click an Erwägung to insert it with the correct sub-citation; click a law § to insert that alinea. Free Audit scans the whole document for fabricated citations and bad pinpoints (deterministic, no LLM). Pro tier (Stripe-billed, CHF 5/month, 25 AI calls/day shared, structural PII redaction) adds four AI tools: Verify (single citation vs. full-text decision), Strengthen (paragraph x-ray with leading-case suggestions ranked by citation-graph centrality + commentary excerpts), Find Support (locate decisions that back an unsupported statement, scored 0–100), and Reflect (literary mirror on the whole document — one canonical work that frames the same human dilemma + one reflective question). Exposes ~8 of the 43 MCP tools (41 remote in public mode + 2 local-only) through the REST API, tuned for the write-your-brief workflow.

Performance you can defend in a paper:

| Metric | Value | |---|---| | Decision search quality | MRR@10 = 0.647 (online) / 0.470 (offline reproducible) · +102 % over baseline | | Article lookup latency | Not sure where to start? Connect to the [remote MCP server](#option-a-remote-server-recommended) — works with Claude, ChatGPT, and Gemini CLI. Instant access to all 969K+ decisions, citation analysis, statute lookup, legislation search, and education tools, no download needed.


1. Search with AI

The dataset comes with an MCP server whose exact tool surface is deployment-dependent. Local deployments expose all 40 tools; remote mode omits the 2 local-only update tools (update_database, check_update_status) for 38 remote tools. You ask a question in natural language; the tool runs a full-text search and returns matching decisions with snippets.

Remote vs. local

| | Remote | Local | |---|---|---| | Setup | 30 seconds | 30–60 minutes | | Disk | None | ~65 GB | | Tools | 38 (no local update tools) | 40, including update_database and check_update_status | | Freshness | Nightly (automatic) | Manual | | Offline | No | Yes | | Requires | Claude, ChatGPT, or Gemini CLI (see plans below) | Any MCP client |

> Start with the remote server. Switch to local only if you need offline access.

Option A: Remote server (recommended)

Connect directly to the hosted MCP server — no data download, no local database, instant access to 968K+ decisions.

Claude.ai / Claude Desktop (easiest):

  1. Open SettingsConnectors
  2. Click "Add custom connector"
  3. Paste https://mcp.opencaselaw.ch
  4. Click Add

Same steps in the browser (claude.ai) and the desktop app. No Node.js, no config files, no downloads.

> Available on Pro, Max, Team, and Enterprise plans. For the free plan, use Claude Code or the [manual JSON config](#alternative-manual-json-config-if-custom-connectors-arent-available).

Claude Code:

claude mcp add swiss-caselaw --transport sse https://mcp.opencaselaw.ch

Alternative: manual JSON config (if custom connectors aren't available)

Add to claude_desktop_config.json (Node.js required):

{
  "mcpServers": {
    "swiss-caselaw": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.opencaselaw.ch"]
    }
  }
}

Restart Claude Desktop after saving.

ChatGPT:

  1. Open SettingsAppsAdvanced settings → enable Developer mode
  2. Click Create app → name it Swiss Caselaw, paste https://mcp.opencaselaw.ch/sse, auth: None
  3. In any chat: click +Developer mode → select Swiss Caselaw

> Available on Plus, Pro, Team, Enterprise, and Edu plans. Recommended with GPT-5.3 (GPT-5.4 does not currently support MCP tool invocation).

Gemini CLI:

Add to ~/.gemini/settings.json:

{
  "mcpServers": {
    "swiss-caselaw": {
      "url": "https://mcp.opencaselaw.ch"
    }
  }
}

Restart Gemini CLI after saving. No account plan required — Gemini CLI is free.

Google ADK (Agent Development Kit):

Build a Gemini-powered agent with access to all tools:

from google.adk.agents import LlmAgent
from google.adk.tools import MCPToolset
from mcp.client.sse import SseConnectionParams

agent = LlmAgent(
    model="gemini-3.1-pro",
    name="swiss_law_agent",
    instruction="You are a Swiss legal research assistant.",
    tools=[
        MCPToolset(
            connection_params=SseConnectionParams(
                url="https://mcp.opencaselaw.ch/sse",
            ),
        ),
    ],
)

See the [full MCP setup guide](docs/claude-desktop-setup.md) for Google Gen AI SDK examples and all other platforms.

> See the [full MCP setup guide](docs/claude-desktop-setup.md) for detailed instructions for all platforms.

> The update_database and check_update_status tools are only available on the local server — the remote dataset is updated automatically every night.

Option B: Local server (offline access)

Run the MCP server locally with your own copy of the database (~65 GB disk). This gives you offline access and full control over the data.

Setup with Claude Code

Claude Code is Anthropic's CLI for working with Claude in the terminal.

Step 1. Clone this repository:

git clone https://github.com/jonashertner/caselaw-repo-1.git
cd caselaw-repo-1

Step 2. Create a virtual environment and install the MCP server dependencies:

python3 -m venv .venv

# macOS / Linux
source .venv/bin/activate
pip install mcp pydantic huggingface-hub pyarrow fastapi

# Windows (PowerShell)
.venv\Scripts\Activate.ps1
pip install mcp pydantic huggingface-hub pyarrow

Step 3. Register the MCP server with Claude Code:

# macOS / Linux
claude mcp add swiss-caselaw -- /path/to/caselaw-repo-1/.venv/bin/python3 /path/to/caselaw-repo-1/mcp_server.py

# Windows
claude mcp add swiss-caselaw -- C:\path\to\caselaw-repo-1\.venv\Scripts\python.exe C:\path\to\caselaw-repo-1\mcp_server.py

Use the full absolute path to the Python binary inside .venv so that the server always finds its dependencies, regardless of which directory you run Claude Code from.

Step 4. Restart Claude Code and run your first search.

On first use, the server automatically:

  1. Downloads all Parquet files (~7 GB) from HuggingFace to ~/.swiss-caselaw/parquet/
  2. Builds a local SQLite FTS5 full-text search index at ~/.swiss-caselaw/decisions.db (~58 GB)

This takes 30–60 minutes depending on your machine and connection. It only happens once — after that, searches run instantly against the local database.

Total disk usage: ~65 GB in ~/.swiss-caselaw/ (macOS/Linux) or %USERPROFILE%\.swiss-caselaw\ (Windows).

Setup with Claude Desktop

See the [Claude Desktop setup guide](docs/claude-desktop-setup.md) for step-by-step instructions (macOS + Windows).

Quick version — add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "swiss-caselaw": {
      "command": "/path/to/caselaw-repo-1/.venv/bin/python3",
      "args": ["/path/to/caselaw-repo-1/mcp_server.py"]
    }
  }
}

Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows). On Windows, use .venv\\Scripts\\python.exe instead.

Any MCP-compatible client works with the same command + args pattern.

Keeping the data current

The dataset is updated daily. To get the latest decisions, ask Claude to run the update_database tool, or call it explicitly. This re-downloads the Parquet files from HuggingFace and rebuilds the local database.

SQLite snapshot artifacts

The HuggingFace dataset may also publish a full compressed SQLite base snapshot for bootstra

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v1.0.0 Imported from the upstream source.