Legalize

dev.legalize由 legalize.dev 發布官方發布者v0.18.0更新於 Oct 25, 2026

Official MCP connector for Legalize: read and search its whole open corpus, at any point in time.

已驗證Streamable HTTP可網頁執行效率與工作流知識與記憶

概覽

AI 產生的概覽

Legalize 遠端連接器,讓助理檢索並閱讀多國整合立法文本,包括某部法律在過去某日的內容。

可以做什麼
列出語料庫中的國家及各國的法律數量,並依標題詞或官方編號檢索法律,取得供其他工具使用的 id。讀取法律目前的全文或單一條文,並取得某日已發布的版本及其 git SHA。以統一差異比較兩個日期之間的變化,追溯哪些規範在何時修訂了某部法律。查看語料庫規模與變動情況,並預覽、建立、暫停或刪除法律變更的 webhook 與電子郵件摘要訂閱。
適用情境
適合需要助理依據真實法條而非記憶回答法律問題,並附上引文與可核驗的提交記錄。也適合長期追蹤特定法律或國家的修訂,以及在立法變化時取得通知。
執行需求
遠端 Streamable HTTP 端點,本機無需安裝。必須透過瀏覽器完成 OAuth 登入,不支援匿名存取,也無需貼上 API 金鑰。需要支援遠端 MCP 的用戶端,或使用 stdio 橋接。建立訂閱需要付費方案;有每月免費額度與每分鐘突發限制。
安裝前請注意
讀取類工具無法改動語料庫,但訂閱類工具會在帳戶上建立、暫停和刪除資料,並被標記為寫入操作。建立訂閱需要付費方案,超出每月額度後呼叫會回傳 quota_exceeded,直到下個月重置。webhook 簽章密鑰不會由工具回傳,需在控制台管理。依頒布原文發布的文本會被標記,日期對應的是發布而非生效,條文邊界為推導所得。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Legalize,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/dev.legalize%2Flegalize/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "legalize": {
      "type": "http",
      "url": "https://legalize.dev/mcp"
    }
  }
}

README

Legalize — the MCP connector for consolidated legislation

What a law said on any past date, with the citation and the git commit behind it. Your assistant answers from the corpus instead of from memory.

[MCP] [Corpus read-only] [Auth] [License: MIT] [Web]

Connect your AI client (Claude, ChatGPT, Cursor, VS Code, Gemini CLI…) to Legalize and ask about legislation in plain language. Every answer comes back with three things a model cannot invent:

  • 📜 The text itself — the whole law or one whole article, never a truncated fragment.
  • 🕰️ A date — not only the current wording, but the version that was on the books on the day you name.
  • 🔗 A citation and a git SHA — the commit in the public corpus that holds those exact bytes, so the other side can check the quote.

One remote endpoint:

https://legalize.dev/mcp

Sign-in required. See it live at legalize.dev/mcp, which always shows the current coverage and allowance.


Quick connect

It is a remote server (Streamable HTTP, stateless). Nothing is installed: you hand the URL to your client, and the client walks you through the sign-in the first time it calls a tool.

One click, if yours is one of these:

[Add to Claude] [Add to Cursor] [Add to VS Code] [Add to ChatGPT]

The first three pre-fill the name and the address, then ask you to confirm it and sign in. ChatGPT opens its create-connector form — it takes no parameter for the server, so paste https://legalize.dev/mcp in yourself, with developer mode on under Advanced.

Claude.ai · Claude Desktop (Connectors)

Settings → Connectors → Add custom connector → paste https://legalize.dev/mcp.

Claude Code (CLI)

bash
claude mcp add --transport http legalize https://legalize.dev/mcp

Cursor

Use the button above, or in ~/.cursor/mcp.json:

json
{  "mcpServers": {    "legalize": {      "url": "https://legalize.dev/mcp"    }  }}

VS Code (GitHub Copilot)

Use the button above, or in .vscode/mcp.json:

json
{  "servers": {    "legalize": {      "type": "http",      "url": "https://legalize.dev/mcp"    }  }}

ChatGPT

