Skip to main content
Glama
paulieb89

BAILII MCP Server

by paulieb89

BAILII MCP Server

PyPI Install in VS Code

Search UK case law on BAILII. Retrieve judgments with automatic section extraction (summary, conclusions, discussion, background). Runs locally — BAILII blocks cloud IPs.

Install

No install needed — uvx runs it directly from PyPI:

uvx bailii-mcp

Using pip

pip install bailii-mcp
bailii-mcp

Requires 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-mcp

VS 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

bailii_search

Full-text search across all BAILII courts. Returns titles, citations, and links.

bailii_get_judgment

Retrieve judgment text. Defaults to summary + conclusions (~5000 chars).

bailii_list_courts

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 tools
bailii_get_judgmentGet BAILII Judgment TextA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault
paramsYesInput containing: - path (str): BAILII document path - section (str, optional): 'summary', 'conclusions', 'held', 'discussion', 'background', 'all' - max_chars (int, optional): Maximum characters to return (default 5000)

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint and idempotentHint. Description adds valuable context: default returns summary+conclusions or first 5000 chars, section='all' for full text, and max_chars limit. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences: first states purpose, second gives essential usage. No unnecessary words, front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of output schema, return values need not be explained. Tool prerequisites, default behavior, and all options are covered. Sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with detailed descriptions. The main description adds pragmatic usage context (e.g., 'Obtain this from bailii_search') and clarifies default behavior, complementing the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Retrieve') and resource ('BAILII judgment'), with the option to filter by section. It distinguishes from siblings by specifying reliance on path from bailii_search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly advises to 'Use the path returned by bailii_search', setting clear context for when to use. Could further clarify when not to use, but guidance is strong.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

bailii_list_courtsList Available BAILII CourtsA
Read-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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, so the description adds non-critical context about the return format (JSON mapping codes to names). No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with three well-structured sentences. No wasted words; front-loaded with purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and the presence of an output schema, the description fully covers what the tool does and what it returns. No gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so the baseline is 4. The description does not need to add parameter details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The title and description clearly state the verb 'list' and resource 'courts'. It is distinct from sibling tools (bailii_get_judgment, bailii_search) which perform different actions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the output is useful for constructing BAILII URLs or understanding search results, providing context for when to use it. It does not explicitly exclude scenarios but is sufficient for this simple tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv1.0.2
    • First observedbailii_get_judgment
    • First observedbailii_list_courts
    • First observedbailii_search

TDQS

A4.5/5.0
Disambiguation5/5

Each tool has a distinct purpose: searching case law, listing courts, and retrieving a judgment. No overlap or ambiguity.

Naming Consistency5/5

All tools follow the consistent pattern 'bailii_verb_noun' (list_courts, search, get_judgment), making it predictable.

Tool Count5/5

Three tools are well-scoped for a legal research server, covering search, court info, and judgment retrieval without unnecessary bulk.

Completeness4/5

The core workflow of searching and retrieving judgments is complete. However, advanced filtering by court or date is missing, which slightly limits coverage.

Maintenance

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/paulieb89/bailii-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server