Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
MNE_MCP_CONFIGNoPath to configuration file (default: ~/.mne-mcp/config.json)
MNE_MCP_TIMEOUTNoPer-operation timeout in seconds; raise for ICA/TFR/large files300
MNE_MCP_DATA_DIRNoDefault directory that mne_list_files scans
MNE_MCP_RESULTS_DIRNoDirectory where figures and exported objects are saved

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
mne_check_statusA

Check MNE MCP capabilities: MNE-Python version, scikit-learn (needed for ICA), numpy/scipy/matplotlib versions, and runtime directories. Call this first.

mne_get_configA

Show the configured default analysis parameters (line frequency, default montage, filter band, rejection threshold, ICA method/components, epoch window, dirs, timeout) that the structured tools fall back to when a parameter is omitted. Users change these by running mne-mcp configure in a terminal.

mne_session_infoA

List every object currently held in the persistent analysis session (raw recordings, epochs, evoked, ICA, events, arrays) with a one-line summary. Use this to see what is loaded before operating on it.

mne_describeB

Show a detailed summary of one named session object (channels, sfreq, montage, bads, etc.).

mne_get_infoA

Show the full channel list and measurement info for a named session object.

mne_reset_sessionA

Clear all loaded objects and figures from the session, starting fresh. Irreversible.

mne_run_codeA

Execute arbitrary Python/MNE code in the persistent session namespace. Pre-bound names: mne, np, pd, plt, plus every object you have loaded (e.g. raw, epochs, evoked, ica). Like a notebook cell: the value of a final expression is returned, stdout is captured, and any matplotlib figures are saved as PNG (paths returned). Use this for anything the structured tools do not cover.

mne_list_filesA

List neurophysiology data files (.fif, .edf, .bdf, .vhdr, .set, .cnt, .egi/.mff, .ds, .snirf, …) under a directory. Defaults to MNE_MCP_DATA_DIR / current dir. Optionally pass a glob pattern.

mne_load_rawA

Load a raw recording from disk into the session. Auto-detects the format by extension (FIF/EDF/BDF/BrainVision/EEGLAB/CNT/EGI/…). Stores it under name (default raw). Set preload=False for very large files.

mne_filterA

Band-pass / high-pass / low-pass and/or notch filter a Raw/Epochs/Evoked object in place. l_freq=high-pass edge, h_freq=low-pass edge (either may be null), notch=line-noise frequency (e.g. 50 or 60). picks optional ('eeg', 'meg', or null).

mne_resampleB

Resample a Raw/Epochs object to a new sampling frequency (Hz), in place.

mne_cropB

Crop a Raw/Epochs/Evoked object to the time window [tmin, tmax] seconds, in place.

mne_set_montageA

Apply a standard electrode montage (e.g. 'standard_1020', 'standard_1005', 'biosemi64', 'GSN-HydroCel-128') to set channel positions. Needed before topographic plots and interpolation. If montage is omitted, uses the configured default (set via mne-mcp configure).

mne_set_referenceB

Set the EEG reference. Use 'average' for average reference, 'REST', or a comma-separated list of channel names (e.g. 'TP9,TP10').

mne_mark_bad_channelsB

Mark channels as bad (comma-separated names, e.g. 'Fp1,T7'). By default appends to existing bads; set replace=true to overwrite.

mne_interpolate_badsB

Interpolate currently-marked bad channels using spherical splines (requires a montage).

mne_plot_psdB

Plot the power spectral density of a Raw/Epochs/Evoked object. Returns a PNG path.

mne_plot_rawC

Plot raw signal traces (a window of channels over time). Returns a PNG path.

mne_plot_sensorsB

Plot the sensor/electrode layout (kind='topomap' 2D or '3d'). Returns a PNG path.

mne_fit_icaA

Fit Independent Component Analysis on a (preferably 1 Hz high-pass filtered) Raw/Epochs object for artifact removal. n_components can be an int, a float (variance fraction), or null. method: 'fastica' (default), 'infomax', 'picard'. Stored under ica_name (default 'ica'). Requires scikit-learn.

mne_plot_ica_componentsA

Plot ICA component scalp topographies (to identify eye/heart/muscle artifacts). Returns PNG path(s).

mne_plot_ica_sourcesB

Plot ICA component time courses for an instrument (raw/epochs). Returns a PNG path.

mne_apply_icaB

Remove ICA components from an instrument in place. exclude = comma-separated component indices to drop (e.g. '0,3'); if omitted, uses the ICA object's current exclude list.

mne_find_eventsA

Find stimulus/trigger events on a stim channel of a Raw object. Stores them under events_name.

mne_events_from_annotationsA

Convert a Raw object's annotations into an events array + event_id map (for EDF/BrainVision/EEGLAB data).

mne_make_epochsA

Segment a Raw object into Epochs around events. tmin/tmax in seconds relative to the event; baseline 'default' = (None, 0); event_id like 'target:1,standard:2' to name/select conditions; reject_eeg = peak-to-peak EEG rejection threshold in volts (e.g. 100e-6). Prefer JSON event_id={label: code} and baseline=[start, end] or null; legacy strings remain supported. reject/flat map channel types to SI thresholds; reject={} disables configured rejection. Do not combine reject with reject_eeg. Stored under epochs_name.

mne_plot_epochs_imageA

Plot an ERP image (epochs × time heatmap) for an Epochs object. Returns PNG path(s).

mne_average_evokedB

Average Epochs into an Evoked (ERP/ERF) response. condition = an event_id name to average just that condition (else averages all). Stored under evoked_name.

