Demos from my Connectomics MCP
I spent three years of my PhD anaylyzing connectomics datasets — FlyWire, MICrONS, the hemibrain. Each one has its own API, its own naming conventions, its own way of making a small question take a whole day to answer. A simple question like "what are the inputs to this neuron?" requires reading docs, writing boilerplate, and reformatting results, all when you started by being curious about the biology hours ago.
I built an MCP server that lets Claude Code (CC) query and analyze all three datasets in the span of seconds. With it, I had the fly's locus of spatial memory, its heading-direction and path-integration circuits, mapped out in 6 minutes. I had a disinhibitory pathway in mouse V1 traced from an interneuron through its targets correlated to those targets' orientation tuning in under 9 minutes.
Here's my GitHub link if you want to try.
And here are those two explorations, if you're curious:
Spatial Memory in the Fly

My prompt into CC:
MeAsking about path integration
I want to better understand the path integration circuit of the fruit fly. I've heard that it uses the connectivity of the ring neurons in the central complex to instantiate a 1-D ring attractor, and that motion signals it perceives like velocity and head direction help update its internal model of its position. I want to use the fly connectome to analyze that circuitry to understand the mechanism better. I don't know all the names of the relevant cells, unfortunately, so you'll have to dig that up yourself.
And it's response:
ClaudeGetting started
Great question! The fruit fly's path integration circuit is a beautiful example of neural computation. Let me query the hemibrain connectome for the key cell types involved in the path integration circuit. The core players are: 1. EPG neurons — the head direction "compass" cells forming the ring attractor in the ellipsoid body 2. PEN neurons — angular velocity integrators that shift the compass bump 3. PFN neurons — carry velocity signals for path integration 4. hDelta neurons — fan-shaped body interneurons that perform the vector computation Let me pull all of these in parallel.
CC made a few dozen tool calls over the next several minutes, tracing connectivity for each cell type and following the strongest connections downstream. Here's some of the comments it made along the way:
ClaudeFinding cells
I have the EPG neurons - 46 of them spanning positions L1-L8 and R1-R8 in the protocerebral bridge, corresponding to the 16 glomeruli that map to the ring attractor. Now let me pull connectivity for representative neurons from each key type.
ClaudeTracing inputs
Key finding: PEN neurons receive their strongest input from GLNO (Gall/Nodulus) neurons, which carry angular velocity signals. Let me analyze the PEN connectivity and find PFNd/hDeltaB neuron IDs from the existing data.
And then produced this summary:
ClaudePath Integration Circuit in the Fruit Fly Central Complex
## Path Integration Circuit in the Fruit Fly Central Complex Based on connectivity data from the hemibrain connectome, here's how the fly's path integration circuit works, organized by its three functional modules:
ClaudeModule 1: Head Direction Ring Attractor (Ellipsoid Body)
### Module 1: Head Direction Ring Attractor (Ellipsoid Body) EPG neurons (46 neurons) are the compass cells. They tile 16 glomeruli of the protocerebral bridge (L1-L8, R1-R8), which map onto the ellipsoid body ring. A single bump of activity encodes the fly's current heading. The ring attractor is maintained by three interacting cell types: 1. EPG → Delta7 (~550 per target cell): Strongest EPG output; Delta7 provides global inhibition across the ring to keep exactly one bump. 2. EPG ↔ EPG (~215 cell): Recurrent excitation stabilizes the bump. 3. ER → EPG (~330-370/cell): Visual landmark input (ER4m, ER4d, ER2_c) anchors the bump to the world.
ClaudeModule 2: Angular Velocity Updates the Compass
### Module 2: Angular Velocity Updates the Compass PEN_a (PEN1) (20 neurons) and PEN_b (PEN2) (22 neurons) shift the bump when the fly turns: 1. GLNO → PEN_a (~318/cell): Angular velocity signal from the noduli — this is the rotation input! 2. PEN_a → EPG (~722/cell): Massive drive; PEN connects with a 1-column offset in the protocerebral bridge, so activity shifts the EPG bump left or right. 3. EPG → PEN_a (~299/cell): Feedback: the compass tells PEN where the bump currently is. PEN_a and PEN_b shift the bump in opposite directions. When the fly turns right, one type is activated more, pushing the bump clockwise; turning left activates the other, pushing counterclockwise. The GLNO neurons from the noduli provide the angular velocity magnitude.
ClaudeModule 3: Translational Velocity → Position Integration (Fan-shaped Body)
### Module 3: Translational Velocity → Position Integration (Fan-shaped Body) This is the actual path integration — converting "how fast am I going in what direction" into "where am I": 1. LNO2 → PFNd (~162/cell): Translational velocity signal from the noduli (distinct from the angular velocity GLNO signal!). 2. Delta7/EPG → PFNd (~233 + 55/cell): Head direction information 3. PFNd → hDeltaB (~340/cell): PFNd combines heading × velocity; hDeltaB is the dominant recipient. 4. hDeltaB → PFR_aPFR_b/FR1 (~400/394/314 per cell): Output to steering neurons. PFNd acts as a multiplier: it receives both heading (from EPG/Delta7) and speed (from LNO2), producing a velocity vector in an allocentric (world-centered) reference frame. hDeltaB (19 neurons) is the integrator: it accumulates these velocity vectors over time in the fan-shaped body columns. Its overwhelmingly dominant input is PFNd (806 synapses from 18 PFNd neurons), making it essentially a dedicated readout of the heading-weighted velocity signal.
ClaudeKey Insight: Two Coupled Rings
### Key Insight: Two Coupled Rings The circuit uses two distinct ring-like representations: 1. Ellipsoid body ring (EPG + PEN + Delta7): a classical 1-D ring attractor encoding head direction. Angular velocity from GLNO rotates the bump. Visual landmarks from ER neurons anchor it. 2. Fan-shaped body columns (PFNd → hDeltaB): a columnar array encoding an integrated position vector. Each PFNd neuron carries velocity weighted by its preferred heading, and hDeltaB accumulates this over time. The bridge between them is PFNd, which reads the compass (EPG/Delta7) and the speedometer (LNO2) to produce heading-weighted velocity — exactly the signal you need to integrate for path integration. Would you like me to go deeper into any part of this circuit — for example, examining the column-by-column offset structure of PEN→EPG connections, or looking at how the output PFL neurons compare the goal vector with current heading?
Six minutes and twenty-two seconds. CC queried the hemibrain for each cell type, followed the strongest connections downstream at each step, and assembled the three-module circuit above — from the EPG compass neurons through the PEN bump-shifters all the way to the hDeltaB integrators in the fan-shaped body. That last part is a great sign that CC isn't just parroting back some canonical circuit description of 1D ring attractors: my question was about path integration, not just head direction, and CC traced the circuit past the well-known ring attractor into the less-familiar velocity integration pathway without being told to.
The same question works with FlyWire. CC finds the same circuit (view in Neuroglancer) in about five minutes, though the experience is a little different — the hemibrain uses names from decades of Drosophila neuroscience (EPG, PEN, Delta7), while FlyWire has its own hierarchical taxonomy, and there's no universal mapping between them. Schlegel et al. 2023 built morphological correspondences across datasets using NBLAST scores, and that's in the pipeline for the MCP. For now, CC reads FlyWire's taxonomy and reasons about the correspondences itself — imperfectly, but well enough to find the same circuit. FlyWire also has richer neurotransmitter annotations, which opens up questions the hemibrain can't answer, like how dopaminergic neurons modulate the goal vector computation.
The Functional Role of Disinhibition in Mouse Visual Cortex
The fly brain is a complete wiring diagram of a small nervous system. The MICrONS dataset reaches toward something bigger — a cubic millimeter of mouse visual cortex, reconstructed at synaptic resolution, with thousands of neurons that were also recorded in an awake mouse watching movies before the tissue was imaged. Structure and function, coregistered in the same cells. No other dataset can do this. The questions here are different from the fly. Instead of tracing uniquely identified neurons through a circuit, you're looking for connectivity motifs that repeat across the tissue — and because you have both wiring and visual responses, you can ask whether those motifs mean something.
I approached this one differently from the fly circuit. Instead of asking CC to characterize a known circuit, I wanted to see if it could connect two results from the MICrONS Nature suite — the inhibitory motif groups from Schneider-Mizell et al. and the coregistered functional imaging — and find something new. The conversation went somewhere I didn't expect.

