Skip to main content
Glama

govuk-mcp

Maintained by BOUCH — private hosting, custom tools and setup: paul@bouch.dev · bouch.dev/products/govuk-mcp

PyPI Glama Install in VS Code Install in VS Code Insiders Install in Cursor

MCP server for GOV.UK — search, content retrieval, organisation lookup, and postcode resolution.

Tools

Tool

Description

govuk_search

Full-text search across 700k+ GOV.UK pages, with format and organisation filters

govuk_get_content

Page metadata and navigable section index for any GOV.UK page by base path

govuk_get_section

Body HTML for a single named section (anchor) of a GOV.UK page

govuk_grep_content

Regex/substring search within the body of a specific GOV.UK page

govuk_get_organisation

Get details for a UK government organisation (type, parent, children, contacts)

govuk_list_organisations

Paginated list of all government organisations registered on GOV.UK

govuk_lookup_postcode

Resolve a UK postcode to local authority, region, constituency, and NHS board

All data is sourced from official public GOV.UK APIs and postcodes.io. No API keys required.

Related MCP server: @mountainpass/addressr-mcp

Resources

For protocol-aware clients (Claude, Cursor, Inspector), the server also exposes govuk:// resource templates:

URI

Returns

govuk://content/{base_path*}/header

Page metadata (title, doc type, dates)

govuk://content/{base_path*}/index

Section anchor:heading list

govuk://content/{base_path*}/section/{anchor}

Bounded HTML for one section

govuk://content/{base_path*}/details/{field}

Schema-specific details field

govuk://content/{base_path*}/links/{rel}

Related content by link type

govuk://organisation/{slug}

Organisation profile

Connect

Hosted endpoint — no install, no API key:

https://govuk-mcp.fly.dev/mcp

Claude (web, desktop and mobile)

  1. Open Customize → Connectors (claude.ai/customize/connectors).

  2. Click Add custom connector.

  3. Name it govuk, paste the URL above and click Add. No sign-in is needed.

That's it — no config file to edit and no restart. Add the connector on web or desktop, and it's then available on your account, including the mobile apps. Turn it on or off per chat from the + menu → Connectors. On Team and Enterprise plans an Owner adds it once under Organization settings → Connectors; Free plans can add one custom connector.

Claude Code

If you've added the connector above, Claude Code lists it under /mcp — but only when Claude Code is signed in with your claude.ai subscription login, not an API key. Otherwise, add it directly:

claude mcp add --transport http --scope user govuk https://govuk-mcp.fly.dev/mcp

Other clients

VS Code and Cursor: use the install badges at the top of this page. For clients configured with mcpServers JSON:

{
  "mcpServers": {
    "govuk": {
      "type": "http",
      "url": "https://govuk-mcp.fly.dev/mcp"
    }
  }
}

Run it locally (stdio)

Local stdio mode isn't supported yet (#8); use the hosted endpoint.

APIs used

API

Base URL

Auth

GOV.UK Search

https://www.gov.uk/api/search.json

None

GOV.UK Content

https://www.gov.uk/api/content{path}

None

GOV.UK Organisations

https://www.gov.uk/api/organisations

None

postcodes.io

https://api.postcodes.io

None

License

MIT

Available Tools

7 tools
govuk_get_contentGet GOV.UK PageA
Read-onlyIdempotent

Get metadata and navigable section index for a GOV.UK page.

Returns the page title, document type, publication dates, and a list of sections with their anchor IDs and headings. Use govuk_get_section to read the body of a specific section, or govuk_grep_content to search within the page body.

Inputs: base_path (required). Returns: object

govuk_get_organisationGet GOV.UK OrganisationA
Read-onlyIdempotent

Get the profile of a UK government organisation by its slug.

Returns name, acronym, type, status, web URL, and parent/child organisations. Use govuk_list_organisations to browse all organisations and discover slugs.

Inputs: slug (required). Returns: A UK government organisation record.

govuk_get_sectionGet GOV.UK Page SectionA
Read-onlyIdempotent

Get the HTML content of one named section of a GOV.UK page.

Use govuk_get_content first to get the list of available section anchors, then call this with the anchor of the section you want to read.

Inputs: anchor (required), base_path (required). Returns: object

govuk_grep_contentSearch within a GOV.UK content bodyA
Read-onlyIdempotent

Find body sections in a GOV.UK content item matching a pattern.

Returns a list of {anchor, heading, snippet, match} hits — small per-section snippets centred on the match — so the LLM can decide which full sections to read via govuk_get_section.

Use this when answering content-based questions ("what does this guide say about X?", "find the bit about eligibility") rather than navigating by section number.

Pattern is regex; if it doesn't compile, falls back to literal substring.

Inputs: pattern (required), base_path (required), max_hits, case_insensitive. Returns: Output schema for govuk_grep_content.

govuk_list_organisationsList GOV.UK OrganisationsA
Read-onlyIdempotent

List all UK government organisations registered on GOV.UK.

Returns a paginated list of organisations including their slug, acronym, type, and status. Use this to browse the full government structure or discover slugs for use with govuk_get_organisation or govuk_search filters.

Inputs: page, per_page. Returns: A page of UK government organisations.

govuk_lookup_postcodeLook Up UK PostcodeA
Read-onlyIdempotent

Look up a UK postcode to retrieve its local authority, region, constituency, and other administrative geography.

Useful for determining which council area, parliamentary constituency, or NHS region a postcode falls within. Commonly used to direct users to the correct local service on GOV.UK (e.g. council tax, planning, waste).

Uses the postcodes.io public API (no key required).

Inputs: postcode (required). Returns: UK postcode lookup result with administrative geography.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool has a clear, distinct purpose with no overlap. Tools like govuk_get_content, govuk_get_section, and govuk_grep_content are designed to work together in a chained manner, avoiding ambiguity.

    Naming Consistency5/5

    All tools follow a consistent 'govuk_verb_noun' pattern (e.g., govuk_get_content, govuk_list_organisations, govuk_lookup_postcode), making the naming predictable and easy to understand.

    Tool Count5/5

    Seven tools is an appropriate number for the server's purpose—searching and retrieving UK government information. Each tool earns its place by providing essential functionality without redundancy.

    Completeness5/5

    The tool set covers the core use cases: content search and retrieval, section navigation, organisation lookup, and postcode-based geographic information. No obvious gaps for a read-only government information server.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers