Query OpenNeuro Neuroimaging Data via GraphQL
Query and explore OpenNeuro neuroimaging datasets via GraphQL directly from Claude Desktop or any MCP client.
1.0.0Add to Favorites
Why it matters
Access and query the OpenNeuro neuroimaging dataset API using GraphQL. Retrieve MRI, MEG, EEG, iEEG, and ECoG data for research and analysis.
Outcomes
What it gets done
Execute GraphQL queries against the OpenNeuro API.
Discover available fields and operations through schema introspection.
Query neuroimaging datasets, snapshots, and file listings.
Access public OpenNeuro data without requiring authentication.
Source
Get it from source
Spark does not host a copy of it.
Open sourceReports
Agent outcome reports
No reports yet
Capabilities
Tools your agent gets
Execute GraphQL queries against the OpenNeuro API to access neuroimaging datasets
Overview
OpenNeuro MCP Server
OpenNeuro MCP Server wraps the OpenNeuro GraphQL API in a single MCP tool, openneuro_graphql, so an AI agent can list, search, and inspect public neuroimaging datasets. It supports arbitrary GraphQL queries with variables, covering dataset listing, lookup by ID, modality search, and summary metadata. Use it when you need to browse or query OpenNeuro's neuroimaging dataset catalog from an AI agent. It does not download or process the imaging files themselves.
What it does
OpenNeuro MCP Server exposes the OpenNeuro GraphQL API as a Model Context Protocol tool, letting an AI agent query and inspect neuroimaging datasets hosted on OpenNeuro directly from a conversation. It wraps the API in a single flexible tool, openneuro_graphql, that accepts any GraphQL query and variables, so an agent can list datasets, fetch a specific dataset by its OpenNeuro ID, filter datasets by modality, or pull a dataset's metadata and summary statistics without leaving the chat.
When to use - and when NOT to
Use it when you need to look up OpenNeuro datasets programmatically - browsing what's available, checking a dataset's subjects, sessions, tasks, modalities and file counts, or building a query against a known dataset ID such as ds000001. It is not a substitute for downloading or processing the imaging data itself: the server only talks to OpenNeuro's GraphQL endpoint and returns metadata, it does not fetch or manipulate the underlying neuroimaging files.
Capabilities
The server ships one general-purpose tool, openneuro_graphql, which runs arbitrary GraphQL queries (with variables) against the OpenNeuro API. Documented example queries cover: listing the first N datasets with id, name and created date; fetching a single dataset's public status, creation date, metadata (including modalities) and latest snapshot tag; searching datasets by modality such as MRI; and pulling a dataset's latest snapshot summary - subjects, sessions, tasks, modalities, total files and size. Because the tool is a thin GraphQL passthrough, any query the OpenNeuro API supports can be issued through it, not just the documented examples. A parameterized query pattern is also shown, using a variables object alongside a named GraphQL query such as GetDataset($id: ID!), for queries that need dynamic input.
How to install
The project runs as a local Python MCP server.
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Run it with python mcp_openneuro.py, then point an MCP client at that script - for Claude Desktop, add it to claude_desktop_config.json with the venv's Python interpreter as the command and the script path as the argument. Several test scripts are included (test_query.py, test_dataset_query.py, test_search_query.py, test_datasets_with_modality.py) to verify the connection and demonstrate each query pattern before wiring it into a client. Extending the server means editing mcp_openneuro.py and adding new methods decorated with @mcp.tool().
Who it's for
Researchers and developers working with open neuroimaging data who want an AI agent to browse or query OpenNeuro datasets conversationally, instead of hand-writing GraphQL calls or clicking through the OpenNeuro web interface. It is released under the MIT License with an added academic citation requirement: commercial and non-academic use follows standard MIT terms, while any academic publication built on results from this software must cite the project per its CITATION.md.
Source README
OpenNeuro MCP Server
Overview
This server provides MCP tools to interact with the OpenNeuro GraphQL API, allowing AI agents to easily access and manipulate neuroimaging datasets on OpenNeuro.
Installation
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Usage
Run the server:
python mcp_openneuro.py
Claude Desktop Configuration
To use this MCP server with Claude Desktop, add the following to your claude_desktop_config.json file (located at ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"openneuro": {
"command": "/path/to/your/venv/bin/python",
"args": [
"/path/to/your/openneuro-mcp-server/mcp_openneuro.py"
],
"options": {
"cwd": "/path/to/your/openneuro-mcp-server"
}
}
}
}
Replace /path/to/your/ with the actual path to your installation.
Available Tools
openneuro_graphql
Execute any GraphQL query against the OpenNeuro API.
Example usage in your AI agent's code:
result = await mcp.invoke("openneuro_graphql", {
"query": "{ datasets(first: 5) { edges { node { id name } } } }"
})
Example Queries
Listing Datasets
{
datasets(first: 10) {
edges {
node {
id
name
created
}
}
}
}
Getting a Specific Dataset
{
dataset(id: "ds000001") {
id
name
public
created
metadata {
modalities
}
latestSnapshot {
tag
created
}
}
}
Search by Modality
{
datasets(first: 5, modality: "MRI") {
edges {
node {
id
name
created
}
}
}
}
Dataset Metadata and Summary
{
dataset(id: "ds000001") {
id
name
metadata {
modalities
dataProcessed
species
}
latestSnapshot {
summary {
subjects
sessions
tasks
modalities
totalFiles
size
}
}
}
}
Using Variables
Some queries require variables. Here's an example:
query = """
query GetDataset($id: ID!) {
dataset(id: $id) {
id
name
public
}
}
"""
variables = {
"id": "ds000001"
}
result = await mcp.invoke("openneuro_graphql", {
"query": query,
"variables": variables
})
Testing
Several test scripts are included to demonstrate usage:
test_query.py- Basic listing of datasetstest_dataset_query.py- Detailed information about a specific datasettest_search_query.py- Search functionality exampletest_datasets_with_modality.py- Filter datasets by modality
Run any test script:
python test_query.py
Development
To add more tools or functionality, modify the mcp_openneuro.py file and add new methods with the @mcp.tool() decorator.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.