gesetzessuche

gesetzessuche

MCP server for accessing and searching German federal law documents from gesetze-im-internet.de. Provides tools to retrieve specific paragraphs, perform full-text searches, and list available laws.

Category
Visit Server

README

Gesetzessuche

Python-Bibliothek und MCP-Server für komfortablen Zugriff auf deutsches Bundesrecht von gesetze-im-internet.de.

Verfügbar: >1500 Gesetze, >2900 Verordnungen, >900 Abkommen, >500 Bekanntmachungen (~6500 Dokumente) Siehe gesetzessuche/law_mapping.json für die vollständige Liste.

Beispiele

$ gesetzessuche -r "BGB § 7"
📖 Bürgerliches Gesetzbuch...  ✓

BGB § 7 - Wohnsitz; Begründung und Aufhebung
======================================================================

(1) Wer sich an einem Orte ständig niederlässt, begründet an diesem Orte seinen Wohnsitz.

(2) Der Wohnsitz kann gleichzeitig an mehreren Orten bestehen.

(3) Der Wohnsitz wird aufgehoben, wenn die Niederlassung mit dem Willen aufgehoben wird, sie aufzugeben.
$ gesetzessuche -r "BGB § 7 Absatz 1"
📖 Bürgerliches Gesetzbuch...  ✓

BGB § 7 Absatz 1
======================================================================
Wer sich an einem Orte ständig niederlässt, begründet an diesem Orte seinen Wohnsitz.

Schnellstart

Installation

# Direkt von GitHub
pip install git+https://github.com/Steffen-W/gesetzessuche

# Oder von Source (Development)
git clone https://github.com/Steffen-W/gesetzessuche.git
cd gesetzessuche
pip install -e .

Setup & Nutzung

# Gesetze herunterladen (einmalig)
gesetzessuche-download --essential

CLI Hilfe:

$ gesetzessuche -h

usage: gesetzessuche [-h] [-p PARAGRAPH] [-a ABSATZ] [-r REFERENCE] [-s SUCHE]
                     [--case-sensitive] [-l]
                     [gesetz]

Search German law documents

positional arguments:
  gesetz                Law code (e.g., AktG, HGB, BGB) - optional if
                        --reference includes law code

options:
  -h, --help            show this help message and exit
  -p PARAGRAPH, --paragraph PARAGRAPH
                        Show specific paragraph (e.g., 1, 8b)
  -a ABSATZ, --absatz ABSATZ
                        Show specific section (requires --paragraph)
  -r REFERENCE, --reference REFERENCE
                        Parse reference string (e.g., "§ 1", "§ 8b Absatz 2",
                        "§ 1 Absatz 1 Satz 1")
  -s SUCHE, --suche SUCHE
                        Search for a term in the law
  --case-sensitive      Case-sensitive search (default: case-insensitive)
  -l, --liste           List all paragraphs

Examples:
  gesetzessuche AktG                             # Show law info
  gesetzessuche AktG --liste                     # List all paragraphs
  gesetzessuche AktG --paragraph 1               # Show paragraph 1
  gesetzessuche KStG --paragraph 8b --absatz 2   # Show specific section
  gesetzessuche --reference "BGB § 1"            # Use reference with law code
  gesetzessuche -r "KStG § 8b Absatz 2"          # Reference with law code
  gesetzessuche BGB --reference "§ 1"            # Reference without law code
  gesetzessuche AktG --suche "Aufsichtsrat"      # Search for term

MCP Server

Claude Desktop Config (~/.config/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "gesetzessuche": {
      "command": "python3",
      "args": ["-m", "gesetzessuche.server"]
    }
  }
}

Verfügbare MCP Tools:

  • get_law_reference(reference) - Haupttool: "KStG § 6 Absatz 1"
  • search_law(law, term) - Volltextsuche in Gesetz
  • list_paragraphs(law) - Paragraphen-Übersicht
  • list_laws() - Alle verfügbaren Gesetze

Python API

from gesetzessuche import LawSearch, get_law

# Gesetz laden
documents = get_law("BGB")
law_key = documents.get_jurabk()[0]
search = LawSearch(documents, law_key)

# Referenz-String nutzen (wie CLI)
text = search.get_by_reference("BGB § 1 Absatz 1")
print(text)

# Suchen
results = search.search_term("Rechtsfähigkeit")
for result in results:
    print(f"{result['paragraph']}: {result['context']}")

# Alle Paragraphen
paragraphs = search.list_all_paragraphs()

Projektstruktur

gesetzessuche/
├── gesetzessuche/          # Python Package
│   ├── __init__.py        # Public API
│   ├── __version__.py     # Version info
│   ├── cli.py            # CLI entry point
│   ├── server.py         # MCP server entry point
│   ├── download.py       # Download entry point
│   ├── models.py         # Pydantic Models
│   ├── parser.py         # XML Parser
│   ├── search.py         # Search & Query API
│   ├── formatting.py     # Text formatting utilities
│   ├── utils.py          # Utilities
│   └── law_mapping.json  # Law index
├── tests/                 # Test suite
├── data/                  # Downloaded laws (XML)
└── pyproject.toml         # Package configuration

Verfügbare Gesetze

Nach gesetzessuche-download --essential:

  • BGB - Bürgerliches Gesetzbuch
  • HGB - Handelsgesetzbuch
  • AktG - Aktiengesetz
  • GmbHG - GmbH-Gesetz
  • StGB - Strafgesetzbuch
  • KStG - Körperschaftsteuergesetz
  • UStG - Umsatzsteuergesetz
  • ArbZG - Arbeitszeitgesetz
  • Und viele mehr...

Vollständige Liste: gesetzessuche/law_mapping.json

Lizenz

  • Gesetzestexte: Public Domain (Bundesministerium der Justiz)
  • Software: MIT License
  • Quelle: gesetze-im-internet.de

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured