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.
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
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
StructureUnionizequeries 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