groundtruth
Enables MCP-capable agents to assemble and update a public, verified dataset on city services by providing templates for data collection, listing data gaps, accepting submissions with provenance, and returning verdicts.
README
groundtruth
Status: early. One layer of one city, and the machinery to build the rest.

The policing layer for Birmingham. Every figure is currently a hand-written placeholder pending the data import — plausible for the force named, but unverified against the sources cited, and not to be quoted. The boundary geometry is placeholder too, and says so on the map. What is real is the machinery: the verdicts, the benchmarks behind them, the estimate marked as an estimate, and the data gap that refuses to render as a pass.
I have a sneaking suspicion that there is a gap between the information available to the people making decisions about a place and the information that never reaches them. Most of it is published somewhere. It is spread across departments, released on different cycles, at incompatible geographies, in formats nobody reconciles — so decisions get made on whatever summary happened to be at hand. If that is right, policy is being set on an incomplete picture, and some of those decisions are wrong in ways nobody in the room can see.
The other half of the problem is access. Someone who lives in a city, or who simply cares about how it is run, has no single source of truth to reason from about its political, economic and social state. They are left with headlines and press releases about a place they could be reading directly.
This is an attempt at that source of truth: what is already public, assembled into one assessed and sourced view of how well a place is actually served. The gathering and the derivation are done by capable AI models working to a published protocol, and nothing they submit is published until a human has checked it.
What it is
A map-based board showing how a city is doing across the services that constitute it — starting with policing, and designed to extend to healthcare, economic activity, service delivery, electricity, water and sewage.
Each discipline defines its own dimensions: the specific questions worth asking of a place, each with a unit, the geography it must be measured at, and a direction (is higher better or worse). Every dimension is judged against published benchmarks rather than against a score invented here. Nothing is weighted or averaged into a single number, because every part of a verdict has to trace back to one value and one benchmark, each with a source.
Layer one, in progress: does a city or area have enough policing? Seven dimensions — crime outcomes, violence charge rate, recorded crime rate, estimated actual crime, emergency response time, officer availability, neighbourhood capacity.
How the data gets in
The application exposes its own MCP server. This is the collection method, not an add-on.
Any MCP-capable client — an agent from any of the major labs, or one you run yourself — can connect and:
get_template— read the research protocol for a layer: every dimension, its unit, the geography it must be measured at, which source tiers are acceptable, a plausible range, and the authoritative source to start from.list_gaps— take the worklist: dimensions with no published value, or whose newest value has gone stale. Staleness is per dimension, set from how often that source actually publishes.submit_value— submit one figure, with its provenance.assess— read the verdict for a layer.
Submissions always land as pending and are never published directly. A human reviews them
at /review. Rejected submissions are kept rather than deleted: what was proposed and refused
is part of the record, and often the more interesting half of it.
The idea is that an application should be legible to a machine as a first-class audience, not as a scraping target. The criteria for each variable are published through the same interface that accepts the answers, so a model can find out what would count as a good figure before it goes looking for one.
What counts as a source
Provenance is not optional — the schema refuses a value without a source_url.
Sources are tiered: official_statistic, official_other, press, modelled. Tier the
source honestly; press is a last resort and is treated as one. Official publications are
strongly preferred, .gov.uk first where one exists, and external sources are accepted where
no official figure is published — tiered accordingly.
Wikipedia is not an acceptable source. Nor is any aggregator standing between you and the
figure: the source_url must resolve to the data itself, not to an article about it.
That last rule is currently policy, not code — the schema checks that a source URL exists and resolves over http(s), but no domain blocklist is enforced yet, so it rests on the review gate. Tightening it is tracked as an open issue.
A value is either measured — read directly from a source, and therefore a point — or
estimated, which requires a derivation recording the method, its assumptions, its inputs and
the model that produced it. An estimate without a derivation is a guess, and the database
rejects it as one. These rules are enforced as constraints, not conventions.
Stack
Next.js 16, Supabase (Postgres), MapLibre, TypeScript. The MCP server is a route handler in the same app, so the interface an agent uses and the interface a person uses are backed by identical logic.
Running it
npm install
cp .env.local.example .env.local # fill from your Supabase dashboard
npm run dev -- --port 3100
Apply supabase/migrations/ in order, then supabase/seed.sql for the policing dimensions.
MCP_TOKEN is any long random string (openssl rand -hex 32); /api/mcp rejects every
request without it.
Connect a Claude Code session:
claude mcp add --scope local --transport http groundtruth \
http://localhost:3100/api/mcp --header "Authorization: Bearer $MCP_TOKEN"
Local scope, not project scope — project scope writes .mcp.json, which is committed, and the
token must not land in the repo.
Honest state of things
- One layer (policing) has dimensions defined. The other layers exist as intent, not schema.
- One country's sources (UK) are wired up:
data.police.ukfor street-level crime, OpenStreetMap for facilities. - Benchmarks are the weak point. A verdict is only as defensible as what it is measured against, and assembling those is the slow, unglamorous part.
- RLS is enabled with no policies: all access is server-side via the service role. Policies get written alongside the first browser-side read, not speculatively before it.
- The claude.ai web connector expects OAuth, so it cannot use the bearer token as things stand. Clients that support custom headers work today.
Licence
MIT.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.