Ephys
Read-only analysis of intracortical BCI recordings (NWB, DANDI, WAV): spikes, PSTHs, decoding, plots
Connector by happyc0der · GitHub account verified by the MCP Registry
Chalk Labs
Need help deploying Ephys?
Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.
Install
Works with Claude Code, Codex, VS Code, Cursor, Windsurf, Claude Desktop. Read the repository before you give any tool access to your data.
npx agentmarket install connector/happyc0der-ephys-mcp
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this server can do and what it asks for, from its tool list, install config and code. Checked Oct 25, 2026.
- Tools
- 12 read · 1 write · 1 delete · 11 not yet classified
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Tools by what they do 25
Read from the source code; the running server may list different tools.
Read 12 · Look things up without changing anything.
detect_spikesevaluate_cross_sessionget_firing_ratesget_probeget_psthget_session_infoget_signal_qualityget_stream_statuslist_dataset_fileslist_lsl_streamslist_sourcessearch_datasets
Write 1 · Create, change, send or run things.
set_probe_geometry
Delete 1 · Delete, drop, revoke or wipe things.
close_session
Not yet classified 11 · We could not tell from the name and description.
decode_windowfit_decoderfit_latent_factorsopen_sessionplot_decodingplot_latent_factorsplot_probeplot_psthplot_rastersort_spikeswrapper
Network hosts it talks to 3
api.dandiarchive.org· found in codegithub.com· found in codeglama.ai· found in code
Files it touches
- Your home directory (~)
- Any path the agent passes to its tools
Tools (25)
Read from the source code; the running server may differ. Descriptions are the server’s own words; hidden characters are shown as [U+…].
close_sessionClose a session and drop any decoder fitted on it.
decode_windowDecode a window with the fitted decoder; returns a downsampled decoded-vs-true preview.
detect_spikesThreshold-crossing spike detection on a broadband snippet (max 10 s). Where the session has ground-truth spikes, precision and recall are reported.
evaluate_cross_sessionFit a decoder on one session and score it, unchanged, on other sessions: the question benchmarks such as FALCON ask (does a decoder survive to a later day?). All sessions must be open and share the same units/channels. `mask` names a boolean behaviour signal restricting which bins are scored (FALCON files carry `eval_mask`; pass null when the sessions have none). Also reports same-session held-out R² for comparison.
fit_decoderFit a decoder from spike counts to a behaviour signal and score it on held-out data. The first `train_fraction` of the session trains; the remainder tests. With no `target`, the first velocity-like behaviour signal is used. Unrecorded gaps are skipped. `mask` names a boolean behaviour signal (such as FALCON's eval_mask); only bins where it is true are used for fitting and scoring.
fit_latent_factorsFit low-dimensional latent factors to trial-aligned population activity. GPFA (Yu et al. 2009) gives denoised single-trial trajectories and a timescale per factor; PCA is the fast, noisier baseline. Look for an elbow in variance_explained_per_factor to judge dimensionality. If the session has a velocity-like signal, reports how well the top factors explain it. Then plot_latent_factors draws the trajectories.
get_firing_ratesPopulation firing-rate summary over a time range (defaults to the whole session).
get_probeContact geometry and brain-area labels per channel, where known. Use the `channel` indices with the `units` argument of get_psth / fit_latent_factors to analyse one area.
get_psthPeri-stimulus time histogram: firing aligned to a trial event and averaged over trials. `event` is one of the session's event_columns (default: movement onset if present). `group_by` splits trials by one of its group_columns, e.g. reach direction. `units` restricts the analysis to some units; tuning that cancels in the population average (such as direction preference) only shows up per unit. Unit numbers in the result index into `units` when it is given. Returns the population time course, its peak, and the units that change most.
get_session_infoMetadata for a session: duration, channels, sampling rates, behaviour signals, licence, citation.
get_signal_qualityNoise level, SNR and dead/noisy channels from a broadband snippet (max 10 s).
get_stream_statusFor a live session: how much signal is buffered, whether data is still arriving, and drops.
list_dataset_filesLicence, citation and NWB files of a DANDI dataset. Pass a file's path to open_session(source='dandi').
list_lsl_streamsLab Streaming Layer streams visible on the local network (needs the lsl extra).
list_sourcesList the data source types this server can open, with their parameters and status.
Show 10 more tools
open_sessionOpen a recording session and return its session_id and metadata. `params` overrides the source's default_params (see list_sources).
plot_decodingFigure: decoded against actual behaviour for a window (max 60 s), one panel per dimension. Requires fit_decoder first. Pick a window in the test split for an honest picture.
plot_latent_factorsFigure: the top three latent factors over time (single trials thin, group means bold), the trajectory in the plane of the first two factors, and variance explained per factor. Requires fit_latent_factors first.
plot_probeFigure: the array map, each contact coloured by its firing rate over a window, with area labels and sorted units marked when a sort has been run. Needs geometry from the file or set_probe_geometry.
plot_psthFigure: population PSTH per group (mean ± SEM over trials) above a unit-by-time heatmap of change from baseline. Same arguments as get_psth. Returns the PNG path and the image.
plot_rasterFigure: spike raster for a time window (max 60 s), with unrecorded spans shaded.
search_datasetsSearch the DANDI Archive for datasets. An empty query returns a short curated list of intracortical datasets that work well with this server.
set_probe_geometryTell the server where the recording's contacts are, for sessions whose file does not say. Named layouts: 'utah' (square grid, e.g. 96 contacts at 400 um), 'grid' with n_columns, 'linear' (one column at pitch_um, e.g. a laminar probe), 'tetrode_linear' (groups of four). 'explicit' takes positions_um as [[x, y], ...] in channel order. Geometry is used by sort_spikes and plot_probe. Contacts under 100 um apart are sorted jointly.
sort_spikesSpike-sort a broadband window (needs the sort extra). Afterwards the session's spike times are the sorted units, restricted to that window, so rates, PSTHs, rasters and decoders use them. Uses the session's probe geometry (from the file or set_probe_geometry) so nearby contacts are sorted jointly; without geometry each channel is treated as an independent electrode. Sorting takes seconds to a few minutes depending on duration and channel count.
wrapper
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 1
- Weekly downloads
- 62
- Last commit
- Sep 25, 2026 (1 month ago)
- Last release
- Sep 22, 2026 (1 month ago)
- Last package publish
- Sep 22, 2026 (1 month ago)
From GitHub (fetched Oct 24, 2026) and the package registry.
Details
- Registry name
io.github.happyc0der/ephys-mcp- Version
- 0.5.1
- Auth
- No auth
- Packages
- pypi ephys-mcp
- License
- CC0-1.0
- Repository
- github.com/happyc0der/ephys-mcp
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
More from happyc0der
Done for you
Rather not set it up yourself?
Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.
See how we build AI agents →Read the case studies
Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.
- launches shipped
- 50+
- launches shipped
- media placements
- 500+
- media placements
- founders on every account
- 2
- founders on every account
Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block
Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.
Get Ephys running in your business
Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.
Cite this page
Ephys MCP server. Agent Mart. https://agentmart.dev/connectors/happyc0der-ephys-mcp (last updated 2026-10-24)