Rechtspraak MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Rechtspraak MCP Server search for recent cases about privacy"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Rechtspraak MCP Server
MCP (Model Context Protocol) server for searching and analyzing Dutch case law from rechtspraak.nl. Provides advanced search capabilities with query expansion, legal synonyms, faceting, and citation analysis.
Table of Contents
Related MCP server: korean-law-mcp
Features
π MCP Server
Advanced Search: Full-text search with query expansion and Dutch legal synonyms
Faceted Search: Filter by court, legal area, date range, and procedure type
Citation Analysis: Extract and analyze case citations (incoming and outgoing)
Similar Cases: Find similar cases using MoreLikeThis algorithm
Legal Article Search: Search cases by specific legal articles
Trend Analysis: Analyze temporal trends in case law
Query Expansion: Automatic expansion with legal terms and synonyms
Rate Limiting & Caching: Built-in governance layer for production use
π₯ Data Import
Fetch case law XML from rechtspraak.nl feeds
Extract links and download case files
Automated batch processing
π Indexing
Parse XML documents with structured sections
Enrich with metadata (court types, legal domains, procedures)
Full-text indexing in Solr
Schema management and validation
Architecture
src/
βββ mcp/ # MCP server (main feature)
β βββ mcp_server.py # MCP server implementation
β βββ mcp_schemas.py # Pydantic schemas for all tools
β βββ solr_adapter.py # Solr query adapter with advanced features
β βββ governance.py # Rate limiting & caching
β βββ legal_synonyms.py # Dutch legal synonyms expansion
β βββ reference_data.py # Court/procedure reference data
β
βββ importer/ # Data import from rechtspraak.nl
β βββ extract_links.py
β βββ fetch_link_files.py
β βββ fetch_content.py
β
βββ indexing/ # XML parsing and Solr indexing
β βββ xml_parser.py
β βββ solr_indexer.py
β βββ solr_setup.py
β βββ reindex_all.py
β
βββ cli.py # CLI for indexing
βββ config.py # ConfigurationInstallation
Prerequisites
Python 3.13+
uv (Python package manager)
Docker & Docker Compose (for Solr)
Setup
Clone the repository:
git clone <repository-url>
cd rechtspraak-solrStart Solr with Docker:
docker-compose up -d solrInstall dependencies:
uv syncConfigure environment variables (create
.envfrom.env.example):
cp .env.example .envSetup Solr collection and schema:
uv run rechtspraak-setupUsage
Interactive CLI
Run the interactive menu for all operations:
python main.pyOr use direct commands:
# Data pipeline
python main.py fetch-links 2023-01-01 2023-12-31
python main.py extract-links 2023-01-01 2023-12-31
python main.py fetch-content
# Indexing
python main.py reindex # Full reindex (delete + setup + index)
python main.py index # Index data only
python main.py fix-schema # Configure schema only
# MCP server
python main.py mcp # Start MCP server
python main.py test-mcp # Test connection
# Utilities
python main.py health # System health check
python main.py test-reference # Test reference dataMCP Server
The MCP server supports two modes:
Local Mode (stdio): For Claude Desktop/Code running on your machine
HTTP Mode (SSE): For remote access via API
Local Mode - Configuration for Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"rechtspraak": {
"command": "uv",
"args": [
"--directory",
"/path/to/rechtspraak-solr",
"run",
"rechtspraak-mcp"
],
"env": {
"SOLR_URL": "http://localhost:8983/solr",
"SOLR_COLLECTION": "rechtspraak"
}
}
}
}Local Mode - Configuration for Claude Code
Add to your Claude Code config (.claude/settings.local.json in project):
{
"mcp": {
"servers": {
"rechtspraak": {
"command": "uv",
"args": [
"--directory",
"/path/to/rechtspraak-solr",
"run",
"rechtspraak-mcp"
],
"env": {
"SOLR_URL": "http://localhost:8983/solr",
"SOLR_COLLECTION": "rechtspraak"
}
}
}
}
}HTTP Mode - Remote Access
For production deployment with remote access:
Start HTTP server:
docker-compose up -dConfigure nginx (see
config/nginx.conffor complete example):
location /sse {
proxy_pass http://127.0.0.1:8000/sse;
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_buffering off;
}Security: Set
MCP_API_KEYenvironment variable in your.envfile
Connecting to Remote MCP Servers
Claude Desktop/Code only supports stdio transport natively, not SSE/HTTP. To connect to remote MCP servers, use the included mcp-sse-client.js bridge client:
Add to Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"rechtspraak": {
"command": "node",
"args": [
"/path/to/rechtspraak-solr/mcp-sse-client.js"
],
"env": {
"BASE_URL": "https://rechtspraak-nl-mcp.knowably.ai",
"SSE_PATH": "/sse",
"API_KEY": "your-api-key-here"
}
}
}
}Optional environment variables for mcp-sse-client.js:
CLIENT_NAME- Custom client name (default: "mcp-sse-client")VERBOSE- Enable detailed logging (set to "true")MAX_RETRIES- Max connection attempts (default: 3)RETRY_DELAY_MS- Delay between retries in milliseconds (default: 2000)CONNECTION_TIMEOUT_MS- Connection timeout in milliseconds (default: 30000)
The bridge client acts as a local stdio process that Claude can communicate with, while internally translating requests to SSE/HTTP for the remote server. It includes automatic reconnection, configurable timeouts, and graceful error handling
Available MCP Tools
The server provides the following tools:
cases_search- Search cases with filters and facetingcases_get_by_ecli- Get specific case by ECLI identifiercases_expand_query- Expand query with legal synonymscases_highlight_passages- Extract relevant passages from a casecases_rerank- Rerank cases by relevancecases_get_similar- Find similar casescases_search_by_article- Search by legal articlecases_validate_ecli- Validate ECLI formatcases_bulk_get- Batch retrieve multiple casescases_analyze_trend- Analyze temporal trendscases_get_statistics- Get comprehensive statisticscases_get_court_stats- Compare courtscases_get_citations- Extract citationscases_compare- Compare multiple casescases_extract_entities- Extract legal entitiessystem_health- Check system health
Direct Entry Points
You can also use the entry points directly:
# Full reindex
uv run rechtspraak-reindex
# Index specific directory
uv run rechtspraak-index --data-dir ./data
# Setup collection and schema
uv run rechtspraak-setup
# Start MCP server
uv run rechtspraak-mcpDevelopment
Project Structure
MCP Server: Main feature providing search API via MCP protocol
Data Importer: Tools to fetch case law from rechtspraak.nl
Indexing: XML parsing and Solr indexing with enrichment
CLI: Command-line tools for management tasks
Testing
# Check MCP server
uv run rechtspraak-mcp
# Test indexing
uv run rechtspraak-index --data-dir ./test-data --verboseExample Queries
Once connected to an MCP client (Claude Desktop/Code), you can ask:
"Search for cases about 'aansprakelijkheid' in the last 5 years"
"Find cases citing ECLI:NL:HR:2019:1234"
"What are the trends in 'arbeidsrecht' cases from 2015 to 2023?"
"Find similar cases to ECLI:NL:RBDHA:2020:5678"
"Search cases mentioning Article 6:162 BW"
"Compare courts Hoge Raad and Rechtbank Amsterdam for tax cases"
License
Do whatever you want
Available Tools
16 toolscases_analyze_trendB
Analyze temporal trends in case law over time. Returns time-series data with insights on trend direction, peak periods, and growth patterns. Supports year/quarter/month granularity.
Inputs: query (required), start_year (required), end_year (required), granularity, +1 more.
cases_bulk_getA
Batch retrieve multiple cases by ECLI identifiers. Efficient way to fetch many cases in a single request (max 100).
Inputs: eclis (required), fields.
cases_compareA
Compare multiple cases side-by-side. Identifies similarities and differences in metadata, subjects, and procedures. Returns divergence score (0=identical, 1=completely different).
Inputs: eclis (required), comparison_aspects.
cases_expand_queryA
Expand a user query with Dutch legal synonyms, abbreviations, entities, and temporal hints. Returns structured must/should terms for better retrieval.
Inputs: query (required).
cases_extract_entitiesB
Extract entities from a case including cited cases, legal articles, monetary amounts, dates, and parties. Uses regex patterns for Dutch legal text.
Inputs: ecli (required), entity_types.
cases_get_by_ecliA
Retrieve a specific case by ECLI identifier with structured sections (Inhoudsindicatie, Overwegingen, Beslissing). Returns normalized metadata and paragraph-level anchors.
Inputs: ecli (required), section_selector.
cases_get_citationsA
Extract citations from a case. Returns both outgoing citations (cases this case cites) and incoming citations (cases that cite this case) with context snippets.
Inputs: ecli (required), include_context, direction.
cases_get_court_statsA
Compare statistics across multiple courts for a query. Returns case counts, date ranges, top subjects and procedures for each court.
Inputs: query (required), courts (required), date_from, date_to.
cases_get_similarA
Find similar cases using MoreLikeThis algorithm. Returns cases with similar content based on paragraphs and summary. Supports filtering by court and legal area.
Inputs: ecli (required), max_results, min_similarity, filters.
cases_get_statisticsA
Get comprehensive statistics for a search query including facet distributions (courts, legal areas, procedures), date ranges, and aggregate counts.
Inputs: query (required), filters, include_facets.
cases_highlight_passagesA
Extract the most relevant passages from a specific case for a given query. Returns paragraph-level snippets with anchors, ideal for compact context assembly.
Inputs: ecli (required), query (required), max_passages.
cases_rerankA
Rerank a list of cases by relevance to a query. Takes ECLI identifiers and returns calibrated scores with original ranks.
Inputs: query (required), eclis (required).
cases_searchB
Search for Dutch court cases with advanced query expansion, faceting, and snippet highlighting. Supports filters for court, date range, area of law, and procedure type.
Inputs: q (required), filters, rows, start, +1 more.
cases_search_by_articleA
Search for cases that mention a specific legal article (e.g., '6:162 BW', 'Art. 81 RO'). Returns cases with context snippets where the article is mentioned.
Inputs: article (required), interpretation, rows, start.
cases_validate_ecliA
Validate ECLI identifier format and check if case exists in database. Returns validation status and metadata if found.
Inputs: ecli (required).
system_healthA
Check system health, Solr connection status, rate limits, and cache statistics. Returns version and operational metrics.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 16 tools
Each tool targets a distinct function: search, retrieval, analysis, citations, entities, validation, and health checking. There is no ambiguity between tools; even similar-sounding ones like 'cases_get_statistics' and 'cases_get_court_stats' have clear differences.
All tools except the single health check follow a consistent 'cases_verb' pattern, using snake_case for verbs. This predictability aids agent selection and understanding.
With 16 tools covering search, retrieval, analysis, and validation, the count is well-scoped for a legal research server. No tool feels superfluous, and the set is neither too sparse nor bloated.
The tool surface covers core workflows: search, fetch, compare, analyze trends, extract citations/entities, and health check. Minor gaps exist, such as a dedicated tool to list available courts or legal areas, but these are indirectly supported via search filters.
Maintenance
Related MCP Connectors
MCP server for Open Archives: Dutch genealogical records and historical page transcriptions.
Academic research MCP server for paper search, citation checks, graphs, and deep research.
Federal court records and PACER case data. 4 MCP tools for legal research.
MCP server for FCA Handbook compliance analysis with verbatim citations.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server providing AI agents access to CourtListener's comprehensive legal database, featuring semantic search, hybrid search, citation verification, and research tools.7MIT
- AlicenseBqualityAmaintenanceMCP server for Korean law data (statutes, precedents, regulations) with citation verification, impact analysis, and time comparison tools.106,978 npm2,855MIT
- FlicenseNot gradedqualityNot gradedmaintenanceMCP server that enables searching and retrieving judicial decisions from the Uruguayan National Public Jurisprudence Database (BJN).-
- AlicenseAqualityAmaintenanceMCP server for searching Swiss court decisions from federal and cantonal courts via entscheidsuche.ch. Enables full-text search, law reference lookup, and filtering by canton, court level, and date without API keys.820 PyPI1MIT