Rehabilitation Monitoring MCP Server
The Rehabilitation Monitoring MCP Server enables comprehensive rehabilitation patient monitoring, risk assessment, reporting, and research retrieval through a standardized MCP interface.
Patient Data & Information
Retrieve individual patient information using a patient ID, drawing from CSV datasets covering patient records, therapy sessions, wearable sensor measurements, and medication adherence logs.
Risk Assessment
Calculate rehabilitation risk scores for individual patients or the entire cohort, with a configurable lookback window (1–365 days).
Identify patients with declining rehabilitation outcomes over a specified time period.
Reporting & Alerts
Generate detailed markdown rehabilitation reports for a single patient or the whole cohort, optionally enriched with external research content via Firecrawl.
Create and persist alerts when risk scores or decline indicators cross configurable thresholds.
Research Retrieval
Search for rehabilitation research papers and summaries from external sources using the Firecrawl API, with customizable queries and result limits.
Guided Prompts
Use built-in prompts to summarize patient progress, create monitoring reports, explain risk classifications, and recommend follow-up actions.
Configuration
Supports overriding the default data directory and configuring Firecrawl API keys via environment variables.
Click on "Deploy 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., "@Rehabilitation Monitoring MCP Server Calculate risk scores for all patients"
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.
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_informationcalculate_patient_risk_scoresidentify_declining_rehabilitation_outcomesgenerate_rehabilitation_reportscreate_patient_alertscreate_intervention_planreview_and_update_patient_plansearch_rehabilitation_research
Prompts
generate_patient_progress_summariescreate_rehabilitation_monitoring_reportsexplain_risk_classificationsrecommend_follow_up_actions
Resources
rehab://data/patients.csvrehab://data/therapy_sessions.csvrehab://data/wearable_measurements.csvrehab://data/medication_adherence.csvrehab://alerts
Data directory
By default the server reads CSV files from ./data. You can override that with REHAB_DATA_DIR.
Expected filenames:
patients.csvtherapy_sessions.csvwearable_measurements.csvmedication_adherence.csv
Firecrawl research search
The research search tool uses the Firecrawl API. Set:
FIRECRAWL_API_KEYoptionally
FIRECRAWL_API_URLif 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-monitorOr run the server module directly:
uv run python -m rehab_monitor.serverRun the Gradio Dashboard
uv run python app.pyThe dashboard will be available at:
http://127.0.0.1:7860The Gradio dashboard uses the existing MCP tools and workflows without modifying the underlying server logic.
Available Tools
6 toolscalculate_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
Scored across 6 tools
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.
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.
Six tools is well-scoped for a rehabilitation monitoring server, covering the core tasks without being too few or excessive.
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
Related MCP Connectors
MCP server for US nursing facility search and ownership lookup (NursingHomeDatabase).
MCP server for Altmetric APIs - track research attention across news, policy, social media, and more
One MCP server for all web data. Scrape, search, crawl, and AI research in one install.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides healthcare tools for interacting with FHIR data and medical resources on EMRs like Cerner and Epic2MIT
- AlicenseBqualityDmaintenanceAn 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.17MIT
- FlicenseNot gradedqualityCmaintenanceA comprehensive MCP server that bridges AI applications with FHIR healthcare data systems, enabling patient data access, clinical data retrieval, and data quality assessment.4-
- AlicenseAqualityBmaintenanceMCP server for healthcare claims workflow scoring, validation, and feedback, supporting denial risk, prior authorization, and reimbursement assessment.8MIT