Swiss Law Local Search
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Swiss Law Local Searchsearch for Bauordnung in canton zh"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 / CoworkRelated MCP server: swiss-courts-mcp
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.pyAdd 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 |
| Full-text search |
|
| Metadata by ID |
|
| Full text |
|
| Single article |
|
| Canton overview |
|
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 existsLicense
Data: CC-BY-SA-4.0 (from HuggingFace dataset) Code: MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-quality-maintenanceProvides access to Swiss court decisions through the entscheidsuche.ch API, enabling search, retrieval, and analysis of legal documents across different cantons and courts using natural language queries.Last updated
- AlicenseAqualityAmaintenanceMCP server for searching Swiss court decisions from federal and cantonal courts via entscheidsuche.ch. Enables full-text search, law reference lookup, and filtering by canton, court level, and date without API keys.Last updated81MIT
- AlicenseAqualityBmaintenanceProvides offline access to the French legal corpus (Legifrance/DILA) with full-text search, verbatim article retrieval, and citation grounding to prevent hallucinations.Last updated4338MIT
- Alicense-qualityBmaintenanceProvides AI assistants with citable access to Bernese laws (BSG) and administrative court rulings (Verwaltungsgericht Bern) via search, retrieval by number, and article extraction.Last updatedMIT
Related MCP Connectors
Search Swiss federal legislation: laws, articles, amendments via the Fedlex SPARQL endpoint.
Verified, citable German & EU law for any LLM. Daily updates from official sources, hosted in DE.
EU law, article-level: GDPR, NIS2, DORA, EU AI Act + more, with EUR-Lex citations. Keyless.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/janmanuelwinkler/hf_lexfind_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server