Skip to main content
Glama

mcp-uk-tools

CI Node License: MIT MCP

A small Model Context Protocol (MCP) server that exposes UK public-data tools to any MCP-compatible AI client — Claude Code, Claude Desktop, or your own agent.

It's a clean, dependency-light reference for how I build MCP tool servers: a typed tool schema, a thin request handler, and each tool wrapping a real data source. Every source here is a free, keyless public API, so there are no API keys or secrets anywhere in this repo.

I use this same pattern in production to give an LLM grounded, source-cited access to official registers — this is the open, keyless version of it.

Tools

Tool

What it does

Source

uk_postcode_lookup

Town/area, region, council, country & coordinates for a postcode

postcodes.io

uk_postcode_nearest

Nearest postcodes to a latitude/longitude

postcodes.io

uk_bank_holidays

Upcoming UK bank holidays by division

gov.uk

Related MCP server: Property Price Search MCP Server

Run it

npm ci
node server.js      # speaks MCP over stdio

Use it from Claude Code / Claude Desktop

Add it to your MCP client config:

{
  "mcpServers": {
    "uk-tools": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-uk-tools/server.js"]
    }
  }
}

Then just ask: "What council is SW1A 1AA in?" or "When is the next UK bank holiday?" — the model calls the tools itself.

How it works

  • ListToolsRequestSchema → advertises the typed tool schemas

  • CallToolRequestSchema → routes a call to the matching handler

  • each handler does one fetch to a keyless public API and returns JSON

That's the whole contract. Swap the data sources for your own APIs and you have a grounded tool layer for any agent.

Tests

npm test   # node --test — unit, upstream-response, timeout and stdio integration tests

Every push and PR runs the suite on Node 22 and 24 via GitHub Actions. Node 22+ is required; use a supported LTS release.

License

MIT © Azeem Javed

Reliability contract

Arguments are validated by the server before network access. Nearest-postcode coordinates must be finite numbers within geographic bounds; limit is an integer from 1 to 100. Unknown holiday divisions return an explicit error. Upstream failures and malformed responses do not become successful empty results.

Bank holidays include today in Europe/London, are sorted by date, and return at most eight events. Requests have a 10-second deadline and propagate MCP cancellation. The postcode lookup's historical town field represents an administrative ward/parish, not a verified postal town.

The lockfile and npm ci make dependency resolution repeatable. Tests mock upstream data, cover London date boundaries and exercise a real stdio client/server exchange without contacting public APIs. Dependabot checks npm and Actions dependencies weekly.

npm ci
npm run check
npm test
npm audit --omit=dev

No upstream availability guarantee is implied. Sources: Postcodes.io geolocation contract and GOV.UK bank-holiday data.

Available Tools

3 tools
uk_bank_holidaysA

List upcoming UK bank holidays for a division. Source: gov.uk (keyless).

Inputs: division.

uk_postcode_lookupB

Look up a UK postcode — town/area, region, council, country and coordinates. Source: postcodes.io (keyless).

Inputs: postcode (required).

uk_postcode_nearestB

Find UK postcodes nearest to a latitude/longitude. Source: postcodes.io (keyless).

Inputs: latitude (required), longitude (required), limit.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool serves a clearly distinct purpose: postcode lookup by code, nearest postcodes by coordinates, and bank holidays. There is no overlap between them.

    Naming Consistency5/5

    All tools follow a consistent snake_case pattern with the 'uk_' prefix and descriptive names. The naming is predictable and readable.

    Tool Count3/5

    With only 3 tools, the server feels thin for a general UK utilities toolkit. While each tool is useful, more tools (e.g., reverse geocoding, bank holiday by year) would make the set more complete.

    Completeness3/5

    The tools cover two UK data domains (postcodes and bank holidays) but lack obvious operations like looking up a postcode by place name, validating postcodes, or listing holidays for a specific year. Notable gaps exist for a 'UK tools' server.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables users to search UK property prices by postcode, street, or city using the HM Land Registry's SPARQL endpoint. It also provides tools for resolving postcodes and finding nearby locations through Ordnance Survey data.
      2
      2
      MIT
    • A
      license
      C
      quality
      C
      maintenance
      A no-key-first MCP server providing access to UK public data including postcodes, bank holidays, carbon intensity, flood warnings, and government datasets.
      26
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables access to UK government open data via the data.gov.uk CKAN API, allowing querying of datasets through natural language or direct MCP tools.
      105 npm
      MIT