Neuro Mcp

io.github.AImplifier由 GitHub 帳號 AImplifier 發布v0.1.4更新於 Oct 26, 2026

MCP for NeuroAgents assisting clinicians: MNE processing, EHR store, NeuroII visualization.

概覽

AI 產生的概覽

本機 MCP 伺服器,為 AI 助理提供 54 個 EEG/神經科學工具:MNE 處理、源成像、具版本的 EHR/BIDS 儲存,以及 HTML 視覺化。

可以做什麼
  • 處理 EEG 記錄:載入、濾波、重新取樣、設定電極配置與參考、偵測壞頻道、執行 ICA、尋找事件、分段、計算 PSD/ERP 與時頻分析並繪圖。
  • 執行源成像與 ESI 流程,從範本頭模型到標籤時間序列擷取。
  • 管理受試者、資料集、記錄與 EHR 項目:註冊、匯入、查詢、新增、修訂、檢視歷史與作廢。
  • 管理標註:新增、更新、列出與作廢,並為每次變更留下稽核日誌。
  • 將記錄與視覺化工作階段推送到 neuroii,並拉回標註。
  • 產生獨立的互動式 HTML 視覺化:時間序列、含頭皮地形圖的平均 ERP,以及體源估計。
適用情境
適合希望以自然語言讓助理驅動 EEG 分析與紀錄流程的臨床醫師與研究人員:檢視記錄、加上標註、修訂 EHR 項目、將資料集匯入 BIDS,並產出可分享的視覺化結果。
執行需求
以 PyPI 套件形式透過 stdio 在本機執行(需 Python 3.10 以上,建議使用 conda 或虛擬環境)。選用附加元件提供 PostgreSQL 與 3D 算繪支援。透過環境變數設定:DATABASE_URL(預設為本機 SQLite 檔案)、BIDS_ROOT、NEURO_MCP_HOME,選用 NEUROII_API_URL 與 NEUROII_API_TOKEN。預設設定無需額外準備即可執行。
安裝前請注意
工具會寫入持久化儲存:EHR 項目與標註可被修訂或作廢,每次變更都會連同明確指定的操作者記入稽核日誌。身分驗證與權限控管尚未啟用(預計於 v0.2),能存取此伺服器的人都能修改紀錄。NEUROII_API_TOKEN 是 bearer 憑證。neuroii 整合尚未接通,在設定 NEUROII_API_URL 之前只會回傳佔位契約。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Neuro Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

🧠 neuro-mcp

An MCP for NeuroAgents that assist clinicians and researchers

[PyPI] [Python] [Docs] [License]

Documentation · PyPI · Tutorial · Tool Reference

It gives an AI agent one interface over the whole clinical/research EEG workflow: signal processing and source imaging (via MNE-Python), a persistent dataset + EHR store (Postgres + BIDS), and NeuroII web visualization.

Concept

mermaid
flowchart LR    Clinician(["🩺 Clinician"])    Researcher(["🔬 Researcher"])    Agent[["🤖 AI Agent"]]    Server(("neuro-mcp<br/>FastMCP · 54 tools"))
    Clinician -- talks to --> Agent    Researcher -- talks to --> Agent    Agent -- MCP --> Server
    Server --> Processing["Processing &amp; Source Imaging<br/>MNE-Python + ESI"]    Server --> Data["Data &amp; EHR Store<br/>Postgres + BIDS<br/>versioned &amp; audited"]    Server --> NeuroII["NeuroII<br/>Web Visualization"]
    classDef proc fill:#4f8cff,stroke:#2f5fbf,color:#fff    classDef data fill:#2fb380,stroke:#1c7a55,color:#fff    classDef viz fill:#b06fe0,stroke:#7c3fae,color:#fff    class Processing proc    class Data data    class NeuroII viz

A clinician or researcher never calls a tool directly — they talk to an agent in plain English, and the agent drives neuro-mcp's 54 tools underneath. See the Tutorial for what that actually looks like end to end.

