legal-text-mcp-de MCP Server
German federal & state legal texts (BGB, DSGVO, …) with canonical IDs and cite-grade provenance.
legal-text-mcp-de scores 67 (Good), licensed Apache-2.0 and written in Python. It installs as a local process. It does not declare tools yet. Filed under Uncategorized. GitHub shows 2 stars. Package registries report about 35 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Good trust
67 of 100 from six public signals. Nobody can buy a point.
- Listed in the official MCP registry.
- OSI-style license: apache-2.0.
License, quality and maintenance
Quality: Grade C
65/100 for listing completeness. Lost points: no listed tools, short summary.
How quality is graded
Where the 67 comes from
22 + 20 + 4 + 10 + 4 + 7 = 67. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 22 of 30 points.How recently the repository saw a commit or release.
Maintenance: 20 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 4 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 4 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 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.
{ "mcpServers": { "klein-business-legal-text-mcp-de": { "command": "uvx", "args": [ "legal-text-mcp-de" ], "env": { "DATASET_PATH": "", "STRICT_DATASET": "false", "ANTHROPIC_API_KEY": "YOUR_ANTHROPIC_API_KEY" } } }}
Environment variables
| Name | Required | Notes |
|---|---|---|
DATASET_PATH | Optional | Path to a normalised corpus directory or a corpus archive (legal-texts-de-*.tar.zst). Defaults to the bundled fixture; production deployments should mount /data/corpus/latest.tar.zst. |
STRICT_DATASET | Optional | Set to 'true' to refuse to start if the dataset cannot be loaded (recommended for hosted deployments). |
ANTHROPIC_API_KEYSecret | Optional | Optional. Required only for the smart `research_topic` tool which uses LLM-assisted synthesis. Without it, the tool degrades gracefully to a ranked-search fallback. |
DATASET_PATH | Optional | Mount path inside the container for the legal-text corpus. |
STRICT_DATASET | Optional | Set to 'true' to refuse to start if the dataset cannot be loaded. |
Tools
All capabilitiesTools show up when the registry metadata or the repository README lists them. Public READMEs are read directly. A GitHub token is used only when one is already configured.
About
legal-text-mcp-de
Cite-grade German legal-text infrastructure for LLM agents. ~8 500 federal + Länder + EU laws via MCP, HTTP API, and a typer shell CLI — all over the same runtime, with cryptographic provenance from gesetze-im-internet.de and EUR-Lex / Cellar.
It is local or server-side infrastructure: no SaaS, no billing, no
accounts, no tenant model, and no legal advice. The runtime loads
either the committed fixture packages used by fast CI or a generated
production corpus package built outside Git. Official text comes from
gesetze-im-internet.de for German federal laws and from EUR-Lex /
Cellar for EU acts such as the GDPR.
No legal advice. This software returns text and structured metadata. It does not interpret the law, advise on it, or produce any legal conclusion. The maintainer assumes no liability for use in legal decision-making contexts.
Older internal documentation has been archived under docs-legacy/summary.md.
Status
| Lifecycle | Stable v2.1.3 (current patch on v2.1.0 typer-CLI minor) — MCP-native domain server with typer CLI |
| Versioning | SemVer 2.0.0 (stability contract starts at v1.0.0) |
| Licence | Apache License 2.0 — see LICENSE and NOTICE |
| Upstream | Derived from floleuerer/deutsche-gesetze-mcp (MIT, preserved) |
Features
- MCP tools for listing laws, fetching norms, resolving citations, full-text search, and source provenance.
- HTTP API (FastAPI) over the same runtime, with structured
/health,/ready,/laws,/search, and OpenAPI endpoints. - Provenance-first design: every law and norm carries source URL, fetch timestamp, content hash, and the parser path it traversed.
- Two corpus modes: committed fixture packages for deterministic tests and CI, or a generated production package built from official sources at runtime.
- No editorial bundling: this repository ships tooling, not legal text. Texts are loaded from official sources at runtime.
Installation
pip or uvx with an explicit dataset
pip install legal-text-mcp-de==2.1.3
DATASET_PATH=/path/to/dataset legal-text-mcp-de serve
# Or:
DATASET_PATH=/path/to/dataset uvx legal-text-mcp-de==2.1.3 serve
- The package and standard Docker image contain the runtime only.
DATASET_PATHmust point to a normalized dataset directory withlaws.json,norms.json, andsearch-index.json.- Public corpus OCI references and the
-fullimage currently returnDENIED; there is no verified public corpus download. - The CLI and HTTP runtime do not automatically prepare a usable dataset. A
.tar.zstbundle is not a supported direct runtime path. - Build the nine registered federal laws from official sources using the federal corpus guide. This requires the current source checkout and includes a fix beyond v2.1.3.
prepare_data.build_corpus --sources bundis not implemented. Its archive output is separate from the serving dataset format.
Docker with a mounted dataset
docker run -p 8001:8001 \
-v /absolute/path/to/dataset:/data/legal-texts:ro \
ghcr.io/klein-business/legal-text-mcp-de:2.1.3 \
uv run --frozen --no-sync legal-text-mcp-de http
- Use a dataset compatible with the selected runtime version.
/healthchecks the process;/readychecks whether the HTTP API can serve its dataset.- For freshly built federal data, follow the guide's source-image build instructions.
Mode 5 — Public-hosted service
// claude_desktop_config.json
{
"mcpServers": {
"legal-de": {
"url": "https://mcp.klein.business/legal/de",
"transport": "streamable-http"
}
}
}
CLI
legal-text-mcp-de ships a full subcommand CLI. Bare invocation prints
--help. Common commands:
legal-text-mcp-de serve # start the MCP server (replaces the v2.0 bare invocation)
legal-text-mcp-de http # start the FastAPI HTTP API
legal-text-mcp-de laws --query DSGVO # list laws
legal-text-mcp-de norm BGB "§ 433" # fetch a single norm
legal-text-mcp-de search Werbung # full-text search
legal-text-mcp-de corpus info # inspect locally cached bundle metadata
legal-text-mcp-de version # version + Python + platform
Place --json or --output yaml before the subcommand for machine-readable
output; the data field contains the HTTP response shape. See CLI reference for
the full subcommand list.
BREAKING in v2.1.0: bare
legal-text-mcp-denow prints--help. Appendserveto keep the v2.0 behaviour (started the MCP server).
Quickstart
MCP-client compatibility
- Tested requires a recorded client version, transport, successful
tools/list, and one successful tool call. - Configuration examples alone are not test evidence. Client runs below remain [UNVERIFIED]; protocol-level CI does not establish desktop-client compatibility.
| Client | Tested | stdio | streamable-HTTP | Setup / evidence request |
|---|---|---|---|---|
| Claude Desktop | Pending | [UNVERIFIED] | [UNVERIFIED] | Quickstart |
| Cursor | Pending | [UNVERIFIED] | [UNVERIFIED] | Quickstart |
| Continue | Pending | [UNVERIFIED] | [UNVERIFIED] | Report a client test |
| Cline | Pending | [UNVERIFIED] | [UNVERIFIED] | Report a client test |
| Zed | Pending | [UNVERIFIED] | [UNVERIFIED] | Report a client test |
Run the MCP server with the committed fixture corpus
uv sync --all-groups
DATASET_PATH=tests/fixtures/normalized \
STRICT_STARTUP=true \
uv run legal-text-mcp-de serve
The default transport is streamable HTTP at
http://localhost:8001/mcp. The CLI does not expose stdio; see
stdio transport status.
Dev shortcut. A
Justfilewraps the commonuvinvocations (just install,just test,just lint,just run,just api,just docs). Install viabrew install just. The Justfile is optional — CI only usesuvdirectly.
Run the HTTP API
Since v2.1 the easiest way is the new CLI:
DATASET_PATH=tests/fixtures/normalized \
STRICT_STARTUP=true \
uv run legal-text-mcp-de http
The default port is 8001 (from settings.port / PORT env var); use
--port <N> to override.
Or directly via uvicorn (equivalent — same FastAPI app):
DATASET_PATH=tests/fixtures/normalized \
STRICT_STARTUP=true \
uv run uvicorn legal_text_mcp_de.http_api:app --host 127.0.0.1 --port 8001
The HTTP layer enforces MAX_REQUEST_BODY_BYTES (default 1048576 = 1 MiB)
as a defence-in-depth body-size cap; over-limit requests return 413 Payload Too Large. The operator's reverse proxy is still expected to
enforce a proxy-level limit on top of this.
Docker
The Docker image does not bundle legal text data. Mount a validated
package at /data/legal-texts:
docker run --rm -p 8001:8001 \
-v /path/to/legal-text-package:/data/legal-texts:ro \
ghcr.io/klein-business/legal-text-mcp-de:2.1.3 serve
- See
examples/docker-compose/http/for a minimal HTTP-mode Compose example. - See
examples/docker-compose/production/for a committed, CI-tested production stack (MCP + HTTP behind Caddy, switchable via Compose profiles).
MCP Resources
Since v2.0, the corpus is exposed as read-only legal:// URIs that any MCP client can load directly into its LLM context. Examples:
legal://laws— paginated indexlegal://laws/bgb— BGB header + norm indexlegal://laws/bgb/norms/par:433— § 433 BGB as Markdownlegal://corpus/coverage— what's in the corpus
See docs/concepts/mcp-native.md for the full URI catalogue.
MCP Prompts (slash-commands)
Five curated workflows appear as slash-commands in MCP clients:
| Slash | Args | Purpose |
|---|---|---|
/rechtsfrage | frage, rechtsgebiet? | Answer a German legal question with exact norm citations |
/zitation-checken | citation | Resolve a citation (e.g. § 433 Abs. 1 BGB) + Stand-Datum |
/norm-erklaeren | code, norm | Plain-language explanation with cited cross-references |
/recherche | topic | Multi-step research using research_topic smart tool |
/dsgvo-check | aktivitaet | Walk through GDPR Art. 5, 6, 7, 9, 13, 14 against a processing activity |
Smart Tools
research_topic is a multi-step research tool that orchestrates 2 LLM-sampling calls per invocation:
- Corpus search for candidate norms
- LLM ranking of candidates by relevance
- Related-norms graph loading
- LLM synthesis of a structured research report
When the client lacks sampling support, the tool returns a degraded report with ranked candidates only.
Data Sources
| Source | Coverage | Reuse position |
|---|---|---|
gesetze-im-internet.de | German federal laws | Public-domain-equivalent under §5 (1) UrhG |
EUR-Lex / Cellar (publications.europa.eu) | EU acts (GDPR, AI Act, Data Act, …) | Reuse permitted under Commission Decision 2011/833/EU with attribution |
No text from these sources is committed to this repository. The generated-corpus pipeline fetches them at build time and stores provenance in a manifest.
MCP Tools
See the MCP tools reference for the full surface. Highlights:
list_laws(query?)— list loaded laws with optional metadata filter.get_law(code)— law metadata + normalised norm summaries.get_norm(code, norm)— return one structured norm.search_laws(query, codes?)— search normalised texts.resolve_citation(...)— resolve structured citations without legal interpretation.get_source_metadata(code?),get_source_limitations(...),get_corpus_coverage(),get_related_norms(code, norm).
MCP tools return JSON-compatible objects. They do not return double-serialised JSON strings.
HTTP API
| Method | Path | Purpose |
|---|---|---|
GET | /health | Liveness |
GET | /ready | Readiness |
GET | /laws | List laws |
GET | /laws/{code} | Law detail |
GET | /laws/{code}/norms/{norm} | Norm detail |
GET | /laws/{code}/norms/{norm}/relationships | Relationship metadata |
GET | /corpus/coverage | Corpus coverage summary |
GET | /corpus/source-limitations | Source limitations query |
GET | /search | Search |
GET | /openapi.json | OpenAPI document |
Article-plus-section paths must be URL-encoded:
/laws/egbgb/norms/art%3A246a%2Fpar%3A1
Documentation
Full documentation is published at klein-business.github.io/legal-text-mcp-de.
Quick links:
- Quickstart
- MCP tools
- HTTP API
- Operations: security, SBOM, cosign-verify, versioning, threat model
- Roadmap
Source-of-truth documents live in the repo: README.md, CHANGELOG.md, SECURITY.md, CONTRIBUTING.md, GOVERNANCE.md, NOTICE, LICENSE.
Development
uv sync --all-groups
uv run --group dev pytest
The full fixture-backed release gate:
uv run --group dev python scripts/verify_release.py
The public-flip readiness gate:
uv run --group dev python scripts/verify_pre_flip.py
A Justfile wraps the common targets (just test,
just lint, just docs, just run, just api) for convenience.
Contributing
See CONTRIBUTING.md for guidelines, code of conduct, and security policy.
All contributions must comply with the Developer Certificate of Origin
(sign-off with git commit -s).
Verification
Every release since v1.0.0 is signed and accompanied by an SBOM and
SLSA-3 provenance. Examples below use v2.1.3; substitute the tag
you actually pulled.
Cosign image signature
cosign verify ghcr.io/klein-business/legal-text-mcp-de:2.1.3 \
--certificate-identity-regexp 'https://github.com/klein-business/.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com
See Verify with cosign for SBOM and SLSA attestation verification.
Licence and acknowledgements
This project is licensed under the Apache License 2.0. See NOTICE for required attribution.
Derived from floleuerer/deutsche-gesetze-mcp (Copyright (c) 2025 Florian Leuerer, MIT). Upstream licence terms are preserved in licenses/MIT-floleuerer.txt.
MCP Registry: io.github.klein-business/legal-text-mcp-de ·
registry.modelcontextprotocol.io
mcp-name: io.github.klein-business/legal-text-mcp-de
Frequently asked questions
What is legal-text-mcp-de MCP Server?
German federal & state legal texts (BGB, DSGVO, …) with canonical IDs and cite-grade provenance.
How do I install legal-text-mcp-de 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. legal-text-mcp-de MCP Server runs locally from the PyPI package legal-text-mcp-de with the command uvx legal-text-mcp-de.
Is legal-text-mcp-de MCP Server free and open source?
Yes. legal-text-mcp-de MCP Server is released under the Apache-2.0 license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does legal-text-mcp-de MCP Server support remote (HTTP) connections?
No remote endpoint is listed for legal-text-mcp-de MCP Server. It runs locally on your machine over stdio, started by your MCP client.
How is legal-text-mcp-de MCP Server's trust score calculated?
legal-text-mcp-de MCP Server scores 67 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
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.