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.0.0 · updated August 21, 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 finished legal memorandum server-side, with LexGraph permalinks and a binding verbatim response contract.
- lexgraph_search_legal_graph_enriched
- Creates the same memorandum and additionally returns the entities actually cited as machine-readable context for later questions.
- 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_capabilities
- Returns the schema version, server-selected search paths, plan-dependent data sources, limits, and idempotency contract.
- lexgraph_get_mcp_usage
- Returns the current plan and quota snapshot without consuming quota.
All five 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 stable retry ID of 8–128 characters: letters, digits, period, underscore, colon and hyphen. |
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 stable retry ID of 8–128 characters: letters, digits, period, underscore, colon and hyphen. |
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 stable retry ID of 8–128 characters: letters, digits, period, underscore, colon and hyphen. |
lexgraph_get_capabilities
No parameters. Returns schema_version, the server-side paths lexgraph_legal_agent, lexgraph_cases, and lexgraph_entity, plan-dependent data sources, 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=verbatim, output instruction, citation standard, and SHA-256 checksum.
- LexGraph Memorandum Enriched adds searchable_entities. This is background context only and must not be appended to the visible answer.
- 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.
Search modes, collections and plans
| Mode | Use case | Selection |
|---|---|---|
lexgraph_legal_agent | Default path with internal question decomposition, Engine retrieval, entity lookup, and reranking. | 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 / week | laws, court_cases | Yes |
| Advanced | 100 / week | concepts, laws, court_cases | Yes |
| Professional | 200 / week | concepts, laws, court_cases | Yes |
| Enterprise | Custom | concepts, laws, court_cases | Yes |
Collections unavailable on the plan are filtered server-side. If none remain, the call fails.
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-20260821-001"
}Quotas and safe retries
- Research in the LexGraph Engine and successful MCP searches share the same account quota.
- The Free plan includes 25 research calls. New accounts receive ten days after account creation; existing accounts receive ten days after the trial rollout. No further research is available afterward.
- A successful search consumes one research call from the shared weekly quota plus normal request and character usage. Failed searches are not charged. The weekly quota resets on Monday.
- 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 is rejected.
- Quota is tied to the user account. Rotating an MCP key does not reset it.
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 search queries are anonymised locally on the LexGraph server before research begins. People, addresses, email addresses and other structured identifiers are detected and replaced with typed placeholders. No external PII service is called for this step; only the cleaned query is passed to subsequent search stages. LexGraph also processes selected parameters and file numbers to execute the tool. The account ID is used for access control, tool-use analytics and quota accounting. MCP tools do not upload documents, access private user documents or modify the knowledge graph. MCP HTTP profiling records data including timestamps, tool name, status, timings, response size and request_id where supplied, but not the research query or authentication token. Never send access tokens or secret keys to support.
Known limitations
- Memorandum and Memorandum Enriched return a finished answer; only Legal Data leaves drafting to the connected assistant.
- 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.0.0 and are not public tool arguments.
- Only an unambiguous direct decision lookup through Legal Data can include available full-text sections in description; a general case-law search does not guarantee a complete decision text.
- searchable_entities from the Enriched tool is machine-readable context only and must not be emitted alongside the finished answer.
- 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.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.
- All three research tools accept only query and optional request_id. Clients copy the original user message verbatim; the server selects mode, sources, decomposition, limits, and reranking.
- Memorandum returns answer plus a cryptographically verifiable response_contract and requires 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.
- Local anonymisation now happens before the idempotency fingerprint and retrieval. Account limits still use the original query length; retrieval does not start if anonymisation fails.
- 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 weekly 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.