MCP ExplorerExplorer

Clif Mcp Server

@AartikSarmaon 9 months ago
3 MIT
FreeCommunity
AI Systems
An MCP server for LLM-powered clinical research

Overview

What is Clif Mcp Server

clif-mcp-server is a Model Context Protocol (MCP) server designed for AI-assisted clinical research utilizing the Common Longitudinal ICU Format (CLIF) datasets.

Use cases

Use cases include building cohorts of specific patient demographics, analyzing clinical outcomes such as mortality and length of stay, and generating reproducible analysis scripts for multi-site validation.

How to use

To use clif-mcp-server, clone the repository, install the required dependencies, generate synthetic test data, and start the server with the specified data path. Integrate it with Claude Desktop for analysis.

Key features

Key features include a cohort builder for creating complex patient cohorts, outcomes analysis for various clinical metrics, statistical comparisons between cohorts, and automatic code generation for reproducible analyses. It also emphasizes data privacy and security.

Where to use

clif-mcp-server is primarily used in clinical research settings, particularly in studies involving intensive care unit (ICU) patients and related outcomes.

Content

CLIF MCP Server

A Model Context Protocol (MCP) server for AI-assisted clinical research using the Common Longitudinal ICU Format (CLIF) datasets.

Overview

This MCP server enables researchers to:

  • Build complex patient cohorts using clinical criteria
  • Analyze clinical outcomes (mortality, length of stay, complications)
  • Generate reproducible analysis code for multi-site validation
  • Ensure data privacy with built-in security measures

Features

Clinical Research Tools

  • Cohort Builder: Create patient cohorts with complex inclusion/exclusion criteria
  • Outcomes Analysis: Analyze mortality, ICU/hospital LOS, ventilation, readmissions
  • Statistical Comparisons: Compare outcomes between cohorts with various adjustment methods
  • Code Generation: Generate Python/R scripts for reproducible analyses

Privacy & Security

  • All data remains local - no external transmission
  • Cell suppression for small counts
  • Removal of patient identifiers from outputs
  • Audit logging of all operations
  • Differential privacy options

Installation

  1. Clone the repository:
cd clif-mcp-server
  1. Install dependencies:
pip install -r requirements.txt
  1. Generate synthetic test data:
python synthetic_data/clif_generator.py

Usage

Starting the MCP Server

python -m server.main --data-path ./data/synthetic

Using with Claude Desktop

  1. Add the server to your Claude Desktop configuration:
{
  "mcpServers": {
    "clif": {
      "command": "python",
      "args": [
        "-m",
        "server.main",
        "--data-path",
        "/path/to/your/clif/data"
      ],
      "cwd": "/path/to/clif-mcp-server"
    }
  }
}
  1. Start Claude Desktop and use the CLIF tools for analysis

Example Analyses

Building a Cohort

Build a cohort of mechanically ventilated patients aged 18-65 with ICU stays > 3 days

Analyzing Outcomes

Analyze mortality and ICU length of stay for the ventilated cohort, stratified by age groups

Comparing Cohorts

Compare outcomes between patients who received early vs late mechanical ventilation

Generating Code

Generate Python code for the mortality analysis that can be run at other CLIF sites

Data Format

The server expects CLIF 2.1.0 format CSV files:

  • patient.csv: Demographics
  • hospitalization.csv: Admission/discharge info
  • adt.csv: Location transfers
  • vitals.csv: Vital signs
  • labs.csv: Laboratory results
  • respiratory_support.csv: Ventilation data
  • medication_administration.csv: Medications
  • patient_assessments.csv: Clinical assessments
  • position.csv: Patient positioning

Multi-Site Validation

Generated analysis scripts can be shared with other CLIF sites for validation:

  1. Share the generated script (no patient data)
  2. Each site runs the script on their local data
  3. Sites share aggregate results (summary statistics only)
  4. Compare results across sites to validate findings

Development

Adding New Outcomes

To add new outcome measures, modify server/tools/outcomes_analyzer.py:

def _analyze_new_outcome(self, cohort: pd.DataFrame) -> Dict[str, Any]:
    # Implement outcome calculation
    pass

Adding New Cohort Criteria

To add new selection criteria, modify server/tools/cohort_builder.py:

# In build_cohort method
if 'new_criteria' in criteria:
    # Apply new filter
    pass

Security Considerations

  • Never commit real patient data
  • Review generated code before sharing
  • Use aggregate statistics only for multi-site comparisons
  • Enable audit logging in production
  • Consider differential privacy for sensitive analyses

Contributing

Please submit issues and pull requests to improve the server.

License

This project is licensed under the MIT License.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers