# German Federal Law MCP Server (Gesetze im Internet) (`darikami/german-federal-law-mcp`) Actor

MCP server for AI agents: search German federal laws and ordinances in force (BGB, GG, HGB, StGB, UStG ...) and fetch a section's current text with its Absätze and Nummern, from gesetze-im-internet.de, the federal government's consolidated law database.

- **URL**: https://apify.com/darikami/german-federal-law-mcp.md
- **Developed by:** [DARIKAMI GmbH](https://apify.com/darikami) (community)
- **Categories:** MCP servers, AI, Business
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## German Federal Law MCP Server (Gesetze im Internet)

**An MCP server that gives AI agents the consolidated text of German federal law, from gesetze-im-internet.de.**
It covers about 6,000 federal laws and ordinances in force (BGB, GG, HGB, StGB, UStG, SGB ...), section by section.
**USD 0.01 per answered tool call.** A call that finds nothing is free. Apify also bills the server's Standby usage. Works with MCP clients such as Claude, ChatGPT, Cursor and n8n.

| Tool call | What comes back |
|---|---|
| `search_law("BGB")` | the Bürgerliches Gesetzbuch as the first hit, with its id and link |
| `get_section("bgb", "433")` | § 433 BGB with its heading, text and Absätze |
| `get_section("UIG", "§ 2")` | § 2 UIG "Begriffsbestimmungen", with Absätze, Nummern and Buchstaben |
| `list_sections("bgb")` | the table of contents of the BGB: parts, sections and their headings |
| `get_section("bgb", "99999")` | a free error result: no such section |

The calls come from the live smoke test against gesetze-im-internet.de (06.11.2026). The full answer of one call is under Example.

### Who uses it

- **Legal assistants for German users:** quote the exact section of the BGB or HGB instead of the model's memory.
- **Tax and payroll agents:** look up the UStG, the EStG or the SGB in the consolidated version the site publishes.
- **Developers of legal-tech products:** one MCP endpoint instead of an XML parser of their own.

### What it does not do

- Federal law only: no state law (Landesrecht), no case law.
- The consolidated text is not the official version. Only the Federal Law Gazette is binding. This is not legal advice.
- It is independent: not affiliated with or endorsed by the Federal Ministry of Justice or the Federal Office of Justice.

### Tools

Three tools:

| Tool | What it does |
|---|---|
| `search_law(query)` | Finds laws by abbreviation (`BGB`, `GG`, `HGB`, `StGB`, `UStG`, `SGB V`) or by words of the title (`Umsatzsteuer`, `Datenschutz`). Returns up to 20 laws with id, title and link. An exact abbreviation comes first. All words must match. |
| `get_section(law, section)` | Returns one section (§) or article in its current consolidated version: `bgb` + `433`, `GG` + `Art 1`, `UStG` + `§ 3a`. The answer has the heading, the plain text and the structure: Absätze with their Nummern and Buchstaben. It also has the footnotes and the law's status line ("zuletzt geändert durch ..."). |
| `list_sections(law, offset?, limit?)` | Returns the table of contents: the headings (Buch, Teil, Abschnitt, Titel) and the sections with their headings, in order. One page has up to 500 entries. |

The `law` argument takes the id from `search_law` (`bgb`, `ustg_1980`) or the abbreviation (`BGB`, `UStG`).

### Connect

The actor runs in Apify's **Standby mode**. The MCP endpoint (Streamable HTTP) is
`https://darikami--german-federal-law-mcp.apify.actor/mcp`. Authenticate with your Apify API token as a bearer token:

```json
{
  "mcpServers": {
    "german-federal-law": {
      "url": "https://darikami--german-federal-law-mcp.apify.actor/mcp",
      "headers": { "Authorization": "Bearer <your Apify token>" }
    }
  }
}
```

The actor has no input.

### Example

`get_section` with `{ "law": "UIG", "section": "§ 2" }` returns, abridged:

```json
{
  "law": { "id": "uig_2005", "abbreviation": "UIG", "title": "Umweltinformationsgesetz", "issued": "2004-12-22",
           "status": ["Stand: zuletzt geändert durch Art. 2 G v. 25.2.2021 I 306", "..."], "builtOn": "2026-10-05" },
  "url": "https://www.gesetze-im-internet.de/uig_2005/index.html",
  "section": {
    "number": "§ 2",
    "heading": "Begriffsbestimmungen",
    "text": "(1) Informationspflichtige Stellen sind\n  1. die Regierung und andere Stellen der öffentlichen Verwaltung. ...\n    a) die obersten Bundesbehörden, ...",
    "paragraphs": [
      { "number": "1", "text": "Informationspflichtige Stellen sind",
        "items": [ { "number": "1.", "text": "die Regierung und andere Stellen ...",
                     "items": [ { "number": "a)", "text": "die obersten Bundesbehörden, ..." } ] } ] }
    ],
    "footnotes": [],
    "truncated": false
  },
  "source": "Gesetze im Internet (gesetze-im-internet.de), Federal Ministry of Justice and Federal Office of Justice - ...",
  "notice": "The consolidated texts of gesetze-im-internet.de are not the official version: only the Federal Law Gazette (Bundesgesetzblatt) is legally binding. Not legal advice."
}
```

### Pricing (pay per event)

| Event | Price | When |
|---|---|---|
| `tool-call` | **USD 0.01** | one **answered** call of any of the three tools |

Some calls are **free**. They return an error result with the reason:

- a call that finds nothing (an unknown law, an unknown section);
- a call with bad input;
- a call that fails at the source.

Apify also bills the platform usage of the Standby run, in addition to the tool-call price. We do not set that charge.
That usage runs while the server waits for requests, until the idle timeout stops it. Apify's documents describe a maximum cost per run for standard runs, not for a Standby call.

### Data source and terms

- **Source:** gesetze-im-internet.de. The index of all laws is `gii-toc.xml`. Each law is one XML file in a ZIP
  (`https://www.gesetze-im-internet.de/<id>/xml.zip`). The site offers this XML format for users "die die hier zur
  Verfügung gestellten Gesetze und Rechtsverordnungen über automatisierte Verfahren weiterverarbeiten möchten"
  (Hinweise, section 6, read 04.11.2026). Its `robots.txt` allows all paths.
- **Terms:** laws and ordinances are official works. German copyright law does not protect them (§ 5 UrhG).
- **The text is not the official version.** The site says: "Die im Internet abrufbaren, konsolidierten Gesetzestexte
  sind nicht die amtliche Fassung." Only the Federal Law Gazette is legally binding. Each answer says so (`notice`).
  This is not legal advice.
- Federal law only. State law (Landesrecht) and case law are not included.
- When more calls arrive than the actor reads at once, the extra calls get a free "busy" error result.
- The text comes as the site publishes it, without warranty.

**More official-data actors by darikami:** [Swiss UID & VAT validator](https://apify.com/darikami/swiss-uid-validator) · [Swiss electricity tariffs](https://apify.com/darikami/swiss-electricity-tariffs) · [Swiss federal law MCP](https://apify.com/darikami/swiss-federal-law-mcp) · [SEC company fundamentals](https://apify.com/darikami/sec-company-fundamentals) · [German public tenders](https://apify.com/darikami/german-public-tenders).

# Actor input Schema

## Actor input object example

```json
{}
```

# Actor output Schema

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("darikami/german-federal-law-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("darikami/german-federal-law-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call darikami/german-federal-law-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,darikami/german-federal-law-mcp"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fRFHR7H0C7SElQ9M5/builds/d2XTmIHne1uTyQGgE/openapi.json
