Patient Data MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Patient Data MCP ServerFind patients with asthma"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π₯ 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:
π
get_patient_by_idβ Look up a specific patient record.π
list_patients_above_ageβ Find older patients based on an age threshold.π¦
find_patients_by_diseaseβ Search for patients by their diagnosis (e.g., Asthma, Diabetes).π
list_all_diseasesβ See all unique diseases present in the dataset.π€
search_patients_by_nameβ Quickly find someone by their partial or full name.π
get_patient_statisticsβ Receive a beautiful statistical breakdown of the dataset.
Related MCP server: SQLite MCP Server
π₯οΈ 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 | shWindows:
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!
Open your Claude Desktop config file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.json
Add the following JSON configuration. Make sure to update the
--directorypath 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! π¬
Restart Claude Desktop (fully quit from the system tray and reopen).
Look for the little π¨ (Hammer) icon in the chat bar. You should see the
patient-data-serverfeatures loaded!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! π
Available Tools
6 toolsfind_patients_by_diseaseA
Find all patients diagnosed with a specific disease. The search is case-insensitive.
Args: disease: The disease name to search for (e.g. "Diabetes", "asthma").
Returns: A formatted list of matching patients.
| Name | Required | Description | Default |
|---|---|---|---|
| disease | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden of behavioral disclosure. It does disclose that search is case-insensitive and that the return is a formatted list of matching patients. But it does not clarify behavior for no results, pagination, or required permissions. For a simple search tool this is adequate but not thorough.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, front-loaded with the main purpose, and organized into summary, note, Args, and Returns sections. Every sentence adds useful information without unnecessary fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter search tool with no output schema, the description covers the essentials: purpose, parameter explanation, and return type. It could mention edge cases like empty results or error behavior, but the provided information is sufficient for basic usage.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only provides the parameter name and type, with no description. The tool's description compensates fully with an Args section explaining the disease parameter and giving concrete examples ("Diabetes", "asthma"). This adds clear meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool finds all patients diagnosed with a specific disease, using a specific verb and resource. It distinguishes from sibling tools like search_patients_by_name (who search by name) and list_patients_above_age (age-based), making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context: use this when you need patients by disease name. It notes case-insensitivity, which is a practical usage detail. However, it does not explicitly mention when not to use it or name alternatives, so it stops short of full exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_patient_by_idA
Look up a single patient by their unique patient ID.
Args: patient_id: The numeric ID of the patient (e.g. 1, 42, 200).
Returns: The patient record, or a "not found" message.
| Name | Required | Description | Default |
|---|---|---|---|
| patient_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden for behavioral traits. It mentions the 'not found' return, which is useful, but it does not describe the exact structure of the patient record or any potential errors. For a simple lookup, the disclosure is adequate but minimal.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the purpose, followed by clearly separated Args and Returns sections. Every sentence adds information, and there is no filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter lookup tool with no output schema, the description provides enough to select and invoke correctly: purpose, parameter type/examples, and what to expect back (record or not-found). It could be more explicit about the shape of the return record, but the tool's simplicity keeps the gap small.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema only specifies an integer type, but the description adds meaning by labeling it 'the numeric ID' and giving examples ('e.g. 1, 42, 200'). This compensates for the 0% schema coverage, though it does not provide additional constraints like value ranges.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'look up' and resource 'a single patient by their unique patient ID,' clearly distinguishing this tool from siblings like list_patients_above_age or find_patients_by_disease. The scope (single record, unique ID) is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The context of when to use this tool is clearβwhen you have a numeric patient IDβbut it does not explicitly mention when not to use it or name alternatives. The sibling tools imply alternatives, but the description does not explicitly say 'use search_patients_by_name if you don't know the ID.'
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_patient_statisticsA
Get summary statistics for the entire patient dataset. Includes total count, age statistics, gender breakdown, and disease distribution.
Returns: A formatted statistical summary.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden. It discloses the scope ('entire patient dataset') and output contents, adding some behavioral context. Yet it omits potential performance implications, data freshness, or any side effects, leaving partial transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: two sentences of purpose and contents, plus a simple return note. Every sentence earns its place with no redundancy, making it easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter, read-only statistics tool with no output schema, the description covers the essential what and includes the main contents. It could add detail about formatting or calculation specifics, but the absence is not critical given the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and the schema is empty (100% coverage). The description correctly avoids inventing parameter details, and the baseline for 0 params is 4, as there is nothing to explain.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'Get summary statistics for the entire patient dataset' with specific contents (count, age, gender, disease distribution). This distinguishes it from sibling tools that focus on individual records or filtered lists.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly implies use for dataset-level overview, contrasting with sibling tools that retrieve specific patients or diseases. However, it does not explicitly mention alternatives or exclusions, though the context from sibling names is helpful.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_all_diseasesA
List all unique diseases present in the patient dataset. Useful for discovering what diseases can be queried.
Returns: A sorted list of disease names.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses that the result is 'a sorted list of disease names' and that diseases are 'unique' and 'present in the dataset,' adding behavioral detail beyond the tool's name. With no annotations, this gives the agent useful expectations about output.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured: a clear purpose sentence, a usage hint, and a return format line. Every sentence earns its place with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a parameterless, simple listing tool, the description is complete: it explains what it lists, why it's useful, and what the return value looks like. There are no missing details that would prevent an agent from correctly using it.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and the schema is empty (100% coverage), so there is nothing to document. The description naturally adds no param semantics, but the baseline of 4 applies because no parameter information is needed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: 'List all unique diseases present in the patient dataset.' This specific verb and resource distinguish it from siblings like find_patients_by_disease, which queries patients, not diseases.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'Useful for discovering what diseases can be queried' provides clear context for when to use the tool. It does not explicitly name alternatives or exclusions, but the guidance is sufficient for a simple discovery tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_patients_above_ageA
List all patients whose age is strictly greater than the given value.
Args: age: The age threshold. Returns patients older than this number.
Returns: A formatted list of matching patients, or a message if none match.
| Name | Required | Description | Default |
|---|---|---|---|
| age | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations present, the description carries the full burden. It discloses that the operation is a read-only 'list', clarifies the strict greater-than semantics, and describes the return behavior including the empty case. It stops short of mentioning potential details like ordering or pagination, but these are not necessary for such a simple tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured: a one-sentence purpose, an Args section for the parameter, and a Returns section. Every sentence earns its place with no redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having no output schema, the description covers the essential behavior: what the tool does, what the parameter means, and what is returned. The tool's simplicity means no further context is needed, and the sibling list does not introduce missing requirements.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema descriptions coverage is 0%, so the description must compensate. It does so thoroughly by explaining the 'age' parameter as 'the age threshold' and explicitly stating that it returns patients older than this number. This adds meaningful semantic context beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description starts with a specific verb ('List') and a resource ('patients') with a clear filtering condition ('age is strictly greater than the given value'). This directly distinguishes it from sibling tools like get_patient_by_id or find_patients_by_disease, which target different criteria.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly implies the use case: when you need to retrieve patients above a certain age threshold. It provides context without explicitly naming alternatives, but the unique filtering criterion makes the intended usage obvious. It does not include any exclusions, hence a 4 rather than a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_patients_by_nameA
Search for patients whose name contains the given text. The search is case-insensitive and supports partial matches.
Args: name: Full or partial patient name to search for (e.g. "john", "Smith").
Returns: A formatted list of matching patients.
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses case-insensitivity and partial matching, which are key behavioral traits. However, it does not mention other potentially relevant behaviors like read-only nature, result limits, or ordering. The return description is vague ('a formatted list'), leaving some uncertainty.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured, with a front-loaded purpose sentence followed by clearly labeled Args and Returns sections. It is appropriately sized, containing no fluff or repetitive information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple search tool with one parameter and no output schema, the description covers purpose, parameter semantics, and return format adequately. It could provide more detail on the exact fields returned or any result limits, but the current level is sufficient for an agent to invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema only provides the parameter name and type. The description's Args section explains that 'name' accepts full or partial names and gives examples, adding significant meaning beyond the schema. This fully compensates for the 0% schema description coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Search') and resource ('patients'), specifying the search criterion (name containing given text). It distinguishes from sibling tools like get_patient_by_id (exact ID) and find_patients_by_disease (by disease).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for use: when you have a full or partial patient name to search. It does not explicitly mention alternatives or exclusions, but its specific purpose makes the usage obvious. The sibling tools cover different search keys, so the context is sufficient.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
6 tool updates
v1.0.0- First observed
find_patients_by_disease - First observed
get_patient_by_id - First observed
get_patient_statistics - First observed
list_all_diseases - First observed
list_patients_above_age - First observed
search_patients_by_name
TDQS
Each tool targets a distinct query: by ID, by age, by disease, by name, list diseases, and overall statistics. There is no overlap in their purposes, even though several search patients in different ways.
Tool names use a mix of verbs: get, list, find, search. While all are snake_case and readable, the pattern is not consistent across the set (e.g., 'get_patient_by_id' vs 'find_patients_by_disease').
With 6 tools, the server is well-scoped for a read-only patient data querying purpose. Each tool covers a distinct and necessary operation without unnecessary bloat.
The set covers all obvious read-only query needs: lookup by ID, filtering by age, disease, name, listing available diseases, and summary statistics. Missing write operations (create/update/delete) may be out of scope, but a generic 'list all patients' could be a minor gap.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Connect AI clients to biomedical data and tools.
63 tools for Apple Health, Fitbit, Oura & Health Connect data in Claude, ChatGPT, Grok & Mistral.
Connect your team's living knowledge base β docs, data, issues, CRM β to Claude and ChatGPT.
Medical RAG: semantic search for clinical guidelines, drug interactions, diagnoses & EHR data.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceConnects Claude Desktop directly to databases, allowing it to explore database structures, write SQL queries, analyze datasets, and create reports through an API layer with tools for table exploration and query execution.419Mozilla Public 2.0
- AlicenseNot gradedqualityDmaintenanceEnables natural language interaction with local SQLite databases through Claude Desktop, translating plain English queries into SQL for data analysis and exploration.3MIT
- FlicenseNot gradedqualityDmaintenanceConnects Claude Desktop to a healthcare claims database for natural-language analysis of CPT codes, reimbursement rates, payer performance, and denial patterns.-
- FlicenseAqualityCmaintenanceExposes a clinic's knowledge base and structured records to Claude Desktop as callable tools, with read tools grounded with citations and write tools gated behind approval.4-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/asanm11611622ubca006/First-MCP-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server