Search DevTools

Jump to any tool or page

OpenCaseLaw — Swiss Caselaw, Statutes & Doctrine

Unexplored

1M+ Swiss court decisions, statutes & doctrine with citation graph (DE/FR/IT). CC0, free, 42 tools.

jonashertner57 stars17 forksAI & Agents
View source

Install

mcp_config.json

{
  "mcpServers": {
    "ch-opencaselaw-swiss-caselaw": {
      "url": "https://mcp.opencaselaw.ch/mcp",
      "type": "streamable-http"
    }
  }
}

Documentation

OpenCaseLaw

Open Swiss case law and legislation for legal research and AI.

1M+ decisions · all 26 cantons · 1875–today · citation graph · MCP + REST + CLI + Parquet · CC0 data · MIT code

Try the search · Chat with your AI · Automate research · Download the dataset · API documentation

What you can do

  • Find Swiss decisions across federal and cantonal courts, in German, French and Italian.
  • Trace citations between cases and identify the leading decisions on a question.
  • Query case law and legislation from Claude, ChatGPT-compatible clients, or any MCP client.
  • Save repeatable research scripts, inspect citation resolution, and preserve selected evidence with the research CLI.
  • Download the corpus for legal NLP, retrieval and graph research.

Connect in 30 seconds

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

No sign-up, no API key, read-only. 42 tools; setup guides for individual clients are at opencaselaw.ch/mcp.

Using Anthropic's Claude for Legal plugin? A Swiss playbook that makes its contract-review and NDA-triage skills work under Swiss law, every article verified against the statute mirror, is at opencaselaw.ch/claude/legal.local.md; see the setup guide.

Automate research

ocl is a small command-line client over the public research API, made for two jobs a chat window does badly: checking the citations in a draft, and keeping the evidence behind a memo in a folder you can share. It is on PyPI as opencaselaw-cli:

pipx install opencaselaw-cli        # or: uv tool install opencaselaw-cli
ocl citations resolve 'BGE 136 III 513' '4A_747/2012' 'BGE 999 III 1'
ocl bundle create 'Rachekündigung Art. 336 OR' --max-results 10 --passage 2 --law OR:336 --out evidence

The first prints, per reference, whether the decision exists, which one it is, and whether a requested Erwägung exists. The second saves the selected decisions, passages and statute articles into a folder with a plain-language INDEX.md and a hashed manifest.json. Everything comes back from the service unchanged: citation strings, passage text, source links. Search is bounded, and a citation check establishes existence, not that an authority supports a proposition. See the CLI guide.

Use MCP for conversations, the CLI or REST API for automation, and Parquet for corpus-scale analysis.

A real result

Question. When is a dismissal in retaliation for an employee asserting a claim abusive under Swiss law?

One callsearch_decisions("missbräuchliche Kündigung Rachekündigung") returns 129 decisions, the leading one first:

BGE 136 III 513 (7 October 2010)

Art. 336 OR; missbräuchliche Kündigung. Der Arbeitnehmer ist vor einer Rachekündigung nur geschützt (Art. 336 Abs. 1 lit. d OR), sofern er nach Treu und Glauben annehmen kann, dass die von ihm geltend gemachten Ansprüche berechtigt sind. Es ist nicht erforderlich, dass sie tatsächlich begründet sind.

The Regeste is returned verbatim from the stored official head-note, and the citation string comes from a stored field — tools never construct citations. That contract is what makes the answer checkable rather than plausible.

Reproduce it:

curl -sG https://mcp.opencaselaw.ch/api/decisions \
  --data-urlencode "q=missbräuchliche Kündigung Rachekündigung" \
  --data-urlencode "limit=3"

Coverage

ResourceCoverage
Court decisions1,050,000+ records, 118 court and source collections, 1875–today
LanguagesGerman, French, Italian (plus English, for the ECtHR judgments whose only authoritative text is English)
Legislation5,525 federal laws, 15,600 cantonal laws (all 26 cantons)
Citation graph~10M resolved decision-to-decision edges, 12.4M statute references
Interpretive layersFederal Council dispatches, commentaries, open-access scholarship, federal administrative practice
AccessWeb, MCP, REST, research CLI, daily CC0 Parquet
LicensingCC0 data, MIT code (ECtHR texts © ECHR-CEDH, see the data card)

Counts are generated from one source of truth, docs/canonical_numbers.md, with the verification method recorded alongside each figure.

Limitations, stated plainly. Coverage is not complete where portals restrict access; those sources are documented rather than glossed. The citation graph reports resolution coverage (93.8 %), which is not a precision estimate — a human semantic audit is in preparation. Some cantonal decisions may be published unredacted by the court; we inherit upstream pseudonymisation and do not re-pseudonymise. See governance and removal policy.

Contributing