MeAsking about disinhibition
Using the MICrONS dataset, find me an inhibitory neuron that Schneider-Mizell et al. identified as a disinhibitory specialist (one that preferentially targets other inhibitory neurons, specifically basket cells). Get its connectivity and tell me what it targets.
MeInhibiting basket cells to disinhibit pyramidal neurons
Pull the output connectivity of those basket cells and tell me: which pyramidal neurons do they inhibit, how many of those have coregistered functional data?
MeTuning of disinhibition (via basket cells)
Are the pyramidal neurons that are inhibited by those basket cells functionally similar to each other, or diverse? Compare the distribution of their tuning to a random sample of L2/3 pyramidal neurons in the same spatial neighborhood.
And after a grand total of 8 minutes, CC fetched the functional properties for thousands of neurons and wrote and ran some quick Python code to analyze their functional similarity.
ClaudeResults: Orientation Tuning of BC-Inhibited Pyramidal Neurons
## Results: Orientation Tuning of BC-Inhibited Pyramidal Neurons ### The short answer: functionally diverse, not clustered — but with subtle differences from controls. ### Orientation Preference - Both BC targets and neighborhood controls show a strong cardinal bias peaking at ~90° (vertical/horizontal orientations), which is typical of mouse V1. - The distributions are broadly similar, but BC targets (n=2,562) have a slightly tighter concentration around 72–108° (KS test p = 7×10⁻⁵). The circular variance confirms this: 0.69 for BC targets vs. 0.76 for controls — the BC targets are slightly less diverse in their orientation preferences. ### Selectivity Indices | Metric | BCs | Control | Signif. | |--------|-------------|-------------|-----------| | gOSI | 0.23 ± 0.13 | 0.22 ± 0.13 | p = 0.005 | | OSI | 0.42 ± 0.20 | 0.40 ± 0.20 | | | DSI | 0.23 ± 0.16 | 0.24 ± 0.17 | | BC-targeted pyramidal neurons are marginally more orientation-selective (higher gOSI/OSI) and slightly less direction-selective (lower DSI) than their neighbors (control, n=2,505, Mann-Whitney U-test). The effects are statistically significant given the large sample sizes but modest in magnitude (~5% relative difference). ### Per-Basket-Cell Diversity The bottom-right panel shows that every individual basket cell targets a diverse pool of orientations (circular variance 0.65–0.80 across all 5 BCs) — none of them selectively inhibits a single orientation column. ### Interpretation This is consistent with the known physiology of PV+ basket cells in mouse V1: they provide broad, non-selective perisomatic inhibition (the "blanket of inhibition" model). Each BC contacts thousands of local pyramidals spanning the full range of orientation preferences. The slight enrichment in orientation selectivity among BC targets may reflect that basket cells preferentially contact neurons with stronger sensory drive — which would make them better targets for gain control — but the effect is subtle. These BCs are not carving out orientation-specific subnetworks; they are performing divisive normalization across the local population.
So CC found that basket cells disinhibited by an ITC target a functionally diverse pool of L2/3 pyramidals. That's standard; PV+ basket cells provide broad perisomatic inhibition. But how about the Martinotti cells? 3 more minutes of CC and:
ClaudeMartinotti Cell Pathway: Key Findings
## Martinotti Cell Pathway: Key Findings ### MC vs BC: Strikingly similar — but with a critical structural difference The MC and BC pathways are functionally indistinguishable (KS tests: pref_ori p=0.88, gOSI p=0.99, DSI p=0.43). Both populations show: - Circular mean orientation ~82°, broad cardinal bias - Mean gOSI ~0.23, mean DSI ~0.22–0.23 - High circular variance (0.68–0.69) — diverse, not clustered
ClaudeTuning of shared (MC+BC) disinhibition
### The massive overlap is the real story 2,293 out of 3,226 MC-targeted L2/3 neurons (71%) are also targeted by the BCs. These two inhibitory pathways converge onto a largely shared pyramidal population, Shared (MC+BC). Breaking the targets into exclusive vs shared groups reveals a gradient: | Group | n | gOSI | CirVar | DSI | |---------|-------|-------|--------|-------| | Shared | 1,630 | 0.235 | 0.660 | 0.224 | | BC-only | 932 | 0.226 | 0.754 | 0.237 | | MC-only | 610 | 0.216 | 0.725 | 0.216 | | Control | 1,970 | 0.219 | 0.743 | 0.247 | The shared targets — neurons receiving convergent MC and BC inhibition — are the most orientation-selective (highest gOSI) and the most coherently tuned (lowest circular variance, CirVar). MC-only and BC-only targets look more like the general population. ### Interpretation Both the Martinotti and basket cell arms of this disinhibitory circuit target a largely overlapping, functionally diverse pool of L2/3 pyramidals — but the neurons that sit at the intersection of both inhibitory streams are slightly but consistently more tuned. This is consistent with a model where the most visually driven neurons in the local population receive the strongest inhibitory regulation from both dendritic (MC) and perisomatic (BC) compartments. The ITC disinhibitor, by releasing both brakes simultaneously, would preferentially boost these well-tuned neurons — a form of feature-selective gain modulation emerging from a structurally non-selective circuit.
That caught me off guard: Claude flagging that the neurons at the intersection of both the Martinotti and basket cell pathways were more orientation-coherent and more selective than the rest. That looked like a real circuit-specific signal: convergent dendritic and perisomatic inhibition landing on a functionally distinct subpopulation.
But let's get precise about the controls. The pyramidal neurons suppressed by both pathways exist in an even smaller spatial volume, and since the primary visual cortex is retinotopic, these neurons are even more likely to respond to similar orientations.
MeQuestioning the control
Can you explain the control you used here? Is there a need for a separate control for the Shared group as compared to the control for the BC-only or MC-only groups?
ClaudeThe control
## The control The control is a random sample of L2/3 pyramidal neurons from the same spatial neighborhood that are not targeted by any of the 5 BCs or 5 MCs in this analysis. "Same spatial neighborhood" is defined as neurons whose soma positions fall within ±2 standard deviations of the BC/MC target population's centroid in the x and z dimensions (the tangential cortical axes), without filtering on y (depth axis, which would conflate laminar identity with spatial proximity). This controls for: - Laminar identity (all are 23P) - Retinotopic position (same cortical patch, so similar visual field coverage) - Imaging coverage bias (same region is likely covered by the same 2-photon sessions)
ClaudeDoes the Shared group need a separate control?
## Does the Shared group need a separate control? Yes, arguably it does, and the current analysis has a confound. The issue is: Neurons targeted by more interneurons are, by definition, more synaptically connected. A neuron that receives convergent BC+MC input likely has a larger dendritic arbor, more total synapses, or sits in a denser part of the neuropil. These are neurons that are more "visible" to the connectome — and being more connected could correlate with being more visually driven (higher firing rates → more orientation selectivity) for purely structural reasons, not because of any specific circuit logic. A proper control for the Shared group would be L2/3 pyramidals that are: 1. In the same spatial neighborhood 2. Matched in total inhibitory synapse count (or total postsynaptic count) — i.e., they receive a comparable amount of inhibition, just not from these specific MCs and BCs 3. Not targeted by any of the 10 interneurons in this analysis Without that, the gOSI difference in the Shared group (0.235 vs 0.219 in control) could simply reflect a connectivity-selectivity correlation: neurons with more synaptic partners tend to be more orientation-selective because they're larger, healthier, or better-proofread neurons in the EM volume. After matching controls on neuron volume (a proxy for total connectivity/arbor size), the picture changes substantially from the original analysis:
ClaudeOrientation Selectivity (gOSI): No longer significant
### Orientation Selectivity (gOSI): No longer significant The gOSI differences we saw earlier do not survive volume matching. The Shared group's elevated selectivity (which looked interesting before) shrinks to a non-significant trend (p = 0.10, d = +0.08). This suggests the original effect was at least partly driven by the connectivity-selectivity confound we anticipated.
ClaudeDirection Selectivity (DSI): Robust and real
### Direction Selectivity (DSI): Robust and real The one signal that does survive is in direction selectivity — all three target groups show lower DSI than their volume-matched controls (Shared: p = 1.3×10⁻⁴, MC-only: p = 4.2×10⁻³, BC-only: p = 8.8×10⁻³). These interneurons preferentially target pyramidal neurons that are less direction-selective than their neighbors of the same size.
ClaudeOrientation preference (CirVar): Shared group shows tighter tuning
### Orientation preference (CirVar): Only the Shared group shows tighter tuning The tighter clustering of preferred orientation survives in the Shared group (CirVar 0.660 vs 0.764, KS p = 3.2×10⁻⁴) but not in MC-only (p = 0.80) or BC-only (p = 0.58). This means the orientation coherence is specific to the neurons receiving convergent MC+BC inhibition — not a generic property of being targeted by any one interneuron.
ClaudeBottom line
### Bottom line The volume-matched controls reveal that: 1. The gOSI enrichment was largely a connectivity confound — more-connected neurons tend to be more orientation-selective, and that explained most of the effect. 2. The DSI depression is real — these interneurons preferentially target orientation-tuned but not direction-tuned pyramidals, regardless of neuron size. 3. The orientation coherence in the Shared group is the one genuinely circuit-specific signal — neurons at the intersection of dendritic (MC) and perisomatic (BC) inhibition share more similar orientation preferences than you'd expect by chance, even after controlling for volume.
So the orientation selectivity enrichment didn't survive volume matching — more-connected neurons tend to be more selective, and that explained most of the effect. But two signals did survive: the shared MC+BC targets still had tighter orientation coherence (p = 3.2×10⁻⁴), and all three target groups showed lower direction selectivity than their size-matched neighbors. These interneurons preferentially target neurons that are orientation-tuned but not direction-tuned, regardless of how connected those neurons are.

