Skip to main content
Glama
miiakorhonen

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
patient_idNoOptional patient identifier. If omitted, the report covers all patients in the CSV data.
lookback_daysNo

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description should fully disclose behavioral traits. It mentions calculation and data sources but omits whether the tool is read-only or mutates any state, required permissions, side effects, or output format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no redundant information, and the action (calculate) and resources (risk scores) are front-loaded. Every word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema and moderate complexity (multiple data sources). The description fails to explain what the risk scores look like, how they are formatted, or any thresholds. It also does not mention that omitting patient_id covers all patients, though the schema does. Overall incomplete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has two parameters with 50% description coverage (patient_id has a description, lookback_days does not). The tool description adds context on data sources but does not explain lookback_days or provide additional semantics beyond the schema for patient_id. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool calculates rehabilitation risk scores and lists specific data sources (patient records, therapy sessions, wearable measurements, medication adherence). It effectively distinguishes from siblings like 'identify_declining_rehabilitation_outcomes' which focuses on decline detection rather than scoring.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, nor does it mention prerequisites, context, or conditions for invocation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

create_patient_alertsB

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

ParametersJSON Schema
NameRequiredDescriptionDefault
patient_idNoOptional patient identifier.
lookback_daysNo
risk_thresholdNo

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry full behavioral disclosure. It indicates a write operation ('create and persist') but does not mention side effects (e.g., whether it overwrites existing alerts), authorization needs, or error conditions. This is insufficient for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that front-loads the purpose. It is concise with no superfluous information, though structured formatting (e.g., parameter list) could improve readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has three parameters with low schema coverage and no output schema or annotations. The description does not hint at the return value (e.g., created alert details) or error handling. Given its complexity as a creation tool, more context is needed for safe invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one of three parameters (patient_id) has a schema description. The description adds context for risk_threshold and lookback_days by linking them to the threshold-crossing logic, but does not fully explain their meanings or valid values. It complements the schema modestly but leaves gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (create and persist alerts) and the condition (patients whose rehabilitation risk or declines cross thresholds). It distinguishes from siblings like calculate_patient_risk_scores, but the term 'declines' is slightly ambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use (when thresholds are crossed) but does not explicitly state when not to use or provide alternatives. It lacks guidance on prerequisites, such as requiring risk scores or decline identification first.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_rehabilitation_reportsA

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

ParametersJSON Schema
NameRequiredDescriptionDefault
patient_idNoOptional patient identifier.
lookback_daysNo
include_researchNoInclude a Firecrawl-backed rehabilitation research section.

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Mentions generating a report and optional Firecrawl research section, but does not clearly state whether it is read-only, any side effects, permissions, or rate limits. 'Generate' suggests non-destructive, but not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence front-loads key purpose. No wasted words, but could benefit from breaking out options (e.g., single patient vs cohort, optional research inclusion).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 3 parameters, no output schema, and no annotations, description fails to provide sufficient context. Missing behavioral traits, output format details, and how 'whole cohort' is specified. Leaves agent uncertain about usage boundaries.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers 67% of parameters (patient_id, include_research have descriptions; lookback_days missing). Description adds no extra meaning beyond schema. Does not explain lookback_days or parameter interactions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'generate' and resource 'markdown rehabilitation report', and distinguishes between 'one patient or the whole cohort'. This differentiates it from sibling tools like calculate_patient_risk_scores or search_rehabilitation_research.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage for generating reports, but no explicit guidance on when to use this versus siblings like identify_declining_rehabilitation_outcomes or search_rehabilitation_research. No when-not-to-use information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_patient_informationC

Get patient information from the available rehabilitation data sources.

ParametersJSON Schema
NameRequiredDescriptionDefault
patient_idYesPatient identifier.

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description offers minimal behavioral context beyond the verb 'get'. It does not disclose whether the operation is read-only, what data sources are queried, or any side effects, leaving the agent with little understanding of the tool's behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no extraneous words. However, it could include more useful information without becoming overly verbose, so it is slightly above average but not perfect.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of five sibling tools and no output schema, the description is too minimal. It fails to specify what kind of patient information is retrieved (e.g., demographics, medical history), making it incomplete for an agent to use effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the parameter description ('Patient identifier.') is clear. However, the tool description adds no additional meaning beyond the schema, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves patient information from rehabilitation data sources, but it is somewhat broad and does not distinguish from sibling tools that also involve patient data, like calculate_patient_risk_scores.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. The description lacks any context about prerequisites, exclusions, or specific scenarios, providing no help for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

identify_declining_rehabilitation_outcomesC

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

ParametersJSON Schema
NameRequiredDescriptionDefault
patient_idNoOptional patient identifier.
lookback_daysNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but does not disclose behavioral traits like how decline is determined, what measurements are used, or that lookback_days controls the time window. Lacks transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, concise but under-specified. It could be improved by adding key details about parameters without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of output schema and annotations, the description is incomplete. It does not explain the output format, the meaning of 'declining', or how the parameters affect results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50% (only patient_id has a description). The tool description adds no meaning for either parameter, failing to explain that lookback_days sets the time range or how patient_id filters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Identify' and the resource 'patients whose rehabilitation outcomes are declining', which distinguishes it from sibling tools like calculate_patient_risk_scores or create_patient_alerts.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. The description only states what it does, not when it should be chosen over similar tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_rehabilitation_researchC

Search Firecrawl for rehabilitation-related research papers and summaries.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryNorehabilitation therapy outcome monitoring occupational therapy physical therapy

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully convey behavioral traits. It only states what the tool does, but lacks details on side effects, idempotency, or constraints like rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single efficient sentence. It is front-loaded with the verb. Could be improved by brief parameter hints, but overall concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple search tool with two parameters and no output schema, the description is minimally adequate but lacks details about output format, what 'Firecrawl' is, or how to refine searches.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description adds no meaning for the parameters (query and limit). The schema provides defaults and constraints, but the description should explain how to formulate queries or how limit affects results.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (Search) and resource (Firecrawl for research papers and summaries). It is specific and distinct from sibling tools which focus on patient-specific operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. Sibling tools are listed but no explicit when/when-not or selection criteria provided.

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.

  1. 6 tool updatesv0.1.0
    • First observedcalculate_patient_risk_scores
    • First observedcreate_patient_alerts
    • First observedgenerate_rehabilitation_reports
    • First observedget_patient_information
    • First observedidentify_declining_rehabilitation_outcomes
    • First observedsearch_rehabilitation_research

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

ActivityMaintained
ResponsivenessNo issues

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

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
    1
    MIT
  • A
    license
    A
    quality
    C
    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
    D
    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
    -

Latest Blog Posts

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/miiakorhonen/rehab-monitor-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server