BAILII MCP Server
Search and retrieve UK case law from BAILII locally, with targeted judgment-section extraction.
Full-text search across BAILII courts and tribunals, returning titles, citations, and document paths.
Retrieve judgments by BAILII path, defaulting to summary + conclusions or first 5,000 characters.
Request a specific section: summary, conclusions, held, discussion, background, or full text.
Control returned text length up to 200,000 characters.
List available UK court/tribunal codes such as UKSC, EWCA, EWHC, UKUT, and EAT.
Runs locally because BAILII blocks cloud/datacenter IPs.
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., "@BAILII MCP Server Search BAILII for cases about HMO licensing"
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.
BAILII MCP Server
Maintained by BOUCH — private hosting, custom tools and setup: paul@bouch.dev · bouch.dev/products/bailii-mcp
Search UK case law on BAILII. Retrieve judgments with automatic section extraction (summary, conclusions, discussion, background). Runs locally — BAILII blocks cloud IPs.
Install
Using uv (recommended)
No install needed — uvx runs it directly from PyPI:
uvx bailii-mcpUsing pip
pip install bailii-mcp
bailii-mcpRequires Python 3.10+.
Related MCP server: UK Case Law MCP Server
Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"bailii": {
"command": "uvx",
"args": ["bailii-mcp"]
}
}
}Claude Code
claude mcp add bailii -- uvx bailii-mcpVS Code
Add to .vscode/settings.json or use the MCP panel:
{
"mcp": {
"servers": {
"bailii": {
"command": "uvx",
"args": ["bailii-mcp"]
}
}
}
}Using pip instead of uvx
If you installed via pip install bailii-mcp, use "command": "bailii-mcp" and "args": [] instead.
From source
git clone https://github.com/paulieb89/bailii-mcp.git
cd bailii-mcp
pip install -e .What You Can Ask
Once connected, just ask Claude naturally:
"Search BAILII for cases about HMO licensing"
"Find recent whistleblowing employment tribunal cases"
"Get the summary of Chinn v Hoilund-Carlsen"
"What did the court hold in that case?"
"Show me the discussion section"
Tools
Tool | What it does |
| Full-text search across all BAILII courts. Returns titles, citations, and links. |
| Retrieve judgment text. Defaults to summary + conclusions (~5000 chars). |
| List available UK courts (UKSC, EWCA, EWHC, UKUT, EAT, etc). |
Section Extraction
Judgments are large (30-100KB). By default, only the summary and conclusions are returned. Ask for more if you need it:
Default: summary + conclusions (5000 chars)
Specific section: "show me the discussion" → pulls just that section
Full text: "get the complete judgment" → returns everything
Sections detected: summary, conclusions, held, discussion, background
Why Local?
BAILII blocks requests from cloud servers and datacenters. This server runs on your machine, so requests go through your residential IP.
For case law that doesn't need BAILII specifically, uk-legal-mcp provides case law via the National Archives API — hosted on Fly.io, no local setup needed.
This BAILII server is useful when you need:
Employment tribunal decisions (EAT coverage is stronger on BAILII)
Older cases not yet in the TNA database
Specific tribunals with better BAILII indexing
Notes
BAILII terms prohibit bulk downloading — use for targeted research only
Be reasonable with request rate
Section extraction depends on judgment formatting — not all judgments have clear section headers
Licence
Apache 2.0
Author
Paul Boucherat — building MCP servers for UK property, legal, and project controls.
Available Tools
3 toolsbailii_get_judgmentGet BAILII Judgment TextARead-onlyIdempotent
Retrieve a BAILII judgment, optionally filtered to a specific section.
Use the path returned by bailii_search. By default returns summary + conclusions (or first 5000 chars if no sections detected). Use section='all' for the complete text.
Inputs: params (required). Returns: result
bailii_list_courtsList Available BAILII CourtsARead-onlyIdempotent
List the main UK courts and tribunals available on BAILII.
Returns court codes useful for constructing direct BAILII URLs or understanding search results.
Returns: str: JSON object mapping court codes to court names.
Inputs: no named parameters. Returns: result
bailii_searchSearch BAILII Case LawARead-onlyIdempotent
Search BAILII for UK case law by keyword or phrase.
Searches the full BAILII database including UKSC, EWCA, EWHC, House of Lords, tribunals, and Irish courts. Returns a list of matching cases with titles, citations, and document paths to use with bailii_get_judgment.
Inputs: params (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct purpose: searching case law, listing courts, and retrieving a judgment. No overlap or ambiguity.
All tools follow the consistent pattern 'bailii_verb_noun' (list_courts, search, get_judgment), making it predictable.
Three tools are well-scoped for a legal research server, covering search, court info, and judgment retrieval without unnecessary bulk.
The core workflow of searching and retrieving judgments is complete. However, advanced filtering by court or date is missing, which slightly limits coverage.
Maintenance
Related MCP Connectors
Search UK Acts, Statutory Instruments, and legislation with full text retrieval
Search U.S. case law, fetch opinions, and ask matter-aware legal questions over your documents.
Polish statutes (Dziennik Ustaw, ELI) and court rulings (SAOS) for AI agents. Runs on Apify.
Search case law and legislation and work with accessible matters and documents in stella.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides comprehensive tools for searching UK case law, legislation, parliamentary Hansard debates, and HMRC tax guidance. It features a specialized OSCOLA citation parser to extract and resolve legal references directly from text.36474 PyPI21MIT
- AlicenseNot gradedqualityDmaintenanceEnables searching and retrieving UK case law from The National Archives, including full judgments with filtering by court, legal area, and date range.26PolyForm Noncommercial 1.0.0
- AlicenseNot gradedqualityDmaintenanceProvides programmatic access to UK legal documents with hybrid semantic search and Model Context Protocol integration for AI assistants.83MIT
- AlicenseNot gradedqualityNot gradedmaintenanceProvides access to CanLII's Canadian legal information, enabling search and retrieval of court decisions, legislation, and citations through natural language.MIT