Swiss Law Local Search
Provides offline full-text search across 35,000+ Swiss laws from all cantons and federal level using SQLite FTS5 indexing. Enables querying laws, articles, and metadata through natural language.
README
Swiss Law Local Search — MCP Server
Offline full-text search across 35,000+ Swiss laws from all 26 cantons + federal level.
Built on the rcds/swiss_legislation HuggingFace dataset (sourced from LexFind.ch), indexed locally with SQLite FTS5.
Architecture
HuggingFace dataset (35k laws)
│
▼ build_index.py (run once)
swiss_law.db (SQLite + FTS5 full-text index)
│
▼ search_client.py
server.py (MCP tools)
│
▼ stdio / SSE
Claude Desktop / Cowork
Setup
cd lexfind-mcp
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Build the index (downloads ~2-3 GB, takes 5-10 min)
python build_index.py
Add to Claude Desktop
{
"mcpServers": {
"swiss-law": {
"command": "/ABSOLUTE/PATH/TO/lexfind-mcp/.venv/bin/python3",
"args": ["/ABSOLUTE/PATH/TO/lexfind-mcp/server.py"]
}
}
}
Tools
| Tool | What | Example |
|---|---|---|
search_laws |
Full-text search | search_laws("Raumplanung", canton="zh") |
get_law |
Metadata by ID | get_law(1234) |
get_law_text |
Full text | get_law_text(1234) |
get_article |
Single article | get_article(1234, "22") |
list_cantons |
Canton overview | list_cantons() |
FTS5 query syntax
The search supports SQLite FTS5 syntax:
Raumplanung— simple term matchPlanungs- und Baugesetz— implicit AND"öffentliches Recht"— exact phrasetitle:Baugesetz— search only in title columnRaumplan*— prefix matchBaugesetz OR Planungsgesetz— boolean ORcanton:zh AND Bauordnung— combine with column filter
Combining with the Fedlex MCP
This server and the Fedlex MCP server complement each other:
- This server: fast offline search, covers all cantons, has full text
- Fedlex MCP: live data, amendment history, FRBR versioning, legal taxonomy
You can run both in Claude Desktop simultaneously.
Updating the data
The HuggingFace dataset is a snapshot. To refresh:
python build_index.py # will ask to rebuild if DB exists
License
Data: CC-BY-SA-4.0 (from HuggingFace dataset) Code: MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.