Patient Data MCP Server

Patient Data MCP Server

Enables querying a synthetic patient dataset with tools to look up patients by ID, age, disease, name, and get statistics, connecting Claude Desktop to local data.

Category
Visit Server

README

🏥 Patient Data MCP Server

Welcome to the Patient Data MCP (Model Context Protocol) Server project! 🚀

This is a beginner-friendly project showing how to connect Claude Desktop to your own local Python data sources. It lets you chat with a synthetic patient dataset containing 200 health records. 🧑‍⚕️📊

If you are a student or developer wanting to learn how to bridge LLMs with real-world databases, this is a perfect starting point! 💡


🛠️ Features

This server currently provides 6 powerful tools to Claude:

  1. 🔍 get_patient_by_id — Look up a specific patient record.
  2. 🎂 list_patients_above_age — Find older patients based on an age threshold.
  3. 🦠 find_patients_by_disease — Search for patients by their diagnosis (e.g., Asthma, Diabetes).
  4. 📋 list_all_diseases — See all unique diseases present in the dataset.
  5. 👤 search_patients_by_name — Quickly find someone by their partial or full name.
  6. 📈 get_patient_statistics — Receive a beautiful statistical breakdown of the dataset.

🖥️ Getting Started

1️⃣ Prerequisites

You will need a few things installed on your machine:

  • Python 3.10+ (🐍)
  • uv (⚡ A blazing fast Python package runner). Install it via terminal:
    • macOS/Linux: curl -LsSf https://astral.sh/uv/install.sh | sh
    • Windows: irm https://astral.sh/uv/install.ps1 | iex
  • Claude Desktop App (🤖)

2️⃣ Clone the Repository

Download the code to your computer:

git clone https://github.com/asanm11611622ubca006/First-MCP-server.git
cd First-MCP-server

(Optional) Run python generate_dataset.py if you ever want to regenerate the randomized patients.csv file!

3️⃣ Connect to Claude Desktop! 🔌

You don't need to run the server in your terminal. Claude will automatically run it in the background!

  1. Open your Claude Desktop config file:
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  2. Add the following JSON configuration. Make sure to update the --directory path to where you saved the code on your computer!
{
  "mcpServers": {
    "patient-data-server": {
      "command": "uv",
      "args": [
        "--directory",
        "YOUR_FULL_PATH_HERE\\First_MCP_server", 
        "run",
        "patient_server.py"
      ]
    }
  }
}

(⚠️ Windows users: Remember to use double backslashes \\ in path names!)

4️⃣ Start Chatting! 💬

  1. Restart Claude Desktop (fully quit from the system tray and reopen).
  2. Look for the little 🔨 (Hammer) icon in the chat bar. You should see the patient-data-server features loaded!
  3. Try asking:
    • "What are the most common diseases in the patient database?"
    • "Can you find patients with Hypertension?"
    • "Get patient by ID 42"

🌱 Learning & Contributing

This project is an awesome way to learn how the Model Context Protocol works. You can easily open patient_server.py and modify it.

Try adding a new tool to find patients by gender, or swap out the CSV parsing for an SQL database! 👩‍💻👨‍💻

Happy coding! 🎉

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured