NHS MCP Server
Enables AI assistants to query NHS public health datasets, including prescribing data, dataset exploration, and organisation lookup via the NHSBSA Open Data Portal.
README
NHS MCP Server
An MCP (Model Context Protocol) server that provides AI assistants with access to NHS public health datasets. Query prescribing data, explore datasets, and look up NHS organisations directly from Cursor, Claude Desktop, or any MCP-compatible host.
Quick Start
Prerequisites
- Node.js 20+
- npm
Install and Build
npm install
npm run build
Configure Cursor
The project includes a .cursor/mcp.json that registers the server automatically. After building, restart Cursor to pick up the MCP server.
To configure manually in any MCP host, register a stdio server:
{
"mcpServers": {
"nhs": {
"command": "node",
"args": ["/path/to/nhs-mcp/dist/index.js"]
}
}
}
Available Tools
datasets_list
List all available datasets on the NHSBSA Open Data Portal.
Parameters:
search_query(optional) — Filter datasets by title or description
Example prompt: "List all NHS datasets related to prescribing"
datasets_metadata
Get detailed metadata for a specific dataset, including resource IDs needed for querying.
Parameters:
dataset_id(required) — Dataset name or ID
Example prompt: "Show me the metadata for the English Prescribing Dataset"
datasets_query
Query a specific dataset resource by its resource ID. Use datasets_metadata first to discover resource IDs.
Parameters:
resource_id(required) — The resource ID to queryfilters(optional) — Key-value pairs to filter recordslimit(optional) — Max records to return (default 20, max 100)offset(optional) — Records to skip for pagination
Example prompt: "Query resource abc-123 filtering by BNF_CODE 0407010H0"
prescriptions_search
Search NHS prescribing data from the English Prescribing Dataset (EPD).
Parameters:
bnf_code(optional) — BNF code (e.g.,0407010H0for Paracetamol)drug_name(optional) — Free-text drug name searchpractice_code(optional) — GP practice codeyear_month(optional) — Period in YYYYMM formatresource_id(optional) — Specific EPD resource IDlimit(optional) — Max records (default 20, max 100)
Example prompt: "Search for Paracetamol prescriptions in January 2024"
Data Sources
| Source | API | Auth Required |
|---|---|---|
| NHSBSA Open Data Portal | CKAN Action API | No |
Development
Project Structure
src/
├── mcp/ # MCP protocol layer (tools, server setup)
│ ├── server.ts
│ └── tools/
├── application/ # Business logic (use cases, formatters, types)
│ ├── use-cases/
│ ├── formatters/
│ └── types.ts
└── infrastructure/ # External concerns (API clients, cache, config)
├── clients/
├── cache/
├── config.ts
└── logger.ts
Commands
npm run build # Compile TypeScript
npm run dev # Watch mode
npm test # Run tests
npm run test:watch # Watch mode tests
npm start # Start MCP server (stdio)
Running Tests
npm test
Tests mock all external HTTP calls. No network access is required.
License
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.