プロトタイプ · プレビュー版:公式レジストリのすべてのサーバーを掲載し、30分ごとに同期しています。レビューとアカウント機能は今後のステップで始まります。
PopNx MCPAIを使う人のためのMCPサーバー · やさしい言葉で解説

Openlex MCP

作者:malkreideバージョン 0.3.0i★ –iパソコンで動く
レジストリ名io.github.malkreide/openlex-mcp

インストール

概要

作者による説明(英語の原文)

Canton Zurich legislation via ZH-Lex with full-text search and article extraction

PopNx MCPの3つの柱

この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。

できること

このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。

  • 接続方法: パソコンで動く
  • トランスポート: stdio
  • カテゴリ: 検索・AIの記憶

インストール

使っているAIアプリを選んで、設定をコピーしてください。

インストールの前に

  • 基本チェック:1項目中1項目に合格
  • あなたのパソコンで、あなたのユーザーと同じ権限(ファイル、ネットワーク、アプリ)で動きます。
  • レジストリには、入力が必要なキーは載っていません。

必要なもの

  • PyPIPythonのuvのインストール(uvxコマンドに必要)

どのアプリを使っていますか?

上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。

Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます

{
  "mcpServers": {
    "openlex": {
      "command": "uvx",
      "args": [
        "openlex-mcp"
      ]
    }
  }
}

ターミナルでこれを実行します

claude mcp add openlex -- uvx openlex-mcp

Cursorで開く

または、設定を自分でコピーする

プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます

