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
- Fork this repo to your own GitHub account.
- In Vercel, create a new project from that repo. Vercel auto-detects the Node function in
api/. - Set the
ELS_API_BASE_URLenvironment variable in the Vercel project settings (see.env.example) โ the app fails to start without it. - Deploy.
Use it with your LLM
Once deployed, add the MCP server to your favourite LLM chatbot. For Claude (web or desktop):
- Go to Settings (Customize) โ Connectors
- Click +, then Add custom connector
- Paste in the URL:
https://<your-app>.vercel.app/mcp - Click Add, then Connect