# fedlex-mcp

Wires Swiss federal law, open consultations and the TERMDAT terminology base into your assistant. Handy when you need a statute or a consultation deadline fast.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 7
- Author: malkreide
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/malkreide/fedlex-mcp
- Updated: 2026-09-27
- HTML: https://affpapa.org/en/nevibecode/mcp/fedlex-mcp

## What it does

The server talks to two SPARQL endpoints. Fedlex serves the Systematic Compilation (SR), the Official Compilation (AS), the Federal Gazette (BBl), treaties and consultations; LINDAS serves TERMDAT, the Federal Chancellery's terminology database. Twelve tools and two resources sit behind them, covering title search, lookup by SR number, version history and upcoming entry into force.

Each open consultation comes back with a `deadline`, a `days_remaining` value computed in Europe/Zurich at request time, and a derived `status`, so an expired one never reads as running. The `topic` filter expands into a keyword union and tells you which terms it used. On consultations reach for `topic` instead of `keyword` — there is no subject taxonomy, filtering runs over the title text.

Python 3.11+ is required, plus `uv` or pip. No API key: the data sits under open reuse licences. Two transports are available, stdio for a desktop client and Streamable HTTP for cloud deployment.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add fedlex-mcp -- uvx fedlex-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from fedlex-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add fedlex-mcp -- uvx fedlex-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from fedlex-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "fedlex-mcp": {
            "command": "uvx",
            "args": [
                "fedlex-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from fedlex-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "fedlex-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "fedlex-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from fedlex-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add fedlex-mcp uvx fedlex-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from fedlex-mcp <command>

## When to use it
- pull up a law by its SR number
- check whether a consultation deadline has passed
- walk through every version of a statute
- get the official French and Italian equivalent of a term
- watch for laws about to enter into force

## Example prompts
- List all valid federal laws on vocational training
- Which education consultations are open right now, and until when?

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
