LexGraph MCP documentation
Current public reference for connecting LexGraph to MCP-compatible AI assistants.
Current public reference for connecting LexGraph to MCP-compatible AI assistants.
MCP schema 3.4.0 · updated November 5, 2026
Connection and authentication
LexGraph provides a stateless Streamable HTTP endpoint. Requests and responses use JSON; the production endpoint does not stream SSE progress notifications.
MCP URL: https://api.lexgraph.de/mcp
- Transport
- MCP Streamable HTTP
- Authentication
- OAuth 2.0 or MCP key
- OAuth scope
- mcp
- Response mode
- one JSON response per request
OAuth 2.0 (recommended)
OAuth-capable clients connect through Dynamic Client Registration and Authorization Code with PKCE. The client handles registration, token exchange and refresh automatically.
- Add the MCP URL as a custom remote MCP server in your client.
- Choose OAuth 2.0 with Dynamic Client Registration if your client asks.
- Sign in to LexGraph and approve the connection.
- After the redirect, the client loads the current LexGraph tool list.
MCP key (for header authentication)
Clients without OAuth can use a personal MCP key. Create it in your LexGraph profile and send Authorization: Bearer <MCP_KEY>. The complete key is shown once; rotation revokes the previous key but does not reset quota.
Available tools
- lexgraph_search_legal_graph
- Creates a legal memorandum server-side with LexGraph permalinks as a factual basis. The assistant may translate, summarize, and rephrase it according to response_contract.
- lexgraph_search_legal_graph_enriched
- lexgraph_search_legal_graph_enriched researches German and European law and drafts a legal answer with structured sources for citations, source cards, source lists, and later questions. It works independently, including when lexgraph_search_legal_graph is disabled.
- lexgraph_search_legal_data
- Uses the same Engine research paths without generating an answer. For an unambiguously identified court decision, its description contains the available full-text sections.
- lexgraph_get_documents
- Loads the full text of specifically cited legal sources, such as court decisions by file number, statutes, and official publications. Pass several citations separated by commas; each one receives its own status.
- lexgraph_get_capabilities
- Returns the schema version, server-selected search paths, plan-dependent data sources, filter values, limits, and idempotency contract.
- lexgraph_get_mcp_usage
- Returns the current plan and quota snapshot without consuming quota.
All six tools are read-only, non-destructive and limited to public LexGraph data. Diagnostics and development controls remain in the local admin preview. Unknown arguments are rejected.
Parameters and responses
lexgraph_search_legal_graph
| Parameter | Default | Meaning and values |
|---|---|---|
query | required | Required complete contents of the original user message, copied character-for-character. Do not shorten, rewrite, translate, or decompose it client-side; maximum 20,000 characters or the lower account limit. |
request_id | null | Optional retry ID of 8–128 characters: start with a letter or digit, followed by letters, digits, period, underscore, colon, or hyphen. Reuse only for identical retries of the same tool; use a new ID for every new message or follow-up. |
filters | null | Optional filters object matching the API, only for restrictions explicitly requested by the user. Omitted, null, or empty filters leave the search unfiltered. |
lexgraph_search_legal_graph_enriched
| Parameter | Default | Meaning and values |
|---|---|---|
query | required | Required complete contents of the original user message, copied character-for-character. Do not shorten, rewrite, translate, or decompose it client-side; maximum 20,000 characters or the lower account limit. |
request_id | null | Optional retry ID of 8–128 characters: start with a letter or digit, followed by letters, digits, period, underscore, colon, or hyphen. Reuse only for identical retries of the same tool; use a new ID for every new message or follow-up. |
filters | null | Optional filters object matching the API, only for restrictions explicitly requested by the user. Omitted, null, or empty filters leave the search unfiltered. |
lexgraph_search_legal_data
| Parameter | Default | Meaning and values |
|---|---|---|
query | required | Required complete contents of the original user message, copied character-for-character. Do not shorten, rewrite, translate, or decompose it client-side; maximum 20,000 characters or the lower account limit. |
request_id | null | Optional retry ID of 8–128 characters: start with a letter or digit, followed by letters, digits, period, underscore, colon, or hyphen. Reuse only for identical retries of the same tool; use a new ID for every new message or follow-up. |
filters | null | Optional filters object matching the API, only for restrictions explicitly requested by the user. Omitted, null, or empty filters leave the search unfiltered. |
lexgraph_get_capabilities
No parameters. Returns schema_version=3.4.0, the paths lexgraph_legal_agent, lexgraph_cases, and lexgraph_entity, available data sources, search.filters with filter values and limitations, search.specialist_documents for specialist sources, permalink_pinpoints with pinpoint parameters and examples, fixed Engine limits, and the request_id/idempotency contract. This tool does not consume research quota.
lexgraph_get_mcp_usage
No parameters. Returns the plan and limit, remaining, used and reset_at for the research quota. This call does not consume quota.
Search response
- LexGraph Memorandum returns answer followed by response_contract with mode=reference, output instruction, citation standard, and answer_sha256. Translation, summarization, and rephrasing are allowed while preserving legal meaning, source attribution, and URLs. The checksum identifies the original answer.
- lexgraph_search_legal_graph_enriched returns answer, response_contract, and searchable_entities. Statutes, decisions, and concepts retain title and, when resolvable, permalink and citation_markdown as in lexgraph_search_legal_data. These sources may be displayed as linked citations, source cards, or a source list.
- LexGraph Legal Data returns trace_id, original_query, search_mode, count, entities, quota_charged, and usage, but no answer.
- For an unambiguous direct lookup of a court decision, the primary entity description contains available sections such as headnotes, operative provisions, facts, and decision grounds.
- Statute entities may contain book, slug, and prefix_category; resolvable sources contain citation-ready Markdown permalinks.
- Internal reranking scores, diagnostics, and local development controls are not returned publicly.
Full texts
lexgraph_get_documents loads the full text of documents that are already specifically known: court decisions, statutes, EU legal acts, Bundestag printed papers, Federal Law Gazette publications, and BMF letters. It is not one of the three research tools, may be called in addition to them, and does not consume research quota. Typical use: the user or a research result names a decision by file number and its exact wording matters.
lexgraph_get_documents
| Parameter | Default | Meaning and values |
|---|---|---|
references | required | Required; one or more citations as written, separated by commas, maximum 2,000 characters. The server recognizes what is meant. The id and continuation values returned by the tool are also valid. At most ten citations per call. |
| Status | Meaning and values |
|---|---|
found | text holds the document text; decisions carry Rn. 12: and Leitsatz 1: labels as in the research tools. Entries include id, citation and, where available, permalink or source_url plus citation_markdown. |
ambiguous | Several documents match. candidates lists id, citation, and decision type; the client passes the chosen id. |
not_found | The citation was recognized but is not in the database; message explains what is missing. |
not_recognized | No citation was recognized in this part. |
deferred | Not included because of the response size or citation limit; pass continuation again. |
error | The lookup failed; the other citations are unaffected. |
- Commas inside a citation are harmless: BGH, Urt. v. 28.09.2022, VIII ZR 319/20 and §§ 823, 826 BGB are each recognized as one citation.
- File numbers are not unique. Court, place, date, and decision type in the citation narrow the candidates; a hint that matches no candidate is ignored.
- Each document contributes at most 60,000 characters and each response at most 120,000. Long texts are split at paragraph or page boundaries; continuation resumes exactly there, e.g. court_cases/1_BvR_2017_21?offset=59804.
- For not_found or not_recognized the tool returns no content. The assistant should not add or invent any text in that case.
Optional filters
All three research tools accept the same filters object as the API. The assistant sets it only for explicitly requested restrictions, does not infer additional filters from context, and keeps query unchanged.
| Parameter | Meaning and values |
|---|---|
rechtsgebiete | List of strings, e.g. ["Arbeitsrecht"]. Recommended values are advisory, not a closed enum. |
regionen | List containing Bund, EU, or German federal-state names. Uses the same spelling normalization and validation as the API. |
gerichte | List of standardized court codes, e.g. ["BAG", "BGH"]. Other strings are accepted, as in the API. |
zeitraum | Object with optional von and/or bis in YYYY-MM-DD format. Both boundaries are inclusive; von must not be later than bis. |
- All four fields are optional. Values within a list use OR; different applicable fields use AND.
- Court decisions support all four fields; statutes support legal area and region. Court and date filters do not exclude statutes.
- EU statutes and European decisions are currently excluded when filters are active. State-law coverage matches the API.
- Filters apply to every search path, including direct lookups and additional sources. Empty results do not automatically relax the filters.
- Unknown fields, invalid regions, and invalid date ranges are rejected before retrieval or quota consumption.
- lexgraph_get_capabilities publishes supported regions, recommended legal areas and court codes, and current limitations under search.filters.
Specialist sources since 3.2
- An explicit filters.rechtsgebiete selection of Steuerrecht, Medizinrecht or Transport- und Speditionsrecht adds specialist sources to research. Without these filters, the search path is unchanged.
- Up to 100 specialist document candidates receive a separate relevance assessment. Legal Data returns accepted documents in entities; Memorandum uses matching passages, and Enriched includes cited documents in searchable_entities.
- Specialist sources carry _id=legal_documents/<document_version_id> and document metadata with source URLs and available page/block locators. Capabilities describes this path under search.specialist_documents.
Precise source links
Since 3.3, permalinks can target cited decision paragraphs, headnotes, and statute provisions. The LexGraph reader opens and highlights the selected passage.
| Parameter | Meaning and values |
|---|---|
rn | A single numbered decision paragraph, a range, or several separate paragraphs. ?rn=12 · ?rn=12-14 · ?rn=12,15 · ?rn=12-14,20 |
ls | One or more headnotes; an empty value highlights all headnotes. ?ls=1 · ?ls=1,2 · ?ls= |
abs / satz / nr / lit | Subsection, sentence, number, and letter within a statute provision. ?abs=1&satz=2 · ?nr=44&satz=1 · ?abs=1&nr=2&lit=a |
- Decision passages include available pinpoint labels such as Rn. 12: … or Leitsatz 1: …. Cite only numbers actually labeled in the supplied context.
- Memorandum and Memorandum Enriched add pinpoint parameters server-side. The assistant preserves the returned source URLs, including their parameters, when translating, summarizing, or rephrasing.
- For Legal Data, the assistant appends parameters to the returned permalink. Multiple paragraph numbers must match in the citation and the link, for example Rn. 12, 15 and ?rn=12,15.
- lexgraph_get_capabilities describes supported parameters, context labels, and examples under permalink_pinpoints. Existing permalinks without pinpoint parameters remain valid.
Search modes, collections and plans
| Mode | Use case | Selection |
|---|---|---|
lexgraph_legal_agent | Default path with server-side research planning, Entity Recall, and relevance assessment. | selected server-side |
lexgraph_cases | Automatic specialist path for pure case-law research. | selected server-side |
lexgraph_entity | Automatic direct lookup for an unambiguously resolvable statute or decision. | selected server-side |
| Plan | Shared Engine & MCP quota | Collections (standard modes) | Memorandum |
|---|---|---|---|
| Free | 25 total / 10 trial days | laws, court_cases | Yes |
| Basic | 50 / month | laws, court_cases | Yes |
| Advanced | 100 / month | laws, court_cases | Yes |
| Professional | 200 / month | laws, court_cases | Yes |
| Enterprise | Custom | laws, court_cases | Yes |
MCP research uses statutes and court decisions, with specialist sources added for explicit Steuerrecht, Medizinrecht or Transport- und Speditionsrecht filters. Commentaries and references are not part of the current MCP research path. lexgraph_get_capabilities reports available sources and account limits.
Additional technical account limits
- 30 requests per minute
- 1,000 requests per day
- 2,000,000 request characters per month
- maximum 20,000 characters per request
- research breadth and candidate count are selected server-side
Example calls
Inspect the current account capabilities
{}Memorandum with a safe retry ID
{
"query": "Which German labour-law decisions by the BAG since 2020 are relevant?",
"request_id": "search-20261103-001",
"filters": {
"rechtsgebiete": [
"Arbeitsrecht"
],
"gerichte": [
"BAG"
],
"zeitraum": {
"von": "2020-01-01"
}
}
}Load the full texts of several citations
{
"references": "BGH, Urt. v. 28.09.2022, VIII ZR 319/20, § 626 BGB, BT-Drs. 19/4672"
}Quotas and safe retries
- Research in the LexGraph Engine and successful MCP searches share the same account quota.
- The Free trial includes MCP research across statutes and court decisions, plus Memorandum, with a total of 25 research requests shared by Engine and MCP. New accounts receive ten days after account creation; existing accounts receive ten days after the trial rollout. No payment details are required. After the trial expires or the quota is used up, further AI research requires a paid plan. The trial ends automatically and does not automatically turn into a paid subscription. Manual search in the publicly accessible legal database remains free.
- A successful search consumes one research call from the shared research quota plus normal request and character usage. Failed searches are not charged. See reset_at for the next renewal.
- Plan entitlements and quota are enforced server-side on every call; capabilities and usage expose read-only status snapshots.
- request_id is optional for search. Reusing it with identical parameters within eight days is not charged twice; reuse with different parameters, including active filters, is rejected. List order and normalized region spellings do not change the retry comparison.
- Quota is tied to the user account. Rotating an MCP key does not reset it.
- lexgraph_get_documents does not consume research quota; calls are recorded for usage analytics.
Errors and error codes
- HTTP 401: authentication is missing, invalid or expired.
- HTTP 403: the required scope or account access is missing.
- JSON-RPC -32601: unknown or removed tool.
- JSON-RPC -32602: invalid parameters, unknown fields or unsupported values.
- Tool error: quota exceeded, plan disallows a mode/collection, request_id conflict or internal retrieval failure. Tool errors are not necessarily HTTP errors.
Privacy and data use
MCP queries are anonymized locally on the LexGraph server before retrieval and model calls: detected personal data is replaced with placeholders. The mapping stays in memory for that request; Memorandum and Memorandum Enriched restore the original values only in the returned answer. Legal Data returns the caller’s own query in original_query; retrieval and research logs use the anonymized query. An anonymization failure or timeout aborts research. The account ID is used for access control, usage analytics, and quota accounting. MCP tools do not upload documents, access private user documents, or modify the knowledge graph. MCP HTTP profiling records technical metadata, not research queries or authentication tokens. lexgraph_get_documents uses the submitted citations only for database lookups on the LexGraph server, without model calls; citations are not anonymized and should not contain personal data.
Known limitations
- Memorandum and Memorandum Enriched return a reference answer that the assistant may adapt under response_contract. With Legal Data, the assistant drafts from the returned entities.
- Coverage depends on material currently available in LexGraph and may be incomplete.
- Search mode, sources, decomposition, candidate count, and reranking are exclusively server-selected in version 3.4.0 and are not public tool arguments.
- A general case-law search does not guarantee a complete decision text. lexgraph_get_documents returns the full text of known citations.
- lexgraph_get_documents does not currently resolve Bundesrat printed papers or ECLI identifiers; hidden documents are treated as not found.
- lexgraph_search_legal_graph_enriched permits linked source displays from searchable_entities. Retain court, date, and file number, plus the source links and pinpoint parameters from answer. Do not append the raw array or description texts wholesale as an additional answer or invent missing links.
- Progress is reported internally only after 45 seconds; the production JSON endpoint does not stream it to HTTP clients.
- Results are research aids and do not replace professional legal assessment.
Changelog
3.4.0 · 5 November 2026
- New tool lexgraph_get_documents (LexGraph Volltexte): loads the full text of specifically cited sources, several separated by commas, with a status per citation, candidates for ambiguous file numbers, and continuation for long documents.
- The tool is read-only, accepts only references, and does not consume research quota. The three research tools are unchanged; refresh the MCP client tool list after updating.
3.3.0 · 2 November 2026
- Added precise permalink targets for decisions (rn, ls) and statutes (abs, satz, nr, lit).
- Decision passages include paragraph and headnote labels; Memorandum automatically links cited passages, while Legal Data clients append the parameters.
- Capabilities publishes permalink_pinpoints with parameters and examples. Inputs remain query, optional request_id, and optional filters; refresh the MCP client tool list after updating.
3.2.0
- Added specialist sources for explicit Steuerrecht and Medizinrecht filters in all three research tools.
- Added documents with source and passage metadata plus search.specialist_documents in Capabilities. Calls without these filters remain compatible.
3.1.0 · 28 September 2026
- Added the optional filters object to Memorandum, Memorandum Enriched, and Legal Data, with the same values and validation as the API.
- Filters are set only for explicitly requested restrictions and apply to every search path.
- Active filters are normalized for the request_id comparison. Retries without filters remain compatible.
- Capabilities describe filter values and limitations. Refresh the MCP client tool list after updating; existing calls without filters remain valid.
3.0.0 · 21 August 2026
- The public MCP now calls the same implementation functions as the internal Answer Preview, so preview and publication share one execution path.
- The public contract now contains five read-only tools: Memorandum, Memorandum Enriched, Legal Data, Capabilities, and Usage.
- Version 3.0.0 accepted only query and optional request_id for the three research tools; version 3.1.0 adds filters. Clients copy the original user message verbatim; the server selects mode, sources, decomposition, limits, and reranking.
- Memorandum introduced answer plus a cryptographically verifiable response_contract and initially required verbatim output. Enriched adds only cited searchable_entities; Legal Data returns entities without a finished answer.
- Automatic routing uses lexgraph_legal_agent, lexgraph_cases, or lexgraph_entity. The previous client-selected modes and search parameters are not part of the public v3 schema.
- Statute results may contain book, slug, and prefix_category; permalinks and citation metadata remain part of serialized entities.
- Raw diagnostics and development controls stay in the protected local preview, while its default paths run the same functions as /mcp.
2.3.1 · 19 August 2026
- The default MCP search limit changed from 40 to 30 results.
2.3.0 · 19 August 2026
- The search mode selection was reduced to embeddings, graph_search, and agentic_search.
- Graph Search now handles standard routing and retrieval fallbacks.
2.2.2 · 18 August 2026
- The default MCP search limit increased from 20 to 40 results.
2.2.1 · 18 August 2026
- embeddings is now the default MCP search mode; graph_search remains available explicitly.
2.2.0 · 14 August 2026
- lexgraph_get_capabilities now returns the complete current legal-area and standardized-court recommendations under search.filters.recommended_values.
- Recommendations remain open to future or database-specific values and are not enforced as closed input enums.
2.1.0 · 14 August 2026
- Added the optional filters object for legal area, region, court, and date range.
- Documented source-aware AND/OR semantics and state statutes retrieved through configured Arango Views.
- Temporarily excluded EU statutes and European decisions when filters are active.
2.0.1 · 1 August 2026
- Added lexgraph_get_capabilities and the 2.0.1 schema contract.
- Made limit=20 an explicit schema default; use a lower value only when the user asks for fewer results.
- Documented plan-specific collections, agentic availability and shared research quotas.
- Added request_id, quota_charged, effective parameters and response contracts.
2.0.0 · 1 August 2026
- Introduced four search modes, quality-control behavior and strict parameter schemas.
- Documented optional relationships.
- Removed legacy answer and reference-extraction tools.
Support
For technical questions and incident reports, contact MCP support at office@lexgraph.de.