Skip to main content
Glama
Rehabilitation Monitoring MCP Server

Rehabilitation Monitoring MCP Server

by miiakorhonen

Rehabilitation Monitoring MCP Server

An MCP (Model Context Protocol) server for rehabilitation monitoring built with the Python SDK. The server exposes rehabilitation datasets, monitoring tools, reporting workflows, and research retrieval capabilities through a standardized MCP interface.

Development Approach

This project was developed using an LLM-assisted development workflow inspired by the MCP tutorial on building MCP servers with LLMs. Functionality was designed, implemented, tested, and refined iteratively through prompt-driven development, MCP tool testing, and human review.

The project evolved from basic rehabilitation-monitoring tools into more advanced workflows, including risk assessment, decline detection, intervention planning, alert generation, and an agentic rehabilitation workflow for reviewing and updating patient plans.

Reference:

Related MCP server: openemr-mcp

User Interface

The project includes a Gradio-based clinical dashboard (app.py) that provides a graphical interface for interacting with the rehabilitation-monitoring workflows.

Available dashboard views:

  • Cohort Overview

  • Patient Information

  • Risk Assessment

  • Declining Outcomes

  • Review Workflow

  • Alerts

  • Intervention Plans

  • AI Assistant

The dashboard is implemented on top of the existing MCP server functionality and does not modify the underlying MCP workflows. The dashboard also includes a rule-based AI Assistant that allows users to ask natural-language rehabilitation-monitoring questions. The assistant dynamically selects and combines information from existing MCP tools to provide patient-level and cohort-level summaries, risk explanations, rehabilitation concerns, intervention recommendations, alert information, and monitoring insights.

AI Agent Documentation

The repository includes an AGENTS.md file that provides project-specific guidance for AI coding agents such as Goose, Claude Code, GitHub Copilot, Codex, and Cursor.

The document describes:

  • project goals

  • repository structure

  • MCP tools and workflows

  • development workflow

  • testing instructions

  • coding conventions

  • risk-classification logic

  • persistence behaviour

  • project-specific constraints

  • AI-assisted development guidelines

The AGENTS.md file serves as the primary reference for AI agents working on the rehabilitation-monitoring MCP server.

What it provides

Tools

  • get_patient_information

  • calculate_patient_risk_scores

  • identify_declining_rehabilitation_outcomes

  • generate_rehabilitation_reports

  • create_patient_alerts

  • create_intervention_plan

  • review_and_update_patient_plan

  • search_rehabilitation_research

Prompts

  • generate_patient_progress_summaries

  • create_rehabilitation_monitoring_reports

  • explain_risk_classifications

  • recommend_follow_up_actions

Resources

  • rehab://data/patients.csv

  • rehab://data/therapy_sessions.csv

  • rehab://data/wearable_measurements.csv

  • rehab://data/medication_adherence.csv

  • rehab://alerts

Data directory

By default the server reads CSV files from ./data. You can override that with REHAB_DATA_DIR.

Expected filenames:

  • patients.csv

  • therapy_sessions.csv

  • wearable_measurements.csv

  • medication_adherence.csv

The research search tool uses the Firecrawl API. Set:

  • FIRECRAWL_API_KEY

  • optionally FIRECRAWL_API_URL if you use a different endpoint

The tool uses Firecrawl to retrieve rehabilitation-related research papers and summaries from external sources.

Example MCP Usage

Examples:

  • Calculate patient risk scores

  • Generate rehabilitation reports

  • Identify declining rehabilitation outcomes

  • Create patient alerts

  • Retrieve rehabilitation-related research

Example prompts:

  • Use the rehab-monitor MCP server to calculate patient risk scores.

  • Use the rehab-monitor MCP server to generate a rehabilitation report for patient P001.

  • Use the rehab-monitor MCP server to search rehabilitation research related to stroke recovery.

Example dashboard workflows:

  • Review a patient rehabilitation plan.

  • Monitor rehabilitation alerts.

  • Review intervention plans.

  • Monitor rehabilitation risk levels across the patient cohort.

  • Ask natural-language rehabilitation-monitoring questions through the AI Assistant.

Sample Data

The repository includes synthetic rehabilitation monitoring datasets containing:

  • patient records

  • therapy session data

  • wearable sensor measurements

  • medication adherence records

These datasets are intended for MCP development and testing purposes only and do not contain real patient information.

Run

Run the MCP Server

uv run rehab-monitor

Or run the server module directly:

uv run python -m rehab_monitor.server

Run the Gradio Dashboard

uv run python app.py

The dashboard will be available at:

http://127.0.0.1:7860

The Gradio dashboard uses the existing MCP tools and workflows without modifying the underlying server logic.

Available Tools

6 tools
calculate_patient_risk_scoresB

Calculate rehabilitation risk scores using patient records, therapy sessions, wearable measurements, and medication adherence data.

Inputs: patient_id, lookback_days.

create_patient_alertsB

Create and persist alerts for patients whose rehabilitation risk or declines cross the configured thresholds.

Inputs: patient_id, lookback_days, risk_threshold.

generate_rehabilitation_reportsA

Generate a markdown rehabilitation report for one patient or the whole cohort.

Inputs: patient_id, lookback_days, include_research.

get_patient_informationC

Get patient information from the available rehabilitation data sources.

Inputs: patient_id (required).

identify_declining_rehabilitation_outcomesC

Identify patients whose rehabilitation outcomes are declining across the available measurements.

Inputs: patient_id, lookback_days.

search_rehabilitation_researchC

Search Firecrawl for rehabilitation-related research papers and summaries.

Inputs: limit, query.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: risk calculation, alert creation, report generation, patient info retrieval, outcome decline detection, and research search. No overlap in functionality.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case (e.g., calculate_patient_risk_scores, create_patient_alerts, generate_rehabilitation_reports). No deviations.

    Tool Count5/5

    Six tools is well-scoped for a rehabilitation monitoring server, covering the core tasks without being too few or excessive.

    Completeness4/5

    The tools cover risk assessment, alerting, reporting, patient info, outcome decline identification, and research. Minor gaps exist (e.g., no tool for inputting or updating patient measurements), but the surface is largely complete for monitoring and analysis.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides healthcare tools for interacting with FHIR data and medical resources on EMRs like Cerner and Epic
      2
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that connects AI assistants to OpenEMR instances to manage patient records, clinical trends, and medication safety. It provides 17 tools for tasks such as patient search, drug interaction checks, and generating comprehensive health trajectories and visit preparations.
      17
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      A comprehensive MCP server that bridges AI applications with FHIR healthcare data systems, enabling patient data access, clinical data retrieval, and data quality assessment.
      4
      -