Skip to main content
Glama

ADHD_MCP

An MCP server that reads a patient's FHIR record and tells a clinician whether a formal adult ADHD screening should be considered, and why.

Status: early development. A walking-skeleton server and the FHIR access layer exist; no clinical tools are built yet. See status.md for the current state.

This tool recommends referral for screening. It never diagnoses. It is decision support for clinicians, not a patient-facing product, and it is not validated for clinical use.

What it does

Adult ADHD is under-diagnosed, especially in veterans, and it is associated with a higher risk of self-harm that treatment appears to reduce. An undiagnosed case rarely shows up as an ADHD code. It shows up as its consequences: stimulant or alcohol-related diagnoses, repeated accidental injuries, crashes, antidepressant switches, sleep problems.

The server assembles those signals from FHIR data, applies versioned and auditable rules, and returns a structured recommendation:

  1. Safety gate first. Any self-harm signal (suicidal ideation codes, a positive C-SSRS, a recent psychiatric discharge) is surfaced before anything else and takes priority over an ADHD referral.

  2. Exclusions. Patients who already have an ADHD diagnosis or an evaluation in progress are not flagged.

  3. Evidence-linked recommendation. "Consider referral for formal ADHD screening" or "no recommendation", with every supporting signal tied to the FHIR resource it came from.

  4. Audit record. Every call is logged with its inputs, rule version and output, so recommendations can be evaluated later.

The clinical basis is in research/veteran_self_harm_risk_screening.md.

Related MCP server: MediLinkAI

Design principles

Principle

What it means

Recommend, never diagnose

Enforced in output schemas, wording, and tests

Deterministic rules first

The language model never navigates raw FHIR or decides eligibility; the server does the joins and rule evaluation

Read-only

Tools only read FHIR. The one exception drafts a referral proposal that is returned to the clinician and never written to the record

Evidence or silence

Every claim in an output cites a resource ID; nothing is asserted without a source

Safety gate before referral

Self-harm signals always take priority

Privacy by default

Synthetic data only in this repository; logs hold references and hashes, not clinical content

Test-driven

Every behavior starts as a failing test

Technology

  • Language: Python

  • MCP framework: FastMCP

  • Data: HL7 FHIR R4 (US Core profiles), synthetic data for all development and testing

  • Terminologies: ICD-10-CM, LOINC, RxNorm, SNOMED CT

Exact versions are pinned in ADR 0006: Python 3.12, FastMCP 4.2, uv, pytest, ruff and mypy.

Planned MCP tools

Tool

Purpose

check_safety_gate

Detect self-harm signals before any referral is considered

get_screening_history

Scores over time for PHQ-9, C-SSRS, AUDIT-C, PC-PTSD-5, ASRS

get_mh_problem_list

Mental health diagnoses with onset order

get_medication_timeline

Stimulant fills, antidepressant switches, sedative-hypnotics

get_utilization_summary

Emergency injury visits, discharges, no-shows

get_psychosocial_context

Housing, legal, occupational and military context

check_existing_care

Existing ADHD diagnosis, referrals, evaluations in progress

assess_referral_need

Run the rules and return the recommendation with its evidence

draft_referral_proposal

Draft a referral for clinician review; never written to the record

Details are in docs/architecture.md.

Roadmap

Eight phases of about one month each for a single developer. Full detail is in project_plan.md.

Phase

Theme

1

Foundations and walking skeleton

2

FHIR access layer and synthetic patients

3

Evidence tools I: safety gate, diagnoses, screening history, existing care

4

Evidence tools II: medications, utilization, psychosocial context

5

Rules engine and the referral recommendation

6

Audit, privacy and security

7

Evaluation, hardening and release 1.0

8

VA readiness and extensibility to other conditions

Repository guide

Path

Contents

project_plan.md

Phased, test-driven plan

status.md

Work done and next steps; updated every session

CLAUDE.md

Working rules for Claude Code

AGENTS.md

Entry point for other AI coding agents

CONTRIBUTING.md

Workflow for human and AI contributors

docs/architecture.md

Components, data flow, tool contracts

docs/adr/

Architecture decision records

docs/clinical/

Intended use, risk register, rule card template, glossary, verification backlog

research/

Evidence report and source notes

Getting started

Requires uv.

uv sync
./scripts/check
uv run adhd-mcp

uv sync installs everything, ./scripts/check runs lint, format, type checks and tests, and uv run adhd-mcp starts the server over stdio. To see what the server exposes without a client:

uv run fastmcp inspect src/adhd_mcp/server.py:create_server

All commands are listed in CLAUDE.md.

To contribute, read CONTRIBUTING.md, then status.md for what is next.

Data and privacy

Never commit real patient data, credentials, or anything derived from a real health record. All fixtures are synthetic. See the intended use statement and risk register.

License

MIT

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Clinical decision-support MCP server that lets AI agents reason over live FHIR patient data for medication review, appointment scheduling, and care gap identification.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to discover a configured FHIR R4 endpoint, search and page within a single trusted patient, read exact resources, and inspect retained results as FHIR-shaped JSON with provenance, coverage signals, and byte limits.
      Apache 2.0