Gb MCP Server

MCP server for UK legislation (legislation.gov.uk): persistent identifiers and verifiable citations.

Local serverstdioPython

What is the Gb MCP server?

MCP server for UK legislation (legislation.gov.uk): persistent identifiers and verifiable citations. That is what the gb mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

An MCP server for legislation.gov.uk, The National Archives' official portal for United Kingdom legislation. It searches and retrieves Acts of Parliament, UK Statutory Instruments, and the equivalent instruments of the Scottish Parliament, Senedd Cymru/Welsh Parliament and Northern Ireland Assembly, with persistent identifiers and verifiable citations.

The tools it exposes

The server publishes 8 tools. What each one is for:

  • gb_search — Search legislation by text, doc type and year (/all/data.feed or /{doc_type}/data.feed)
  • gb_get_act — Fetch act/instrument metadata by reference (e.g. ukpga/2018/12)
  • gb_get_text — Fetch the full text (xml, html, akn/Akoma Ntoso, rdf, pdf, csv)
  • gb_recent_legislation — Legislation published since a date, newest-first, optionally by doc type
  • gb_search_case_law — Search UK judgments via The National Archives' Find Case Law Atom feed, by text, court, and date range
  • gb_get_case — Fetch a judgment by neutral citation, Find Case Law URI/path, or opaque id - returns Akoma Ntoso XML, or a PDF link fallback
  • gb_search_govuk — Search GOV.UK documents via the keyless Search API - employment/tax/property tribunal decisions, HMRC internal manuals, CMA cases - with server-side
  • gb_get_govuk_content — Fetch one GOV.UK document via the Content API - tribunal decisions return the judgment PDF link, HMRC manual sections return the full text

What it needs from you

Configuration is passed through the environment: GB_ELI_BASE_URL, GB_ELI_CASELAW_BASE_URL, GB_ELI_GOVUK_BASE_URL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Getting it running

gb-eli-mcp on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

How it compares

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Gb's toolset — gb_search, gb_get_act, gb_get_text and 5 more — is a fair guide to whether it matches your workflow. It is maintained by matematicsolutions; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
gb_searchSearch legislation by text, doc type and year (/all/data.feed or /{doc_type}/data.feed).
gb_get_actFetch act/instrument metadata by reference (e.g. ukpga/2018/12).
gb_get_textFetch the full text (xml, html, akn/Akoma Ntoso, rdf, pdf, csv).
gb_recent_legislationLegislation published since a date, newest-first, optionally by doc type.
gb_search_case_lawSearch UK judgments via The National Archives' Find Case Law Atom feed, by text, court, and date range.
gb_get_caseFetch a judgment by neutral citation, Find Case Law URI/path, or opaque id - returns Akoma Ntoso XML, or a PDF link fallback.
gb_search_govukSearch GOV.UK documents via the keyless Search API - employment/tax/property tribunal decisions, HMRC internal manuals, CMA cases - with server-side date filters and real totals.
gb_get_govuk_contentFetch one GOV.UK document via the Content API - tribunal decisions return the judgment PDF link, HMRC manual sections return the full text.

How to install the Gb MCP server

{
  "mcpServers": {
    "gb-eli": {
      "command": "uvx",
      "args": ["gb-eli-mcp"],
      "env": {
        "GB_ELI_BASE_URL": "your-value",
        "GB_ELI_CASELAW_BASE_URL": "your-value",
        "GB_ELI_GOVUK_BASE_URL": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
GB_ELI_BASE_URLEndpoint or connection string the server talks to.Yes
GB_ELI_CASELAW_BASE_URLEndpoint or connection string the server talks to.Yes
GB_ELI_GOVUK_BASE_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Gb to gb search.
  • Use Gb to gb get act.
  • Use Gb to gb get text.

Frequently asked questions

It connects Gb to MCP-compatible AI assistants such as Claude and Cursor, exposing 8 tools (gb_search, gb_get_act, gb_get_text, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Gb directly.