Healthcare MCP Server
Enables an AI agent to query a patient-records SQLite database with tools for schema inspection, safe SQL queries, patient risk assessment, and readmission risk analysis.
README
Healthcare MCP Server
A custom MCP (Model Context Protocol) server that lets an AI agent (Claude Desktop, or any MCP client) query a small patient-records SQLite database.
Project structure
healthcare-mcp-server/
├── server.py # MCP server - registers all tools, runs Streamable HTTP on port 8000
├── db.py # SQLite connection + CREATE TABLE statements
├── seed_data.py # Populates patients.db with sample data
├── requirements.txt
├── tools/
│ ├── schema.py # get_schema tool
│ ├── query.py # query_database tool (SELECT-only, guarded)
│ ├── risk.py # get_patient_risk_summary tool
│ └── readmission.py # get_readmission_risk_summary tool
└── patients.db # created after running db.py + seed_data.py
Tools exposed
| Tool | What it does |
|---|---|
get_schema |
Returns all table/column names so the agent can write correct SQL before it queries anything. |
query_database |
Runs an agent-generated SQL SELECT against the DB. Anything that isn't a SELECT is rejected. |
get_patient_risk_summary |
Joins visits + labs + medications for one patient and produces a risk score/level with reasons. |
get_readmission_risk_summary |
Looks at visit frequency/spacing and diagnosis to estimate readmission risk. |
Setup
cd healthcare-mcp-server
pip install -r requirements.txt
# 1. Create the tables
python db.py
# 2. Populate sample data (safe to re-run)
python seed_data.py
# 3. Start the MCP server (Streamable HTTP on port 8000)
python server.py
The server will be reachable at http://localhost:8000/mcp.
Connecting it to Claude Desktop
- Open Claude Desktop → Settings → Developer → Edit Config.
- Add an entry under
mcpServerspointing at your running server:
{
"mcpServers": {
"my-healthcare-server": {
"url": "http://localhost:8000/mcp"
}
}
}
- Save, fully quit and reopen Claude Desktop.
- Click the + icon → your server should now be listed under connectors. Enable it, and Claude will be able to call the four tools above.
Example prompts to try
- "Can you get me any 5 patient details?"
- "What is the risk profile of the patient James Walker?"
- "How many times has James Walker visited the hospital, and which doctors has he consulted?"
The last question needs a JOIN across visits and can't be answered without
the agent first calling get_schema to understand the table structure -
that's the point of exposing schema as its own tool.
Safety note
query_database only allows SELECT statements and blocks a short list of
destructive keywords (insert, update, delete, drop, alter,
attach). This is a minimal example guardrail, not a production-grade
solution - a real deployment would need parameterized queries, per-table
allow-lists, row limits, timeouts, and audit logging on top of this.
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.