Settings → Connectors → Advanced → turn on developer mode, then create a connector and paste https://legalize.dev/mcp. There is no install link for this one: ChatGPT only deep-links to apps listed in its own directory, and custom connectors sit behind developer mode, on Plus or Pro.

Gemini CLI and other clients

json
{  "mcpServers": {    "legalize": {      "httpUrl": "https://legalize.dev/mcp"    }  }}

Any client that speaks remote MCP works. If yours only speaks stdio, bridge it:

bash
npx mcp-remote https://legalize.dev/mcp

The tools

Nothing here can change a law. The corpus is read-only to the connector: no tool alters a text, a version or a history, because those come from the git repositories and this server has no way in. The full descriptions the model reads, with every argument and its type, are published live by the running server at /mcp/tools.json.

ToolWhat it answers
list_countriesWhich countries are in the corpus, and how many laws each one holds.
search_lawsFind a norm by words in its title or by its official number. Returns the id every other tool takes.
get_lawRead what a norm says today — the whole text, or one article of it.
law_at_dateWhat the norm said on a given day, with the git SHA behind that version.
diff_lawWhat changed between two dates, as a unified diff of the two texts.
reform_historyWhich norms amended this one, when, and what each says it touched.
law_statsHow large a corpus is and how much it moves, before drilling into it.

The rest manage your own subscriptions — the one question reading the corpus cannot answer, which is tell me when this changes. They are the only tools that write anything, what they write is your account's own subscription, and they need a paid plan.

One rule, two ways to receive it. A webhook posts every change to a server you run; a digest lists a day of them in your inbox:

ToolWhat it does
preview_webhookTry a subscription rule against the last 30 days without creating anything: how many events it would have delivered, and which. Works for either delivery — it tries the rule, not the destination.
create_webhook ✎Subscribe an HTTPS endpoint of yours to law changes. Narrow it to specific laws, to words in the title and subject headings, or to countries. The signing secret is not returned: it can forge a delivery, and anything a tool returns stays in the transcript. Collect and rotate it in the dashboard.
list_webhooksThe endpoints this account has, and the id the other two take. Secrets are never returned.
set_webhook_enabled ✎Pause one, or start it again. The endpoint, its rule and its history all stay.
delete_webhook ✎Remove one. Deliveries stop, and its history goes with it.
create_email_digest ✎The same rule, delivered as one email a day instead — the version you can receive without running anything. lang picks the language of the mail, not of the laws.
list_email_digestsThe digests this account gets, with the rule and language of each, and the id the other two take.
set_email_digest_enabled ✎Pause the mail, or start it again. A paused digest keeps its place: what it missed arrives in the first mail after it resumes.
delete_email_digest ✎Stop one for good. Recreated later, it starts from that day and the gap is not sent.

The digest goes to the account's own address and there is no argument for another one. Not an omission: a free-text recipient would turn a connector into a way to send mail to somebody else, signed by our domain, on a model's say-so.

Narrow the subscription or you will stop reading it. The filters compose as AND, a rule that could never match — an unknown country, a law id that is not in the corpus — is refused rather than stored, and a text filter reaches one language: laws are written in their own, so proteccion de datos finds the Spanish act and not the Portuguese protecao de dados.

The ones marked ✎ are declared to clients with readOnlyHint: false, so a client that confirms before a write will confirm before these. A paid plan is needed to create one; pausing and deleting never are, on any plan, because the account that most needs to turn its deliveries off is the one whose plan has just ended. On a plan without the feature, creating answers a structured feature_not_available error and creates nothing — and nothing is delivered either, to an endpoint or to an inbox, until it is back. Neither delivery is instant: webhooks are signed and batched daily (the format and the verifier), and a digest is one mail a day — on a day when nothing matched, no mail at all.

Every tool returns the same envelope — data, citation, url, source, note — and every result links back to its page on legalize.dev. A tool-level failure is a successful call whose data is a structured error naming what to do next, so the model can correct itself instead of guessing.

Examples (ask your assistant)

  • "What did article 348 bis of the Spanish Companies Act say in March 2023?"
  • "Has the French Code du travail changed on this point since 2020? Show me the diff."
  • "Which norms have amended this law, and when?"
  • "How much of Latvian legislation does Legalize actually hold?"
  • "Email me every morning when anything about data protection changes in Spain — in Spanish."

Authentication

Sign-in required; there is no anonymous access. Every call is tied to an account, and an unauthenticated request gets 401 with the WWW-Authenticate challenge that starts the OAuth flow.

Your client discovers the authorization server from https://legalize.dev/.well-known/oauth-protected-resource, registers itself dynamically, and sends you to sign in once in a browser. After that it holds the token and you never see the handshake again. No API key is pasted anywhere.

Limits

There is a free monthly allowance and a per-minute burst guard. Neither number is written here on purpose — they would go stale the day either changes, and a README that quietly lies about a limit is worse than one that points at it. Both are stated, live, on legalize.dev/mcp and legalize.dev/pricing.

What does not change: past the monthly allowance the connector answers quota_exceeded and stops until the month rolls over — nothing is charged and nothing is cut off silently. Every country is included in every tier.

Before you quote it

Most of the corpus is consolidated: amendments are folded into the text, so what you read is the law as it stands. Some of it is not. A text published as enacted comes back flagged, with the norms that amend it named, and never as the law in force — but the flag is only useful if you read it before pasting the quote into a brief.

Three more limits worth knowing:

  • A date resolves to what was published on or before it, not to what was in force.
  • Article boundaries are derived by matching headings in the text, not published as structure by the source. Quote the anchor, and check the boundary before relying on it.
  • Counts are of what Legalize has ingested, not of what the official gazette has published. A gap in the corpus is not evidence that a norm does not exist.

A body is never truncated: a law too large to send whole comes back as its table of contents with instructions for asking again, because half an article reads exactly like a whole one.

For developers

Transport is Streamable HTTP, stateless. Every JSON-RPC method needs a token, initialize and tools/list included. So the first thing to check is the catalogue, which is served beside the endpoint as a plain GET and needs nothing:

bash
curl -s https://legalize.dev/mcp/tools.json | jq '.tools[] | {name, readOnly}'

That is what a directory reads, and it is where readOnly per tool is published. The JSON-RPC endpoint itself answers 401, and that 401 is the handshake — its WWW-Authenticate header is what tells a client where the authorization server is:

bash
curl -si -X POST https://legalize.dev/mcp \  -H 'Content-Type: application/json' \  -H 'Accept: application/json, text/event-stream' \  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_countries","arguments":{}}}' | head -20# 401 + WWW-Authenticate: Bearer ... resource_metadata="..."   ← correct: that is the handshake

Once signed in, the same call answers with the tool's payload.

What is behind the data

Legalize builds one public git repository per country: every law is a Markdown file, and every reform it holds is a dated commit. That is where the SHA in an answer comes from — it is a commit in a public repo, not an identifier minted for the reply.

Where a corpus starts later than the act it holds — a source that publishes its consolidated texts from 1996 onwards, say, for a code from 1885 — reform_history says so in history, and asking for a date before that is a plain "the corpus starts on X", never a retry.

Ask what the Spanish Companies Act said in March 2023 and the answer carries commit 3b9aea8d5 of legalize-dev/legalize-es:

git show 3b9aea8d5:es/BOE-A-2010-10544.md

returns that file: the text the connector hands back, under the YAML frontmatter the corpus keeps its metadata in. The connector reaches every country Legalize publishes — the live list, with the size of each corpus, is on legalize.dev and from the list_countries tool.

More

About Legalize

Legalize turns official gazettes into git: consolidated legislation as Markdown, one commit per reform, one repository per country. This repository documents its MCP connector — the surface an AI assistant talks to.

legalize.dev · MIT licence

來源:README.md,提交 986d00d

工具

0
該伺服器需要登入,因此 SourceWeft 無法在沒有帳號的情況下讀取其工具,也未收錄。已連接帳號所能看到的內容可能因帳號及其權限而異。

版本歷史

1
  1. v0.18.0最新Sep 16, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Legalize 整合