What Fedlex Connector MCP server does
The Fedlex Connector MCP server exposes Swiss federal legislation from the Classified Compilation (RS/SR) through MCP. It covers acts published on Fedlex in German, French, and Italian, and returns current consolidated text rather than relying on a proprietary legal database or local cache.
Four tools support the main research workflow:
search_by_title finds currently applicable acts by title keywords and returns their RS numbers.
get_article retrieves one article for an RS number, optionally at a specified consolidation date.
get_law_text returns an entire act or narrows the result to a title or chapter.
list_amendments reports consolidation versions and recent changes for an act.
How it works
The connector uses two Fedlex interfaces for different parts of a request. SPARQL supplies metadata such as RS-number mappings, consolidation dates, amendment history, and links to legislation files. The server then downloads the relevant static HTML, parses its document structure with Cheerio, and extracts the requested text.
Large legislation is handled across multiple HTML files. The connector discovers those files and combines their contents, while get_law_text paginates long results at article boundaries. Responses include the relevant consolidation date and a notice that the Official Compilation (RO/AS) published by the Federal Chancellery remains legally authoritative.
A typical article lookup first resolves the RS number through SPARQL, identifies the latest or requested consolidation, retrieves the associated HTML, and extracts the requested article. Structured errors distinguish cases such as an unknown RS number, a missing article, an unavailable SPARQL endpoint, or a failed filestore request.
Setup and configuration
The Fedlex Connector MCP server supports both local stdio and HTTP operation. The hosted HTTP endpoint is https://mcp.fedlex-connector.ch. Claude users can add that address as a custom connector, while Claude Code can register it with the HTTP transport:
claude mcp add --transport http fedlex https://mcp.fedlex-connector.ch
For a local installation, the project provides TypeScript build and start scripts. Running the normal start command uses stdio. Setting PORT switches the application to HTTP mode, and the Dockerfile supports deployment on container platforms. A deployed instance can be checked through its /health endpoint.
Limitations and notes
Results cover acts in the Classified Compilation and search_by_title returns only acts currently in force. Tool language options are German (de), French (fr), and Italian (it), with German as the default. Article and law-text results represent consolidated versions; use list_amendments when the change history or a prior consolidation is needed.
The service depends on Fedlex's SPARQL endpoint and HTML filestore. If either source is unavailable, requests can fail with a structured error. Retrieved text should not be treated as the legally authoritative publication; consult the Official Compilation for that purpose.