Skip to content

neuro-mcp

A MCP for NeuroAgents that assist clinicians and researchers. It gives an AI agent one interface over the whole workflow: signal processing and source imaging (via MNE-Python), a persistent dataset + EHR store (Postgres + BIDS), and NeuroII web visualization.

The FastMCP server is named neuro-analysis and exposes 54 tools across five areas.

Architecture

                       neuro-mcp  (FastMCP "neuro-analysis", 54 tools)
 ┌──────────────────────┬────────────────────────┬──────────────────────┐
 │ processing            │ data + EHR store       │ neuroii              │
 │ (MNE + ESI)           │ (Postgres + BIDS)      │ (web visualization)  │
 └──────────────────────┴────────────────────────┴──────────────────────┘
   in-memory                SQLAlchemy +               HTTP client
   session                  BIDS-on-disk               (stub contract)
  • Processing tools mutate an in-memory session_id-keyed state object — load a recording once, then chain filter/ICA/epoch/spectral calls against the same session.
  • Data & EHR tools are backed by a persistent database (SQLite by default, Postgres for production) plus a BIDS-on-disk recording tree. This state outlives any single processing session.
  • neuroii is an optional integration that degrades gracefully (a structured "not configured" response, never a crash) when its endpoint isn't set.

Actors & workflows

Clinical-safety model (EHR & annotations)

EHR records and annotations are versioned, never overwritten or hard-deleted:

  • Amend = a new audited version. amend_ehr_record / update_annotation insert a new version; the prior one is retained with status amended. A clinician can modify the record — the current view updates while the original and its author are preserved.
  • Retract = soft void. void_ehr_record / void_annotation set status entered-in-error; the record stays in the history.
  • Every mutation is audited (get_audit_log: actor, action, before/after).
  • Mutating tools take an explicit actor so authorship is on the record. (Auth/RBAC enforcement is planned for v0.2; the fields and trail are in place.)

Each tool returns an outcome field for the operation (created/amended/voided/…) distinct from the record's clinical status, so the two never collide.

Where to go next