Fedlex MCP Server

MCP server for Swiss federal legislation via Fedlex (fedlex.data.admin.ch)

Local serverstdio

What is the Fedlex MCP MCP server?

MCP server for Swiss federal legislation via Fedlex (fedlex.data.admin.ch). That is what the fedlex mcp mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The tools it exposes

The server publishes 11 tools. What each one is for:

  • search_legislation — Search by keyword in law titles and abbreviations
  • list_legislation — List all in-force legislation (paginated)
  • get_legislation — Get metadata for a law by SR number or ELI URI
  • get_legislation_text — Fetch the full text of a law (HTML or XML)
  • get_versions — List all historical consolidation versions
  • get_citations — Law-to-law citation graph (which laws cite which)
  • search_provisions — FTS5 full-text search across all article texts (~100k provisions)
  • lookup_definition — Find formal legal definitions by term across all legislation
  • find_eu_references — Swiss laws that implement or reference specific EU directives/regulations
  • get_article_citations — Article-to-article citation graph (which specific articles cite which)
  • get_db_stats — Database statistics: counts, size, and last ingestion timestamp

What it needs from you

Configuration is passed through the environment: FEDLEX_DB_PATH. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Getting it running

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

How it compares

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Fedlex MCP's toolset — search_legislation, list_legislation, get_legislation and 8 more — is a fair guide to whether it matches your workflow. It is maintained by loicvuilliomenet-boop; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Fedlex MCP's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 11 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Fedlex MCP.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
search_legislationSearch by keyword in law titles and abbreviations
list_legislationList all in-force legislation (paginated)
get_legislationGet metadata for a law by SR number or ELI URI
get_legislation_textFetch the full text of a law (HTML or XML)
get_versionsList all historical consolidation versions
get_citationsLaw-to-law citation graph (which laws cite which)
search_provisionsFTS5 full-text search across all article texts (~100k provisions)
lookup_definitionFind formal legal definitions by term across all legislation
find_eu_referencesSwiss laws that implement or reference specific EU directives/regulations
get_article_citationsArticle-to-article citation graph (which specific articles cite which)
get_db_statsDatabase statistics: counts, size, and last ingestion timestamp

Configuration

VariableDescriptionRequired
FEDLEX_DB_PATHFilesystem location the server is allowed to use.Optional

Example prompts to try

  • Use Fedlex MCP to search legislation.
  • Use Fedlex MCP to list legislation.
  • Use Fedlex MCP to get legislation.

Frequently asked questions

It connects Fedlex MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 11 tools (search_legislation, list_legislation, get_legislation, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Fedlex MCP directly.