# MNE-MCP

MCP server for neurophysiology data analysis (EEG, MEG, sEEG, ECoG, fNIRS) through MNE-Python. Describe the task — the agent loads the recording, filters it, builds epochs, computes ERPs, and saves plots.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 12
- Author: Exekiel179
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Exekiel179/MNE-MCP
- Updated: 2026-10-14
- HTML: https://affpapa.org/en/nevibecode/mcp/mne-mcp

## What it does

The server holds one MNE-Python session: load a `Raw` object once, then filter, re-reference, run ICA, epoch, average — all in memory, no reloading. Each step saves a PNG (power spectrum, sensor maps, ICA components, ERPs); the agent reads them and explains results. Comes with 41 tools for typical pipelines (filtering, ICA, epoching, averaging) plus work at source level (localization, connectivity, decoding), and an `mne_run_code` escape hatch for any MNE API call in the same live session.

Requires Python 3.12+, Git, and an MCP client. Line frequency, montage, filter band, rejection threshold, ICA parameters, epoch window, directories, and timeout are set through `mne-mcp configure`. Install via pip as `mne-mcp`, then `mne-mcp setup` registers your chosen client (Claude Code, Codex, PsyClaw, opencode) and installs 14 skills. MNE libraries and scientific dependencies are user-managed — the lightweight wrapper does not pull them.

After restarting the client, check status by calling `mne_check_status`: `connected` and `mne_available` are independent flags — the server connects even when MNE is missing.

## Requirements
- Needs: Python and uv (commands run via uvx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mne-mcp -- uvx mne-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from mne-mcp <command>

### Codex

**Platform CLI**
```bash
codex mcp add mne-mcp -- uvx mne-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from mne-mcp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mne-mcp": {
            "command": "uvx",
            "args": [
                "mne-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from mne-mcp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mne-mcp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "mne-mcp"
            ]
        }
    }
}
```
uvx runs the command named after the package; if the README names another one, use uvx --from mne-mcp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mne-mcp uvx mne-mcp
```
uvx runs the command named after the package; if the README names another one, use uvx --from mne-mcp <command>

## When to use it
- analyze EEG, MEG, sEEG, ECoG, and fNIRS recordings through a conversational interface
- filter signal, remove eye artifacts via ICA, and build epochs without reloading the file
- visualize power spectra, sensor maps, ICA components, and ERPs, saving PNGs for review
- run source localization, connectivity analysis, and decoding through structured tools
- execute arbitrary MNE-Python code in the live session via `mne_run_code`

## Example prompts
- Load `sub-01_raw.fif` and show the power spectrum
- Apply a 1–40 Hz bandpass filter and a 50 Hz notch filter, then run ICA to remove eye artifacts
- Build epochs around `stimulus/visual` events, average them, and save the ERP

## Similar
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [labelhead-artist-momentum](https://affpapa.org/en/nevibecode/mcp/labelhead-artist-momentum.md) — MCP server · ★ 107423
- [Agent Skills Search Server](https://affpapa.org/en/nevibecode/mcp/agent-skills-search-server.md) — MCP server · ★ 26559
- [Skyvern](https://affpapa.org/en/nevibecode/mcp/skyvern.md) — MCP server · ★ 23263
- [Nhost](https://affpapa.org/en/nevibecode/mcp/nhost.md) — MCP server · ★ 9366
- [PraisonAI](https://affpapa.org/en/nevibecode/mcp/praisonai.md) — MCP server · ★ 9289

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