{
  "mcpServers": {
    "openlex": {
      "command": "uvx",
      "args": [
        "openlex-mcp"
      ]
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

VS Codeで開く

または、設定を自分でコピーする

プロジェクトの .vscode/mcp.json に貼り付けます

{
  "servers": {
    "openlex": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "openlex-mcp"
      ]
    }
  }
}

ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。

これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。

選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。

この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。

できること

パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。

基本チェックi

誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月7日にチェック

  • ✓ 合格

    作者とリポジトリが一致

    レジストリ名は、リポジトリを所有するGitHubアカウント malkreide で確認済みです

  • … 未チェック

    今もメンテナンスされている

    このリポジトリはまだGitHubから読み取っていません

  • … 未チェック

    ライセンスがある

    このリポジトリはまだGitHubから読み取っていません

  • – 対象外

    エンドポイントが応答する

    これはパソコンで動くため、インターネット上のエンドポイントはありません

  • – 対象外

    OAuthでサインイン

    パソコンで動き、代わりにローカルの設定を使います

  • … 未チェック

    ツールの説明に隠れた指示がない

    パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです

検索・AIの記憶のほかのサーバーとの比較i

  • このカテゴリのほかの7283件のうち0%よりスターが多い
  • このカテゴリのほかの7283件のうち49%より最近レジストリに公開
  • 基本チェックの結果が、このカテゴリのほかの7283件のうち100%と同じかそれ以上

レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。

よくある質問

Openlex MCPは安全ですか?

当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。

どんなキーやコードが必要ですか?

レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。

パソコンで動きますか、それともクラウドですか?

あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。

今もメンテナンスされていますか?

GitHubリポジトリの最終更新は–、最新バージョン(0.3.0)がレジストリに届いたのは41 日前です。

どのアプリで使えますか?

Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにPython (uv)も必要です。

代わりに使えるものは?

同じカテゴリには:Context7, Codebase Memory, Exa

代わりの候補

同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。

カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i

Context7

作者:upstash

Up-to-date docs for AI agents

パソコンでもクラウドでも★ 64,224MIT昨日更新
インストール

Codebase Memory

作者:DeusData

Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.

パソコンで動く★ 48,148MIT21 日前更新
インストール

Exa

作者:exa-labs

Connect AI agents to Exa for web search, content fetching, and multi-step research.

クラウドで動く★ 5,213MIT先月更新
インストール

作者のREADME

READMEを開く

作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。

🇨🇭 Part of the [Swiss Public Data MCP Portfolio](https://github.com/malkreide)

⚖️ 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.

SourceDataAccess
HuggingFace974 ZH laws — full text (PDF extracts)Cached locally as SQLite + FTS5
zh.ch ZH-LexCurrent metadata, PDF links, validity statusLive HTTP requests

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 8000

Network binding

By default the HTTP transport binds to `127.0.0.1` (localhost only). The host and port are configurable via the MCP_HOST / MCP_PORT 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:

*"What is the Volksschulgesetz (VSG)?"*

*"Find all Zurich laws about data protection"*

*"Show me Art. 1 of the Volksschulgesetz"*

*"Which education laws mention 'Schulleitung'?"*


Configuration

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{

"mcpServers": { "openlex": { "command": "python", "args": ["-m", "openlex_mcp.server"] } } }

Or with the installed entry point:

{

"mcpServers": { "openlex": { "command": "openlex-mcp" } } }

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
Cloud Deployment (SSE for browser access)

For use via claude.ai in the browser (e.g. on managed workstations without local software):

Render.com (recommended):

  1. Push/fork the repository to GitHub
  2. On render.com: New Web Service → connect GitHub repo
  3. Set start command: python -m openlex_mcp.server --http --port 8000
  4. Set environment variable MCP_HOST=0.0.0.0 so the container is reachable (the code default is 127.0.0.1; Render sets the RENDER env var, so no NeighborJack warning is logged)
  5. Set MCP_CORS_ORIGINS=https://claude.ai so the browser can read the Mcp-Session-Id header (comma-separated list; no wildcard — defaults to empty, i.e. no cross-origin access)
  6. In claude.ai under Settings → MCP Servers, add: https://your-app.onrender.com/sse

💡 *"stdio for the developer laptop, SSE for the browser."*


Available Tools

Search & Browse
ToolDescription
openlex__zhlaw_search_lawsFull-text search across all ~970 ZH laws (FTS5 + BM25 ranking)
openlex__zhlaw_get_lawRetrieve a law by LS number (e.g. 412.100) or abbreviation (e.g. VSG)
openlex__zhlaw_list_lawsList and filter laws by legal area prefix
openlex__zhlaw_find_education_lawsSpecialized search in education law (LS 412.x series)
Article Extraction
ToolDescription
openlex__zhlaw_get_articleExtract a specific article from a law (e.g. Art. 28 VSG)
openlex__zhlaw_search_articlesSearch within all articles of a specific law
Metadata & Cache
ToolDescription
openlex__zhlaw_get_law_metadataGet live metadata from zh.ch (PDF links, validity status)
openlex__zhlaw_update_cacheRefresh the local data cache from HuggingFace
Key Legal Area Prefixes (LS Numbers)
PrefixLegal AreaExample
131Constitution and popular rightsKantonsverfassung
170Administrative procedureDatenschutzgesetz
331Tax lawSteuergesetz
412Education and schoolsVolksschulgesetz (VSG)
700Spatial planning and buildingPlanungs- und Baugesetz
810HealthGesundheitsgesetz
Example Use Cases
QueryTool
*"What is the Volksschulgesetz?"*openlex__zhlaw_get_law
*"Find laws about data protection"*openlex__zhlaw_search_laws
*"Show me Art. 55 VSG"*openlex__zhlaw_get_article
*"Which education laws mention Schulleitung?"*openlex__zhlaw_find_education_laws
*"Find all articles about Elternrat in the VSG"*openlex__zhlaw_search_articles
*"Is LS 412.100 still in force?"*openlex__zhlaw_get_law_metadata

Architecture

┌─────────────────┐     ┌──────────────────────────────┐     ┌──────────────────────────┐

│ Claude / AI │────▶│ OpenLex MCP │────▶│ HuggingFace │ │ (MCP Host) │◀────│ (MCP Server) │◀────│ rcds/swiss_legislation │ └─────────────────┘ │ │ │ (974 ZH laws, cached) │ │ 8 Tools │ ├──────────────────────────┤ │ SQLite + FTS5 Cache │────▶│ zh.ch ZH-Lex │ │ Stdio | HTTP │◀────│ (live metadata + PDFs) │ │ │ ├──────────────────────────┤ │ No authentication required │ │ LexFind.ch │ └──────────────────────────────┘ │ (links only) │ └──────────────────────────┘

Data Source Characteristics
SourceProtocolCoverageAuthLicense
HuggingFace rcds/swiss_legislationDatasets API974 ZH laws (full text)NoneCC-BY-SA 4.0
zh.ch ZH-LexHTTP/HTMLCurrent metadata, PDFsNonePublic
LexFind.chHTTPCross-cantonal linksNonePublic
Design Decision: Tools-only (no MCP Resources)

All 8 endpoints are exposed as Tools rather than MCP Resources. Rationale:

  • Every lookup is parametric — queries, abbreviations, article numbers vary per call. Static Resources (one URI per document) don't capture this naturally.
  • The corpus is 974 laws × many articles — registering each as a Resource URI would create an impractically large resource list.
  • MCP Resource templates (zhlex://laws/{sr_number}) are a future consideration for Phase 2 if clients benefit from resource-level caching or subscriptions.
Scaling Constraints

The constraint depends on the protocol era the client speaks:

  • `2026-07-28` (modern) — every request is a self-contained POST carrying its own _meta envelope; the server answers without issuing an Mcp-Session-Id and keeps no session between requests. Any replica can answer any request; no shared store, no sticky routing. (subscriptions/listen streams live on the replica that opened them — this server's lists are fixed at import, so there is nothing to fan out.)
  • Handshake era (`initialize`, up to `2025-11-25`) — session state is kept in-process. Multiple replicas break active sessions because there is no shared session store (Redis, Durable Objects, etc.). A single-replica Render deployment routes all requests to one process, so no sticky-session LB is needed today.

Before scaling handshake-era clients beyond one instance: either add a shared session store or configure your edge load balancer to route on the Mcp-Session-Id header with a stick-table and an appropriate TTL.


MCP Protocol Version

ItemValue
Served via the `initialize` handshake2024-11-05 … `2025-11-25` — the handshake ceiling
Served via the per-request envelope`2026-07-28`
Who picksThe client's first request, once per connection. A request carrying the 2026-07-28 _meta envelope opens a modern connection; anything else opens a handshake connection.
SDKmcp[cli]>=2.0.0,<3
Cache hintstools/list, prompts/list, resources/list, resources/templates/list and server/discover: ttlMs 300000, cacheScope public
`serverInfo.version`The package version (openlex_mcp.__version__), in every server/discover result
Deprecated in `2026-07-28`, not usedLogging (ctx.info/ctx.warning, SEP-2577) — status goes into the tool result, diagnostics into the server log
Pinned insrc/openlex_mcp/server.py — MCP_PROTOCOL_VERSION constant
Update policy
  1. When mcp is upgraded (via Dependabot PR), verify the protocol version in the SDK release notes.
  2. If the protocol version changes, update MCP_PROTOCOL_VERSION in server.py, regenerate docs/tool-hashes.json (PYTHONPATH=src python scripts/gen_tool_hashes.py --write), and note the change in CHANGELOG.md.
  3. Run pytest tests/ -m "not live" to confirm compatibility before merging.

Project Structure

openlex-mcp/

├── src/openlex_mcp/ │ ├── init.py # Pa

冒頭だけを表示しています。続きはリポジトリで読めます

PopNxに聞く