mne_plot_evokedB

Plot an Evoked response. style: 'joint' (butterfly + topomaps, default), 'topo', or 'butterfly'. Returns PNG path.

mne_plot_topomapA

Plot scalp topographies of an Evoked at given times. times='auto', 'peaks', or comma-separated seconds (e.g. '0.1,0.2,0.3'). Returns PNG path.

mne_compute_tfrA

Compute Morlet or multitaper Epochs power with explicit frequencies, scalar/per-frequency n_cycles, channel picks, decimation, trial retention, optional ITC and power baseline normalization. Pass a params JSON object. Averaged trial power is total power, not strictly induced power. ITC requires average=true. Returns output names, shape, optional figure paths and reproducible code. Input epochs are unchanged.

mne_tfr_morletC

Compute Morlet-wavelet time-frequency power on Epochs and plot it. fmin/fmax = frequency range (Hz), n_freqs = number of frequencies. Stored under tfr_name. Returns PNG path.

mne_saveB

Save a session object to disk. MNE naming rules: Raw → '_raw.fif', Epochs → '-epo.fif', Evoked → '*-ave.fif'. Other formats follow the object's .save() support.

mne_decodeA

Time-resolved decoding (MVPA): train a classifier at each time point to discriminate two conditions, with cross-validation. cond_a/cond_b are event_id names (e.g. 'target','standard'). Supports stratified, stratified_group or leave_one_group_out CV. groups must align with ALL retained input epochs before condition filtering. Saves mean scores under name, per-fold scores under name_folds and split diagnostics under name_details. method='sliding' returns (time,), 'generalizing' returns (train_time, test_time). Optional tmin/tmax crop a copy in seconds. C>0, class_weight=null|'balanced' and max_iter configure fold-local logistic regression. Choose them before CV or use nested CV via mne_run_code for tuning. Reference lines are not significance. Requires scikit-learn.

mne_decoding_group_testA

Group-level sign-flip inference on mne_decode mean scores, one per independent subject. Requires score_names, unique subject_ids, independent_subjects=true and explicit null_value. Never pass CV folds or repeated runs as subjects. Supports ROC AUC/balanced accuracy, matching time grids and methods. max_t: two-sided pointwise FWER across the whole curve/matrix; cluster: cluster-mass FWER with time or train-time/test-time lattice adjacency. Requires symmetric subject effects under the null. Not single-subject label shuffling or population prevalence. Stores statistic, corrected p values or cluster p values, mask, H0 and diagnostics.

mne_connectivityA

Spectral connectivity between channels over Epochs in a frequency band. method: 'coh', 'plv', 'wpli', 'pli', 'imcoh', etc. Returns an ordered-edge heatmap without forcing symmetry. Use mne_compute_connectivity for multi-band, channel-pair and estimator parameters. Requires mne-connectivity.

mne_compute_connectivityA

Bivariate across-trial connectivity with a params JSON object: multiple bands, ordered channel-name pairs, picks, epoch-relative time window, multitaper/fourier/cwt_morlet estimation and smoothing/cycles. Preserves signed, directed and complex values. Stores an MNE Connectivity object; optional first-30-edge heatmap (CWT time mean, complex magnitude only for display). Requires mne-connectivity. Not Granger/PAC.

mne_compute_noise_covB

Compute a noise covariance matrix from the Epochs baseline (data up to tmax seconds, default 0). Needed before building an inverse operator for source localization.

mne_make_forwardA

Build a template-head (fsaverage) EEG forward model for the named object's montage. Downloads the fsaverage template once (~ tens of MB). Use for EEG source localization without an individual MRI. Stored under fwd_name.

mne_apply_inverseA

Estimate cortical sources from an Evoked using a forward model and noise covariance. method: 'dSPM' (default), 'MNE', 'sLORETA', 'eLORETA'. Stores the source estimate (stc) and reports the peak activation time. Pair with mne_make_forward + mne_compute_noise_cov.

mne_plot_source_estimateA

Render a source estimate (stc) as a cortical activation map (PNG) at its peak time or a given time. hemi: 'both' / 'lh' / 'rh'. Requires PyVista with off-screen rendering; if 3D rendering is unavailable the estimate is still computed and can be inspected via mne_run_code.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.1/5.0

Scored across 41 tools

Disambiguation2/5

Several tool pairs overlap heavily: mne_compute_connectivity/mne_connectivity, mne_compute_tfr/mne_tfr_morlet, and mne_describe/mne_get_info all have very similar purposes despite detailed caveats. An agent could easily select the wrong one, especially when the names differ only by verb prefix or not at all.

Naming Consistency3/5

Most tools follow the readable mne_<verb>_<object> pattern, but there are notable exceptions like mne_connectivity, mne_tfr_morlet, mne_decode, and mne_decoding_group_test that break the convention. The consistent mne_ prefix helps, but the mix of verb-first and noun-first names reduces predictability.

Tool Count2/5

With 41 tools, this is well above the 25-tool threshold and feels heavy for an MCP surface, even for a broad neuroimaging domain. Several overlapping connectivity/TFR/plotting tools could be consolidated, and mne_run_code already provides an escape hatch for unusual cases.

Completeness4/5

The tool set covers the full MNE analysis lifecycle: loading, preprocessing, epoching, averaging, ICA, TFR, connectivity, source localization, decoding, plotting, and saving. Minor gaps exist, such as dedicated tools for loading saved Epochs/Evoked objects or removing individual session objects, but these are workaroundable via mne_run_code.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive