Openlex MCP server
Canton Zurich legislation via ZH-Lex with full-text search and article extraction
0 stars56 downloads/wk
Reviews
Write oneNobody has reviewed Openlex yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Openlex tools (8, 1 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
openlex__zhlaw_find_education_lawsSucht gezielt im Zürcher Bildungsrecht (Ordnungsnummern 412.x).
openlex__zhlaw_get_articleExtrahiert einen einzelnen Artikel aus einem Zürcher Gesetz.
openlex__zhlaw_get_lawRuft ein Zürcher Gesetz anhand der Ordnungsnummer oder Abkürzung ab.
openlex__zhlaw_get_law_metadataRuft aktuelle Metadaten eines Gesetzes live von zh.ch ab.
openlex__zhlaw_list_lawsListet Zürcher Gesetze auf mit optionalem Filter nach Rechtsgebiet.
openlex__zhlaw_search_articlesDurchsucht alle Artikel eines bestimmten Gesetzes nach einem Begriff.
openlex__zhlaw_search_lawsVolltextsuche in allen Zürcher Gesetzen mit FTS5-Ranking.
openlex__zhlaw_update_cachewrite actionAktualisiert den lokalen Cache der Zürcher Gesetzesdaten.
Public scan report
scanner v0.1.10 · 2026-11-05 · same rubric, same numbers if you re-run it
- Code scan22 source files scanned15/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancelast push 4 days ago15/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Findings (2)
- mediumsubprocess with shell=True
exec.shell-trueopenlex_mcp-0.3.0/audits/2026-05-29T052144-Z-openlex-mcp/verification-results.json: … [ "No os.system / subprocess / shell=True / eval / exec / os.popen anywhere in sr…
- mediumeval / new Function used
exec.evalopenlex_mcp-0.3.0/audits/2026-05-29T112502-Z-openlex-mcp/verification-results.json: … [ "No os.system(), shell=True, eval(), exec(), or os.popen() found in src/ (…
How Openlex compares
Against every graded Web search MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 77/100
- higher than 55% of 3,471 Web search servers
- Tools
- 8
- the typical Web search server has 5
- Tools that change things
- 13%
- typical: 0%. Fewer write tools means less an agent can break
- Downloads a week
- 56
- more than 38% of 837 Web search servers with a package
What its tools let an agent do: 8 create
Release history: 2 versions in the registry since 2026-08-02, latest 2026-09-27, typically one every 56 days.
Install Openlex in Claude Code, Cursor or VS Code
claude mcp add openlex-mcp -- uvx openlex-mcp
What the publisher says
From the Openlex repository's README, as published. We do not edit it. Read it on GitHub
🇨🇭 Part of the Swiss Public Data MCP Portfolio
⚖️ openlex-mcp
MCP Server for Canton Zurich legislation (ZH-Lex) — full-text search, article extraction, and education law tools for ~970 cantonal laws
🇩🇪 Deutsche Version
Overview
openlex-mcp provides AI-native access to the entire legal collection of Canton Zurich (Zürcher Gesetzessammlung). It combines full-text data from HuggingFace with live metadata from the official zh.ch website, storing everything in a local SQLite database with FTS5 full-text indexing for sub-50ms search performance.
Built for the Schulamt (school department) of the City of Zurich, but covers all areas of cantonal law — from tax law to building regulations.
Anchor demo query: "What does the Volksschulgesetz say about parental involvement? Show me Art. 55 VSG and find all articles that mention 'Elternrat'."
Features
- ⚖️ 8 tools covering search, retrieval, article extraction, and cache management
- 🔍 FTS5 full-text search across ~970 cantonal laws with BM25 ranking
- 📑 Article extraction — parse individual articles (Art. / §) with paragraph detection
- 🏫 Education law shortcuts — specialized search for LS 412.x series (Volksschulgesetz, Lehrpersonalverordnung, etc.)
- 🌐 Live metadata from zh.ch for current validity status and PDF links
- 💾 Hybrid architecture — cached full-text (HuggingFace) + live metadata (zh.ch)
- 🔓 No API key required — all data under open licenses (CC-BY-SA 4.0)
- ☁️ Dual transport — stdio (Claude Desktop) + Streamable HTTP (cloud)
Development Phase
Current phase: Phase 1 — Read-Only. All tools are read-only (readOnlyHint: true); no writes to external systems. See ROADMAP.md for the phase plan and transition gates before any write or multi-agent capability is added.
Prerequisites
- Python 3.11+
- uv (recommended) or pip
- Internet connection (for initial data download and live metadata)
Installation
# Clone the repository
git clone https://github.com/malkreide/openlex-mcp.git
cd openlex-mcp
# Install
pip install -e .
# or with uv:
uv pip install -e .Quickstart
# stdio (for Claude Desktop)
python -m openlex_mcp.server
# Streamable HTTP — binds to 127.0.0.1:8000 by default (localhost only)
python -m openlex_mcp.server --http --port 8000Network binding
By default the HTTP transport binds to 127.0.0.1 (localhost only). The host and port are configurable via the MCPHOST / MCPPORT environment variables (or the --host / --port CLI flags, which take precedence).
Never bind to 0.0.0.0 outside a container — it exposes the server to your local network (NeighborJack risk). For containerized/cloud deployments set MCP_HOST=0.0.0.0 explicitly; when that happens outside a detected container the server logs a warning.
Try it immediately in Claude Desktop:
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Openlex: common questions
- Is Openlex MCP server safe?
- Mostly: it is graded B (77/100). Read the Openlex safety report
- How do I install Openlex?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Openlex need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is Openlex maintained?
- The last commit was 5 days ago (2026-11-01). The latest release is v0.3.0.
- What can I use instead of Openlex?
- Servers from other publishers that do the same job: Pubmed MCP server, Arxiv MCP server and webclaw MCP server.
- How does Openlex compare with other Web search MCP servers?
- safety score 77/100 (higher than 55% of 3,471 Web search servers); tools 8 (the typical Web search server has 5); tools that change things 13% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Openlex
Same job from other publishers: the closest match first, then the best rated.
- PubmedSearch PubMed/Europe PMC, fetch articles and full text (PMC/EPMC/Unpaywall), citations, MeSH terms.not reviewedEstablishedA
- ArxivSearch arXiv papers, download full text, semantic search, citation graphs, and alerts via MCP.not reviewedWidely usedA
- webclawWeb scraping, search, crawling, structured extraction and research for AI agents.not reviewedEstablishedA
- MisakanetFailure-memory layer for coding agents: search evidence-rated failure lessons by error text.not reviewedEstablishedA
Legal Data HunterSearch 18M+ legal documents worldwide — case law, legislation, and doctrine across 110+ countries.not reviewedEstablishedA