Skip to content
Clear Postcode

MCP server

UK postcode data inside your AI assistant

One URL gives ChatGPT, Claude, Cursor and Copilot eight read-only postcode tools: https://api.clearpostcode.co.uk/mcp. No key needed to start; a free key raises the allowance.

Connect in a minute

  1. 1. Claude (desktop and claude.ai): Settings → Connectors → Add custom connector → paste https://api.clearpostcode.co.uk/mcp
  2. 2. ChatGPT: Settings → Connectors → Create → MCP server URL https://api.clearpostcode.co.uk/mcp (no authentication)
  3. 3. Claude Code: claude mcp add --transport http clear-postcode https://api.clearpostcode.co.uk/mcp
  4. 4. Cursor / VS Code / Copilot: Add the JSON below to your MCP settings (mcp.json).

The tools

Compact answers with a source line and a link, plus the full structured record for the assistant.

lookup_postcode

Everything about one UK postcode, or up to 50 at once: whether it is live or terminated, latitude and longitude, and the council, ward, parish, constituency, county, region, police force, NHS board, rural-urban class and deprivation decile it sits in. Use for any question about where a postcode is or which area it belongs to.

validate_postcode

Checks a UK postcode: is the format right, is it in the current official data, and is it still in use. Northern Ireland (BT) postcodes are checked by format only.

nearest_postcodes

Live UK postcodes nearest a postcode or a latitude/longitude, closest first, with distances in metres. Use it to find the postcode for coordinates (reverse geocoding) or what is near an address.

postcode_distance

Straight-line distance between two UK postcodes in kilometres and miles, with the compass direction.

area_info

Facts about a postcode area (e.g. "SW"), district ("SW1A") or sector ("SW1A 1"): how many postcodes, the councils, wards and constituencies it covers, its centre and places in it.

find_place

Finds UK cities, towns, villages and neighbourhoods by name and returns each one's postcode district, council and coordinates (OS Open Names).

search

Search UK postcodes, districts and places. Returns ids to pass to fetch.

fetch

Fetch the full record for an id returned by search.

Streamable HTTP, stateless JSON-RPC; protocol versions 2024-11-05 to 2026-07-28. Questions to try: “What council is M1 1AE in?”, “How far is EH1 1YZ from SW1A 1AA?”, “Which postcode district is Hebden Bridge in?”

MCP questions

What is an MCP server?

The Model Context Protocol lets an AI assistant call outside tools. Ours gives assistants live UK postcode data, so answers about councils, wards, distances and places come from the official data rather than the model's memory.

Do I need an API key?

No. The server answers without a key, within a shared daily allowance. Add a free key as a Bearer token for your own 10,000 lookups a month, counted like any API call.

Which tools does it have?

lookup_postcode, validate_postcode, nearest_postcodes, postcode_distance, area_info, find_place, search, fetch. All are read-only.

Where does the data come from?

The ONS Postcode Directory and OS Open Names, both under the Open Government Licence. Each answer carries its source and a link to the full page.

Prefer REST? The same data is in the Clear Postcode API.