UK ONS MCP Server
Enables access to official UK Office for National Statistics data including demographics, economics, and social statistics through the ONS Beta API. Supports browsing, searching, and querying datasets with built-in shortcuts for popular statistics like inflation, regional GDP, and wellbeing data.
README
UK ONS MCP Server
A Model Context Protocol (MCP) server for accessing the UK Office for National Statistics (ONS) Beta API.
Fetch official UK government statistics—demographics, economics, social data—straight from your MCP‑compatible assistant, no API key required.
Features
- Direct ONS access – no authentication, no tokens
- Browse & search every published dataset
- Flexible queries – filter observations by geography, time, etc.
- Popular dataset shortcuts for CPIH, regional GDP, wellbeing & more
- Time‑series & regional comparisons built in
- 100 % MCP‑SDK TypeScript with robust error handling
Installation
# Global install
npm install -g uk_ons_mcp_server
# Or one‑off run
npx uk_ons_mcp_server
Usage (Claude Desktop)
{
"mcpServers": {
"uk-ons": {
"command": "npx",
"args": ["-y", "uk_ons_mcp_server"]
}
}
}
Available Tools
| Tool | Purpose |
|---|---|
list_datasets |
Paginated list of all datasets |
get_dataset |
Metadata for a single dataset |
search_datasets |
Search by keyword |
get_observation |
Pull observations with dimension filters |
get_latest_data |
Convenience wrapper for the newest figures |
Popular Dataset IDs
| ID | What it is |
|---|---|
cpih01 |
CPIH (UK inflation) |
regional-gdp-by-year |
Regional GDP |
wellbeing-local-authority |
Personal wellbeing |
trade |
UK trade stats |
weekly-deaths-region |
Weekly deaths |
Development
git clone https://github.com/dwain-barnes/uk_ons_mcp_server.git
cd uk_ons_mcp_server
npm install
npm run build # compile TypeScript
npm start # production
npm run dev # watch & reload
Tests and linting:
npm test
npm run lint
Contributing
- Fork → branch → commit
git pushand open a PR- Kindly follow the coding style in src/
License
MIT – see LICENSE.
Disclaimer
This project is unofficial and not endorsed by the UK Office for National Statistics. Data usage remains subject to ONS terms.
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.
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.
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
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.
E2B
Using MCP to run code via e2b.