writing · mcp
a uk land registry mcp server for claude
eighteen tools over thirty years of england and wales property data — what it does, what broke, and what it refuses to answer.
written with the assistance of ai.
the tool
what it is
an mcp server that hands claude hm land registry open data as eighteen tools: every residential sale in england and wales since 1995, the official house price index, which companies own registered title, and the boundary polygon of most registered parcels. you ask in english; the tools do the awkward part.
the build
one api cannot be queried at all
sold prices and the house price index sit behind a sparql endpoint, so they can be queried live — no key, no download. the ownership and boundary data cannot. that service has no query endpoint at all: it serves monthly bulk files and a signed url that expires in about ten seconds. so those datasets come down once and are queried locally, in an embedded duckdb database under ~/.hmlr-mcp.
downloading is two calls rather than one. the first reports the file name and size and fetches nothing; only the second commits. a model told "several hundred megabytes" asks first. a model that finds out afterwards does not.
what broke
the same query, 250× apart
the sparql endpoint evaluates patterns roughly in the order written. put the postcode filter after the optional blocks and it walks thirty million rows before narrowing, then times out. put it first and the same question answers in a quarter of a second.
what it will not do
the join that costs £20,000
you cannot connect a boundary to its owner using open data. polygons carry an inspire id; ownership is keyed on a title number; hm land registry deliberately does not publish the mapping between them. that link is the national polygon service, at £20,000 + vat a year. the two identifiers are not even the same shape, so nothing about them can be quietly guessed.
saying no
where a plausible answer is a wrong one
the hard part was never fetching data. it was the places where the server has to decline instead of guessing:
- a search too broad to narrow is refused locally, before it is sent — thirty million rows do not fail fast, they hang until something times out.
- an empty ownership result means "no company owns registered title here". it does not mean unowned, and it does not mean unregistered — individuals are not published in bulk at all.
- sale categories are kept apart. the additional category sweeps in repossessions and commercial deals; one £11.3m outlier will happily wreck a street average.
try it
run it
the live tier needs no key and no download
npx uk-land-registry-mcp