Fedlex Connector — Claude Code MCP server: laws and setup
Connects an AI coding agent to Swiss federal legislation on Fedlex. Search acts, read articles, and inspect amendment versions when legal source text is needed.
claude mcp add --transport http fedlex-connector https://mcp.fedlex-connector.ch/What Fedlex Connector does
Fedlex Connector gives Claude Code an MCP route to Swiss federal legislation published through Fedlex. It can search act titles, retrieve a consolidated article or law, and list amendment versions. The available language codes are German, French, and Italian.
The server first uses SPARQL metadata queries to resolve an RS number, consolidation date, and HTML file location. It then fetches the legislation from Fedlex’s static filestore and parses the requested text. Large acts are split at article boundaries and returned over several pages. Its tools are search_by_title, get_article, get_law_text, and list_amendments.
Claude Code connects over HTTP to https://mcp.fedlex-connector.ch/. The repository also includes a Dockerfile for a self-hosted instance: setting PORT selects HTTP mode, while omitting it runs stdio mode. Remote setup depends on access to that MCP endpoint.
What it helps with
- find an RS number from an act title
- retrieve a specific article in its current text
- read one section of a larger law
- list amendment and consolidation versions
- query an act in German, French, or Italian
Example prompts for the agent
- Find the Swiss data protection act and return its RS number.
- Retrieve article 1 from RS number
210in German. - List amendments for act
220starting from2024-01-01.
How to install Fedlex Connector
Platform CLI: remote server
claude mcp add --transport http fedlex-connector https://mcp.fedlex-connector.ch/Platform CLI: remote server
codex mcp add fedlex-connector --url https://mcp.fedlex-connector.ch/Config file
{
"mcpServers": {
"fedlex-connector": {
"url": "https://mcp.fedlex-connector.ch/"
}
}
}Config file
{
"servers": {
"fedlex-connector": {
"type": "http",
"url": "https://mcp.fedlex-connector.ch/"
}
}
}Platform CLI: remote server
gemini mcp add -t http fedlex-connector https://mcp.fedlex-connector.ch/Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Fedlex Connector
How do I install Fedlex Connector in Claude Code?
Run claude mcp add --transport http fedlex-connector https://mcp.fedlex-connector.ch/.
What does Fedlex Connector do?
It searches Swiss federal acts, retrieves article or law text from Fedlex, and lists consolidation versions and amendments.
Which languages does Fedlex Connector support?
Its tools support German, French, and Italian. Pass de, fr, or it through the language parameter.