Generated from aind-library-template
Project description
AIND Data MCP Server
An MCP (Model Context Protocol) server that provides access to AIND (Allen Institute for Neural Dynamics) metadata and data assets through a comprehensive set of tools and resources. This server targets the V2 aind-data-schema format.
Features
This MCP server provides the following tools:
Data Retrieval & Querying
get_records— Query MongoDB collections using filters and projectionsaggregation_retrieval— Execute complex MongoDB aggregation pipelinescount_records— Count documents matching a filterflatten_records— Retrieve and flatten records into dot-notation for easier inspectionget_project_names— List all project names in the databaseget_summary— Generate an AI-powered summary for a specific data asset
Schema Navigation
get_top_level_nodes— Explore the top-level fields of the V2 metadata schemaget_additional_schema_help— Query-writing guidance for V2 aggregationsget_modality_types— List all available data modality names and abbreviations
Schema Examples (one tool per document type)
get_acquisition_example,get_data_description_example,get_instrument_example,get_procedures_example,get_subject_example,get_processing_example,get_model_example,get_quality_control_example
NWB File Access
identify_nwb_contents_in_code_ocean— Load an NWB file from the/datadirectory in a Code Ocean capsuleidentify_nwb_contents_with_s3_link— Load an NWB file from an S3 path
Resources (accessible via the MCP protocol)
resource://aind_api— Context and usage patterns for the AIND data access APIresource://load_nwbfile— Reference script for loading NWB files
Installation
Install uv if you haven't already — see uv installation docs.
Install the MCP server using uv:
uv tool install aind-data-mcp
Or using pip:
pip install aind-data-mcp
Configuration
For Cline (VSCode Extension)
In order to ensure that the MCP server runs in your preferred client, you will have to download the aind-data-mcp package to your console. If space is an issue, please set UV_CACHE_DIR and UV_TOOL_DIR to locations that have capacity before proceeding with the next step.
- Simpler version of install
Run
uv tool install aind-data-mcpon your terminal and proceed below to configuring your MCP clients. - If the above step didn't work:
Create virtual environment with python 3.11 in IDE
# Instructions for Conda
conda create -n <my_env> python=3.11
conda activate <my_env>
# Instructions for virtual environment
py -3.11 -m venv .venv
# Windows startup
.venv\Scripts\Activate.ps1
# Mac/ Linux startup
source .venv/bin/activate
Run the following commands in your IDE terminal.
pip install uv
uvx aind-data-mcp
If all goes well, and you see the following notice - Starting MCP server 'aind_data_mcp' with transport 'stdio' -, you should be good for the set up in your client of choice!
Cursor IDE
-
Install the MCP server:
uv tool install aind-data-mcp
-
Create the MCP configuration file:
mkdir -p ~/.cursor
-
Create
~/.cursor/mcp.jsonwith the following content:{ "mcpServers": { "aind-data-access": { "command": "aind-data-mcp", "args": [], "env": {} } } }
-
Important: Replace
aind-data-mcpwith the full path if needed:which aind-data-mcpUse the full path (e.g.,
/Users/username/.local/bin/aind-data-mcp) in thecommandfield. -
Restart Cursor completely (Cmd+Q then reopen)
Note: Cursor uses a different MCP configuration system than VSCode. The configuration must be in ~/.cursor/mcp.json, not in the main settings.json file.
Instructions for use in MCP clients
JSON Config files to add MCP servers in clients should be structured like this
{
"mcpServers": {
}
}
Insert the following lines into the mcpServers dictionary
"aind_data_mcp": {
"disabled": false,
"timeout": 300,
"type": "stdio",
"command": "aind-data-mcp"
}
Note that after configuring the JSON files, it will take a few minutes for the server to populate in the client.
Claude Desktop App
- Click the three lines at the top left of the screen.
- File > Settings > Developer > Edit config
Cline in VSCode
- Ensure that Cline is downloaded to VSCode
- Click the three stacked rectangles at the top right of the Cline window
- Installed > Configure MCP Servers
- Close and reopen VSCode
Github Copilot in VSCode
- Command palette (ctrl shift p)
- Search for MCP: Add server
- Select
Manual Install/stdio - When prompted for a command, input
uvx aind-data-mcp - Name your server
- Close and reopen VSCode
- In Copilot chat -> Select agent mode -> Click the three stacked rectangles to configure tools
- API context and NWB loading patterns are served automatically as MCP resources (
resource://aind_apiandresource://load_nwbfile) — no manual file setup required
For use in Code Ocean
- Refer to the code ocean MCP server for additional support
Development
To develop the code, run
uv sync --group dev
To run tests:
uv run coverage run -m unittest discover && uv run coverage report
To run linting:
uv run flake8 . && uv run interrogate --verbose .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aind_data_mcp-0.1.2.tar.gz.
File metadata
- Download URL: aind_data_mcp-0.1.2.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e734de9bc67594169c916dd4a4c45e23d9b303893bd28994aff7e06c7237683d
|
|
| MD5 |
d574d92d3399943068a168e2967b637f
|
|
| BLAKE2b-256 |
07d10861130ba83c2e32024d073b96392a8be8a4154149beec1580d1b1c14ce8
|
File details
Details for the file aind_data_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: aind_data_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0df771cd465d9f65b3ff60297e90634c4653df17f5e91c488ecf41d49cad436
|
|
| MD5 |
7fa0a7ae28f4e938a772ac23fefdce1f
|
|
| BLAKE2b-256 |
8ce659bcdc5f45af30a78c28906bffecd0380262185dcf9a134a0f8e3f6dc53e
|