Data-quality reports are the most valuable contribution — every one so far has been reproduced, fixed and pinned with a regression test. See CONTRIBUTING.md.


The remainder of this page is reference detail.

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 44 MCP tools (42 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 — 1,050,000+ decision records (~909,000 unique decisions; cross-identifier duplicates retained and linked, never deleted) from 1875 to today across 118 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: the Swiss-respondent material (487 BGE-published EGMR translations, 847 HUDOC Switzerland-tagged) plus every ECtHR Chamber and Grand Chamber judgment of importance 1–3 against any of the 46 respondent states — 8,275 judgments, in French where the Court published a French text and English otherwise. Importance 4 (low-importance and repetitive, which is the entire Committee docket) and admissibility decisions are out of scope.
  • 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,525 federal laws / ~133,359 articles in each of DE/FR/IT from the Fedlex SPARQL endpoint
  • 15,600 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)
  • 12.4 M resolved links from decisions to individual statute articles

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

  • 9.65 M resolved decision-to-decision citation edges (10 M extracted) with confidence scores
  • 12.4 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)

44 MCP tools (42 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 136 III 513", "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 — chat with your AI, automate research, or download the corpus:

For LLM users, researchers and developers:

  • 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 for Grok/xAI and any function-calling LLM API
  • Local MCP server — full offline capability, all 44 tools (the 2 local-only update tools are available offline), ~65 GB disk
  • Lightweight research CLI — JSON/JSONL, batch input, saved evidence bundles and citation resolution; pipx install opencaselaw-cli; source in clients/python/
  • 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, always-on client-side PII redaction — pattern-based, scope and limits at word.opencaselaw.ch/privacy.html) 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 44 MCP tools (42 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:

MetricValue
Decision search qualityMRR@10 = 0.647 (online) / 0.470 (offline reproducible) · +102 % over baseline
Article lookup latency< 1 ms (local FTS5)
BGer publication → searchable~15 min (was 24 h pre-poller)
Daily full-text rebuild~5 h, zero downtime (atomic swap)
Citation-to-decision resolution9.65 M edges resolved (10 M extracted)

What this is

A structured, searchable archive of Swiss court decisions — from the Federal Supreme Court (BGer) down to cantonal courts in all 26 cantons. Every decision includes the full decision text, docket number, date, language, legal area, judges, cited decisions, and 20+ additional metadata fields.

The dataset is built by direct scraping of official court websites and cantonal court portals. New decisions are scraped, deduplicated, and published every night.

There are eight ways to use it, depending on what you need:

MethodFor whomWhat you get
Search with AIEveryoneNatural-language search in Claude, ChatGPT, Cursor, or Gemini — instant access, no download, full 24-tool surface
Citation AnalysisLegal scholars, researchersLeading cases, citation networks, appeal chains, jurisprudence trends over time
Statute LookupLegal professionalsFull article text from 5,525 federal laws and 15,600 cantonal laws, federated FTS5, sub-millisecond lookup
Legislation SearchLegal professionalsLexFind-backed discovery search with fetch_top_n_texts for single-call natural-language workflows
Education toolsLaw students, instructorsStructured case briefs, doctrine timelines, real-BGE exam questions with hidden analysis
Word Add-inLegal practitioners writing briefsInsert formatted Swiss citations into Word · click Erwägung / § to insert with correct sub-reference · free Audit (5-rail citation check) · Pro (CHF 5/mo, 25 AI calls/day): Verify (citation vs. full text) · Strengthen (paragraph x-ray + leading-case suggestions) · Find Support (decisions backing a statement) · Reflect (literary mirror) — curated ~8-tool subset
REST API / DownloadDevelopers, data scientists, NLP researchersResearch REST API, bulk Parquet download via HuggingFace (~7 GB)
Web UIEveryoneLive dashboard with corpus stats, daily delta, top movers, multilingual browsing

Not sure where to start? Connect to the remote MCP server — works with Claude, ChatGPT, and Gemini CLI. Instant access to all 1,050,000+ 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 44 tools; remote mode omits the 2 local-only update tools (update_database, check_update_status) for 42 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

RemoteLocal
Setup30 seconds30–60 minutes
DiskNone~65 GB
Tools38 (no local update tools)40, including update_database and check_update_status
FreshnessNightly (automatic)Manual
OfflineNoYes
RequiresClaude, 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 1,050,000+ decisions.

What the hosted server records. Your queries are logged: tool, parameters including the query text, timestamp, client class and a rotating session identifier, and query text is kept indefinitely in an access-restricted private research archive used to improve search and train our own models. No IP address is stored with a query, there is no account or login, and the session identifier changes with every connection. Full details, in five languages: Privacy notice. If your queries are confidential — or you are sending them on behalf of clients — use Option B below and run the corpus locally, where nothing leaves your machine.

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.

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://m

Sourced from the repository README.

More in AI & Agents