ONSdigital

ELS MCP server

Community ONSdigital
Updated

Proof-of-concept MCP server allowing LLM chatbots to access the Explore Local Statistics API

ELS MCP server

An MCP (Model Context Protocol) server that lets LLM agents (e.g. chatbots like Claude) makemeaningful use of the data provided by theExplore Local Statistics API.

TypeScript/Node, served over Streamable HTTP. See CLAUDE.md and docs/ for the designreasoning behind the tool set. A previous Python/FastMCP proof-of-concept lives earlier in thisrepo's git history if old behaviour ever needs cross-checking.

Note: It is not possible to add custom MCP servers to some LLM chatbots, like M365 Copilot.

Run the server locally

Requires Node.js 20+.

npm install
cp .env.example .env   # then edit ELS_API_BASE_URL if needed
npm run dev

This starts the server at http://localhost:8001/mcp.

Connect it to your LLM

The example below is specific to Claude Desktop, but should besimilar for other MCP-capable clients.

Open the Settings dialog, then the Developer tab, then Edit config. This opens a JSONconfiguration file โ€” add:

{
  // ...EXISTING CONFIG ABOVE...
  "mcpServers": {
    "els-mcp-server": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:8001/mcp"]
    }
  }
}

Save the file, make sure npm run dev is running, and restart Claude Desktop.

Start using it

Check that your chatbot is connected by asking:

Are you able to connect to els-mcp-server?

Once connected, if you ask questions that can be answered with data on Explore Local Statistics,your chatbot should automatically call this server to give you an answer, e.g.:

Which local authority in Wales has the highest employment rate?

Other commands

npm run build         # production build (tsc -> dist/)
npm run lint           # eslint
npm run format          # prettier --write
npm run format:check    # prettier --check

Deploy to Vercel

  1. Fork this repo to your own GitHub account.
  2. In Vercel, create a new project from that repo. Vercel auto-detects the Node function inapi/.
  3. Set the ELS_API_BASE_URL environment variable in the Vercel project settings (see.env.example) โ€” the app fails to start without it.
  4. Deploy.

Use it with your LLM

Once deployed, add the MCP server to your favourite LLM chatbot. For Claude (web or desktop):

  1. Go to Settings (Customize) โ†’ Connectors
  2. Click +, then Add custom connector
  3. Paste in the URL: https://<your-app>.vercel.app/mcp
  4. Click Add, then Connect

MCP Server ยท Populars

MCP Server ยท New

    hermes-labs-ai

    Fidelis Memory

    Zero-LLM agent memory for Claude Code and AI agents: local-first BM25, dense-vector, and reciprocal-rank-fusion retrieval. Returns original passages verbatim by default. Available on PyPI as fidelis-memory. MIT.

    Community hermes-labs-ai
    n24q02m

    Better Code Review Graph

    Knowledge graph for token-efficient code reviews -- semantic search and call-graph resolution across your codebase.

    Community n24q02m
    Noveum

    Orbit

    Free, open source, realtime task manager. Issues, boards, sprints, projects and docs that sync instantly. Keyboard-first, self-hostable, with an MCP server for AI agents. No pricing, ever.

    Community Noveum
    feder-cr

    aihawk

    Anti detect browser and web browsing agent: an open-source MCP server for undetected browsing, AI web scraping and computer use agents. No captchas.

    Community feder-cr
    LeandroPG19

    MemoryIndustry

    Persistent memory MCP server for AI agents โ€” Rust, 19 tools, knowledge graph, Hebbian learning, episodic memory, contradiction detection, prospective triggers, Bayesian calibration, zero-config Docker setup.

    Community LeandroPG19