# Allenbrain-mcp — MCP server wrapper for Allen Brain Atlas API (RMA + downloads)

**URL:** <https://community.brain-map.org/t/allenbrain-mcp-mcp-server-wrapper-for-allen-brain-atlas-api-rma-downloads/4858>\
**Category:** OpenScope\
**Tags:** software, api, allensdk\
**Created:** [February 25, 2026, 3:53pm UTC](https://community.brain-map.org/t/allenbrain-mcp-mcp-server-wrapper-for-allen-brain-atlas-api-rma-downloads/4858 "2026-02-25T15:53:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maflot](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.brain-map.org/maflot/32/775_2.png) [@maflot](https://community.brain-map.org/u/maflot)\
**Post date:** [February 25, 2026, 3:53pm UTC](https://community.brain-map.org/t/allenbrain-mcp-mcp-server-wrapper-for-allen-brain-atlas-api-rma-downloads/4858/1 "2026-02-25T15:53:58Z")

</div>

## Request for feedback: `allenbrain-mcp` (MCP wrapper for the Allen Brain Atlas API) + worked C4b example

Hello everyone,

I have been developing a small Model Context Protocol (MCP) server that exposes a curated subset of the Allen Brain Atlas Data API (primarily RMA queries plus several download endpoints). This is still early-stage work; my goal is to make a few common Allen API workflows easier to run from LLM-enabled clients while keeping inputs explicit and results reproducible.

Repository: [GitHub - maflot/allenbrain-mcp: A comprehensive Model Context Protocol (MCP) server for querying the Allen Institute for Brain Science API.](https://github.com/maflot/allenbrain-mcp)

### What is currently implemented (high level)

- A generic RMA tool (`execute_rma_query`) for querying arbitrary data models (e.g., `SectionDataSet`, `StructureUnionize`, `Specimen`, `Structure`, …)
- A small set of convenience tools for:
  - cell types (specimens, ephys sweeps/features, morphology features)
  - ontologies / structures (atlases, structure graphs, structures)
  - image enumeration + downloads (section images, atlas images, SVG overlays)
  - volumetric downloads (expression grids, projection grids, CCF annotation volume, structure meshes)

Downloads are streamed to disk to avoid holding large payloads in memory.

### Example: C4b expression in adult mouse brain

> **[allenbrain-mcp/examples/c4b\_mouse\_brain\_v2 at main · maflot/allenbrain-mcp](https://github.com/maflot/allenbrain-mcp/tree/main/examples/c4b_mouse_brain_v2)**
>
> A comprehensive Model Context Protocol (MCP) server for querying the Allen Institute for Brain Science API. - maflot/allenbrain-mcp

I added a worked example under `examples/` that investigates complement component 4B (_C4b_) in the adult mouse brain using the Allen Mouse Brain Atlas ISH data. The example includes:

- dataset discovery for _C4b_ (adult Mouse product)
- section image enumeration and selection of representative anterior/mid/posterior slices
- downloads of downsampled ISH images and expression overlays
- `StructureUnionize` queries restricted to the adult CCF ontology (`graph_id = 1`) to obtain interpretable regional rankings
- download of 3D expression grids (MetaImage ZIP) for energy/density/intensity

In addition, there is a short “tool-call log” document that records the MCP tool calls (parameters, purpose, and outcomes) to make the workflow auditable and easier to reproduce.

### Feedback and suggestions welcome

I would be grateful for any feedback, ideas, or pointers—especially around how to keep this work aligned with established Allen API conventions and community practice. In particular, I would appreciate guidance on:

- whether the overall approach and level of abstraction makes sense,
- how to structure queries and responses in a way that remains consistent with the Allen API “idioms” (RMA criteria/include/options, paging, etc.),
- whether restricting StructureUnionize queries to graph\_id=1 is the right convention for adult CCF work, or whether there is a more idiomatic way to handle multi-ontology datasets.

If there are existing efforts I should build on instead (or if there are reasons this approach is not advisable), I would also be very happy to hear that.

Thank you for your time and any feedback.

Matthias
