NIH Research MCP Demo
Enables interaction with synthetic NIH-style clinical research data through tools for searching publications, querying patient metadata, analyzing AAA measurements, and retrieving protocol guidance.
README
NIH Research MCP Demo
This is a small, synthetic Model Context Protocol (MCP) server for NIH-style clinical research workflows. It exposes reusable biomedical research tools over MCP so an LLM assistant can search publications, inspect cohort metadata, query AAA measurements, compute summary statistics, and retrieve protocol guidance.
All data in this repository is synthetic/mock data. It does not contain PHI.
What MCP is in this project
MCP is the interface layer between an AI assistant and external research capabilities. In this demo, the MCP server wraps a synthetic patient cohort, CT imaging metadata, publications, and protocol documents behind a small set of typed tools.
Instead of every assistant needing custom code to read CSV files, JSON metadata, and markdown protocols, the tools are implemented once in server.py and exposed through MCP.
Claude / MCP Client
|
v
NIH Research MCP Server
|
v
Synthetic patient cohort, CT metadata, publications, protocols
Why MCP is useful for NIH-style biomedical research
Biomedical research systems often span cohort tables, imaging metadata, literature collections, SOPs, and analysis utilities. MCP provides a clean abstraction layer over those resources. A research team can expose validated tools and data access patterns once, then allow multiple AI assistants or applications to reuse them consistently.
That makes it easier to:
- Reuse the same research infrastructure across AI clients.
- Keep data access logic centralized and auditable.
- Separate assistant behavior from biomedical data plumbing.
- Provide domain-specific tools without embedding data handling code into every chat application.
Tool reference
The server exposes five MCP tools. In a real LLM application, the user asks a natural-language question, the MCP client chooses one of these tools, and the server returns structured data for the assistant to summarize.
search_publications(query: str)
Searches data/publications.json, a synthetic collection of NIH-style research publication records.
Arguments:
query: Keyword query used to search publication titles and abstracts. Example:"automated AAA detection".
Returns:
- A list of matching publications.
- Each result includes
title,authors,year,journal, andshort_abstract.
Example use:
Find publications about automated AAA detection.
Why it matters:
This simulates an assistant searching a curated biomedical literature index or internal research knowledge base through a reusable MCP tool instead of custom application code.
get_patient_metadata(patient_id: str)
Returns demographics and CT imaging metadata for one synthetic patient/study.
Arguments:
patient_id: Synthetic patient identifier. Example:"SYN-017".
Returns:
patient_idagesexaaa_diameter_cmaaa_positivescan_datescanner_manufacturerslice_thickness_mmcontrast_status
Example use:
Return metadata for patient SYN-017.
Why it matters:
This simulates an assistant retrieving approved study-level metadata from a clinical research cohort or imaging archive. The demo uses synthetic local files, but the same MCP tool shape could sit in front of a secure database or imaging metadata service.
find_aaa_patients(min_diameter_cm: float = 3.0, min_age: int | None = None)
Finds synthetic patients whose abdominal aortic aneurysm diameter meets a threshold, with an optional age filter.
Arguments:
min_diameter_cm: Minimum AAA diameter in centimeters. Default is3.0, the demo threshold for AAA-positive status.min_age: Optional minimum age filter. Usenullor omit it when no age filter is needed.
Returns:
- A list of matching synthetic patients.
- Each result includes demographics, AAA diameter, AAA-positive status, scan date, scanner manufacturer, slice thickness, and contrast status.
Example use:
Find patients over 65 with AAA diameter greater than 3 cm.
An MCP client might translate that prompt into a structured tool call similar to:
{
"tool": "find_aaa_patients",
"arguments": {
"min_diameter_cm": 3.0,
"min_age": 66
}
}
Why it matters:
This simulates cohort discovery: an LLM assistant can ask a controlled backend tool for patients matching research criteria rather than directly reading or reasoning over raw clinical tables.
compute_aaa_statistics()
Computes descriptive statistics for the full synthetic AAA cohort.
Arguments:
- None.
Returns:
cohort_sizeaaa_positive_patientsprevalencemean_aaa_diameter_cmmedian_aaa_diameter_cmsummary_by_sex, including cohort size, AAA-positive count, prevalence, and mean AAA diameter for each sex group.
Example use:
Compute AAA prevalence in the synthetic cohort.
Why it matters:
This simulates a reusable analysis function exposed through MCP. Instead of each assistant implementing its own statistics logic, the validated computation lives once in the server.
search_protocols(query: str)
Searches markdown research protocol documents in data/protocols.
Arguments:
query: Keyword query used to search protocol text. Example:"DICOM de-identification rules".
Returns:
- A list of matching protocol documents.
- Each result includes
documentand a relevantexcerpt.
Example use:
Search the protocols for DICOM de-identification rules.
Why it matters:
This simulates an assistant retrieving controlled research SOPs, measurement rules, or data governance procedures through MCP. In a real NIH-style environment, the protocol files could be replaced by an approved document repository.
Install and run
Use Python 3.10 or newer.
pip install -e .
python server.py
When you run python server.py directly in a terminal, it prints local demo
instructions. When an MCP client launches the same file with stdio pipes, it
runs as the MCP server.
You can try the data tools from PowerShell without configuring an MCP client:
python server.py "Find patients over 65 with AAA diameter greater than 3 cm."
python server.py "Search the protocols for DICOM de-identification rules."
python server.py "Compute AAA prevalence in the synthetic cohort."
python server.py "Find publications about automated AAA detection."
The local demo prints a concise human-readable summary. Add --json to any
demo command to inspect the raw tool output.
The project uses the official Python MCP SDK package, declared in pyproject.toml as mcp. The server follows the common FastMCP pattern:
from mcp.server.fastmcp import FastMCP
Example prompts
- "Find patients over 65 with AAA diameter greater than 3 cm."
- "Search the protocols for DICOM de-identification rules."
- "Compute AAA prevalence in the synthetic cohort."
- "Find publications about automated AAA detection."
More examples are available in examples/example_queries.md.
Project structure
nih-research-mcp/
README.md
pyproject.toml
server.py
data/
patients.csv
imaging_metadata.json
publications.json
protocols/
aaa_screening.md
dicom_deidentification.md
examples/
example_queries.md
Why this matters
Traditional LLM applications often require custom integration code for every data source or tool. This project demonstrates how biomedical research capabilities can be exposed once through MCP, allowing multiple AI applications to reuse the same tools and data access patterns.
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.