Actors & workflows

  • Clinician — reviews a recording, adds/edits annotations, and amends EHR (records a diagnosis/observation, corrects a value), then signs off.
  • Researcher — discovers datasets, imports to BIDS, runs MNE processing + source imaging.
  • Agent — orchestrates the above via tool calls.

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. So a clinician can modify the EHR — 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 (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.

Tools (54)

  • Processing (load_neuro, filter_neuro, resample_neuro, set_montage, set_reference, detect_bad_channels, run_ica/apply_ica, find_events, epoch_neuro, compute_psd, compute_erp, time_frequency, plot_*) and source imaging / ESI (fetch_template_head … extract_label_timecourses).
  • Data/EHR: register_subject, get_subject, add_ehr_record, amend_ehr_record, get_ehr_history, void_ehr_record; import_recording, register_dataset, query_datasets, list_recordings; add_annotation, update_annotation, list_annotations, void_annotation; get_audit_log.
  • neuroii: neuroii_push_recording, neuroii_create_viz_session, neuroii_pull_annotations.
  • neuroii visualizations (standalone interactive HTML, Plotly): visualize_timeseries (stacked multi-channel EEG with scroll + amplitude buttons and annotation markers), visualize_averaging (ERP butterfly + scalp topomap scrubbed by a time slider), visualize_esi (source-estimate ROI time courses + per-time activation bars).

Install

bash
conda create -n neuro-mcp python=3.11 -y   # or any Python >=3.10 envconda activate neuro-mcppip install neuro-mcp              # core, from PyPIpip install "neuro-mcp[postgres]"  # + PostgreSQL driver (LGPL-3.0)pip install "neuro-mcp[viz3d]"     # + 3D source rendering (PySide6, LGPL-3.0)

Working on neuro-mcp itself instead? Clone the repo and use pip install -e . in place of the line above — see Installation for the full zero-to-hero setup, including Claude Code/Codex CLI/Claude Desktop registration.

Configure (environment variables)

VariableDefaultPurpose
DATABASE_URLsqlite:///~/.neuro-mcp/neuro_mcp.dbStore. Prod: postgresql+psycopg://user:pass@host/db
BIDS_ROOT~/.neuro-mcp/bidsRoot of the BIDS-on-disk recording tree
NEUROII_API_URL(unset)neuroii base URL; unset → tools return the documented contract
NEUROII_API_TOKEN(unset)Optional bearer token for neuroii
NEURO_MCP_HOME~/.neuro-mcpBase dir for the SQLite + BIDS defaults

The default (SQLite + a scratch BIDS dir) runs with zero setup; point DATABASE_URL at Postgres for a multi-user/clinical deployment.

Run / register with an MCP host

bash
python -m neuro_mcp     # stdio transport
json
{  "mcpServers": {    "neuro-analysis": {      "command": "/path/to/envs/neuro-mcp/bin/python",      "args": ["-m", "neuro_mcp"],      "env": { "DATABASE_URL": "sqlite:////data/neuro_mcp.db", "BIDS_ROOT": "/data/bids" }    }  }}

neuroii web visualization

Three tools port NEUROII's main views into self-contained interactive HTML files (Plotly, embedded — no server, works offline). Each returns the .html path; interaction runs client-side:

  • visualize_timeseries (RawView) — MNE-style stacked channels with page navigation (⏮ ◀ ▶ ⏭), a page-length box, scroll-to-zoom amplitude, a grid toggle, and recording annotations drawn as labelled marker lines (toggleable).
  • visualize_averaging (EvokedView) — the averaged ERP as stacked channels with a green time cursor + a scalp topomap; a time slider scrubs both, plus a summary sidebar (nave / peak / tmin / tmax).
  • visualize_esi (EsiView) — a volumetric source estimate (fsaverage template) rendered to canvas on three orthogonal MRI slices (sagittal/coronal/axial) with a black-blue-white-red activation overlay, crosshair, L/R and MNI-coordinate labels; the cut planes recentre on each frame's peak. Below, the ERP butterfly carries a red current-time cursor and a blue half-peak marker. Controls: time slider, global/frame colormap-scale toggle, and a mask-threshold slider. Faithful port of NEUROII's views; needs epochs (epoch_neuro + set_montage).
visualize_averaging(session_id="s") -> {"out_path": ".../averaging_s.html", ...}

neuroii integration (greenfield)

neuroii integration is not wired yet. The tools define and return the expected REST contract (see neuro_mcp/neuroii/client.py); until NEUROII_API_URL is set they respond {"status": "not_configured", "contract": {…}} so the neuroii app has a fixed target to implement (POST /api/v1/recordings, POST /api/v1/viz-sessions, GET /api/v1/recordings/{id}/annotations).

Testing

bash
python testing/verify.py     # in-memory MCP client, temp SQLite + BIDS, synthetic EEG

Covers rename integrity, the processing core, the full clinician EHR/annotation lifecycle (add → amend → history → void, with audit), and the neuroii stub. For a full-stack run against Postgres, use testing/docker-compose.yml.

Licensing

neuro-mcp is BSD-3-Clause and bundles no third-party source. All required dependencies are permissive (BSD/MIT/Apache-2.0/PSF). Optional extras carry their own terms — psycopg (LGPL-3.0), PySide6 (LGPL-3.0, chosen over GPL PyQt6). Full attribution and compliance notes are in NOTICE.

License

BSD-3-Clause — see LICENSE.

來源:README.md,提交 786ee6f

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未在限時內回應。

版本歷史

2
  1. v0.1.4最新Oct 26, 2026
  2. v0.1.3Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分