Skip to main content

MCP for searching gov.uk

Project description

GOV.UK Search MCP Server

MCP server for searching GOV.UK. Exposes two tools:

  • search_gov_uk — keyword search ranked by relevance
  • latest_gov_uk — most recent publications, newest first

Uses the GOV.UK Search API.
The server runs over streamable-http.

Installation

pip install govuk-search-mcp

Or with uv:

uv add govuk-search-mcp

No install needed with uvx — see usage below.

Usage

The server runs over streamable-http. Start it first:

uvx govuk-search-mcp
# or, if installed via pip/uv:
govuk-search-mcp

By default it listens on http://127.0.0.1:8000/mcp. Override with env vars:

Variable Default Description
FASTMCP_HOST 127.0.0.1 Bind address
FASTMCP_PORT 8000 Port

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "gov-uk": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

Claude Code

claude mcp add --transport http gov-uk-search http://localhost:8000/mcp

Tools

search_gov_uk

Search GOV.UK by keyword.

Parameter Type Default Description
query string Search terms
count int 10 Max results (0–1500)
start int 0 Pagination offset
date_from string Earliest date, YYYY-MM-DD (inclusive)
date_to string Latest date, YYYY-MM-DD (inclusive)

latest_gov_uk

Get most recently updated GOV.UK publications.

Parameter Type Default Description
count int 10 Max results (0–1500)
start int 0 Pagination offset
date_from string Earliest date, YYYY-MM-DD (inclusive)
date_to string Latest date, YYYY-MM-DD (inclusive)

Development

uv sync
just test        # unit tests
just test_int    # integration tests (hits live GOV.UK API)
just lint        # ruff + mypy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

govuk_search_mcp-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

govuk_search_mcp-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file govuk_search_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: govuk_search_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for govuk_search_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4383e8c6d56f0a0aec9396a88d6322f13f3393d19e9ab52ee0df26baa23222f1
MD5 f4641400e351e6ff014c34c4eca8a772
BLAKE2b-256 7905dbeadc21d489d519e2f71122c4546bb90dcb7cd5c00665f9dead1d6adbb1

See more details on using hashes here.

File details

Details for the file govuk_search_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: govuk_search_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for govuk_search_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 07096eb9a71a16a97d5a53fe56fde16384fc382d8cca2baa0d3fd1784e1b3247
MD5 6bfec28e99bc9aeab37f7ff98cb0be1a
BLAKE2b-256 ea81d73c13ff26e9ad472fd413c35be0ddefa748d749ef427ed1d69ba696580d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page