lawcorpus
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
lawcorpus
Read a published global legal corpus without reimplementing someone else's crawl. lawcorpus is a small forwarding client for the hosted Lawstronaut MCP service: the tool list is served from your own machine using the captured definitions, and each call is sent upstream, with the service's answer returned exactly as it arrived.
All sixteen of the service's captured tools are exposed, with no omissions. Start from the jurisdiction list to learn which iso codes are valid, walk the domain, category and law-type taxonomies, find the legal portals and issuing authorities behind a jurisdiction, list documents with structured filters, and read full document texts, markdown renderings, specific versions, and one-call citation chains. A recent-changes scan covers what moved in a jurisdiction over a chosen freshness window. Every tool is a read over published legal data; nothing is submitted anywhere.
The tools
list_jurisdictions— Every jurisdiction (country or state) in the corpus, with name,isocode and type. Call this first: the other tools key off theseisocodes. No arguments.list_domains— Legal domains, optionally filtered by name (domain), withlimit/offsetpagination. No required arguments.list_subdomains— Subdomains of one domain. Requiresdomain_id; optionalsubdomainname filter and pagination.list_categories— Legal categories, optionally narrowed bysubdomain_idorcategory_name, with pagination. No required arguments.list_subcategories— Subcategories of one category. Requirescategory_id; optionalsubcategory_namefilter and pagination.list_law_types— Law types under one subcategory. Requiressubcategory_id; optionallaw_typefilter and pagination.list_portals— Legal portals for a jurisdiction. Requiresiso; optionalname,tagandlangfilters.list_authority_types— Authority types for a jurisdiction. Requiresiso; optionalportal_nameandauthority_typefilters and pagination.list_issuing_authorities— Issuing authorities for a jurisdiction. Requiresiso; optionalportal_nameandissuing_authorityfilters and pagination.list_documents— Documents in a jurisdiction with structured filters and pagination. Requiresiso; optional filters includeportal,title,section_title,url,status,repealed, date fields,issuing_authority,type_of_authority, source identifiers,tagandlang.get_document_text— Full text for documents matching the same filter family aslist_documents. Requiresiso.get_markdown— Markdown renderings for documents matching the same filter family. Requiresiso.get_source_url— A time-limited signed URL to a document's original source file (PDF etc.), as issued upstream. Requires the numericdocument_id.get_document_with_version— One specific version of one document. Requires the numericdocument_idandversion.horizon_scan— Recent legal documents for a jurisdiction. Requiresiso; optionalsincefreshness window (defaultyesterday),topic,date_field,status, authority filters,include_repealedandmax_per_jurisdiction.evidence_pull— The full citation chain for one document in a single call: metadata with all dates and identifiers, the permanent legal link, a signed URL to the original source file where available, and the full document body. Requiresisoand the numericdocument_id;include_text,include_source_urlandtext_format(markdownorplain) are optional.
Related MCP server: lex-provenance-mcp
Install and run
As an MCP server via npm:
npx -y @reneturcios/lawcorpus mcpMCP client configuration:
{
"mcpServers": {
"lawcorpus": {
"command": "npx",
"args": ["-y", "@reneturcios/lawcorpus", "mcp"]
}
}
}As a container:
docker run -i ghcr.io/cloudcorprecords/lawcorpus
docker run --rm ghcr.io/cloudcorprecords/lawcorpus list_jurisdictions '{}'CLI
A single binary covers both the command line and the MCP server. Every tool is a subcommand whose one argument is a JSON string of that tool's inputs:
lawcorpus list_jurisdictions '{}'
lawcorpus list_documents '{"iso":"US","limit":5}'
lawcorpus get_document_text '{"iso":"NL","document_id":"123"}'
lawcorpus horizon_scan '{"iso":"IE","since":"7d"}'
lawcorpus evidence_pull '{"iso":"US","document_id":123}'
lawcorpus --versionExit codes: 0 for a successful forwarded call, 1 when the result that comes back is an error, and 2 for usage mistakes like an unknown subcommand or a JSON argument that does not parse.
Configuration
LAWSTRONAUT_MCP_URL— Replaces the upstream endpoint. Defaults to the pinned hosted endpoint,https://mcp.lawstronaut.com. (This override variable is a reconstruction introduced by this rebuild.)
The Lawstronaut registry record lists no headers for its remote, so lawcorpus never attaches an authentication header — every call goes upstream keyless.
When the upstream cannot answer — it returns a JSON-RPC error, answers with a non-2xx status, sends a body that cannot be read, or the request itself fails — the caller receives an error result whose text begins with lawcorpus error:.
How forwarding works
The first call of a process opens a session against the upstream: an initialize request (protocol version 2025-03-26), a notifications/initialized notification, and then the tools/call. If the service issues an Mcp-Session-Id header during initialize, lawcorpus repeats it on subsequent requests and keeps reusing that one session until the process ends. Replies are understood in both plain JSON and server-sent-events framing. Successful results are passed through untouched, isError flag and any extra fields included.
Development
npm install
npm run build # tsc -> dist/ (dist/cli.js is the bin)
npm test # tsx --test test/*.test.ts — stubbed upstream, no network
npm run dev # run the CLI from sourceThe suite compares the served tool list against the captured surface tool for tool, walks the session handshake and its reuse, proves no Authorization header is sent under any environment, and confirms that arguments travel upstream unchanged and results return unchanged.
License
MIT — see LICENSE. Copyright (c) 2026 Rene Turcios.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Public read-only MCP access to digital learning concepts, semantic relationships, and citations.
Read-only Streamable HTTP MCP for Nomos corpus search, 42 DoD gates, and governance comparisons.
15Official MCP connector for Legalize: read and search its whole open corpus, at any point in time.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Related MCP Servers
- AlicenseAqualityCmaintenanceA read-only MCP server providing access to national legislation from 37 jurisdictions via the legalize-dev corpus, with tools for searching, retrieving laws, and browsing reform history.5140 PyPIApache 2.0
- AlicenseNot gradedqualityCmaintenanceA read-only MCP connector for searching, fetching, and citing provenance-tracked legal corpora with verifiable content hashes.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to perform web search, extract page content, crawl sites, and map URLs through read-only tools.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables local chat clients to search preserved documents, follow explicit document links, and retrieve bounded, cited evidence through read-only MCP tools.MIT