Conclusion
Is this a discovery? Not from a single ITC neuron. A proper analysis would need to trace this across many ITC circuits and account for each neuron's proofreading quality — both queryable through the MCP, both natural next steps. But going from a structural motif to a functional hypothesis to a controlled statistical test in a single CC session, with the MCP supplying data at every step — that's the workflow I wanted to exist three years ago.
The MCP is at GitHub link and wraps FlyWire, the hemibrain via neuPrint, and MICrONS via CAVE, including the functional imaging data. I'm still building it — bulk connectivity downloads, cross-dataset cell type mapping via NBLAST scores, and better coverage of the MICrONS annotation tables are next. I've used the H01 dataset before too, but it's even less accessible. If you work with connectomics, try it out and tell me what's missing.
References
Dorkenwald, S. et al. "Neuronal wiring diagram of an adult brain." Nature 634, 124–138 (2024). doi:10.1038/s41586-024-07558-y
Scheffer, L.K. et al. "A connectome and analysis of the adult Drosophila central brain." eLife 9, e57443 (2020). doi:10.7554/eLife.57443
MICrONS Consortium et al. "Functional connectomics spanning multiple areas of mouse visual cortex." Nature 640, 435–447 (2025). doi:10.1038/s41586-025-08790-w
Schneider-Mizell, C.M. et al. "Inhibitory specificity from a connectomic census of mouse visual cortex." Nature 640, 448–458 (2025). doi:10.1038/s41586-024-07780-8
Schlegel, P. et al. "Whole-brain annotation and multi-connectome cell typing of Drosophila." Nature 634, 139–152 (2024). doi:10.1038/s41586-024-07686-5