AIND数据MCP服务器

AIND Data MCP Server 是一个基于模型上下文协议(MCP)的数据访问服务,提供对艾伦神经动力学研究所(AIND)V2 元数据与数据资产的检索、聚合查询、Schema 导航及 NWB 文件读取能力,适用于 AI 助手和开发者从 MongoDB 中查询神经科学数据资产。

  • by AllenNeuralDynamics
  • Python
  • 混合部署
  • 更新于
在 GitHub 查看 AllenNeuralDynamics/aind-data-mcp

使用说明

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.

Installation

{
    "servers": {
        "aind-data-mcp": {
            "url": "https://metadata-portal.allenneuraldynamics.org/mcp/",
            "type": "http"
        }
    },
    "inputs": []
}

Features

This MCP server provides the following tools:

Data Retrieval & Querying

  • get_records — Query MongoDB collections using filters and exact leaf-path projections; optionally return a reproducible result marker
  • aggregation_retrieval — Execute complex MongoDB aggregation pipelines, including logical aliases for legacy field paths
  • count_records — Count documents matching a filter
  • flatten_records — Retrieve and flatten records into dot-notation for easier inspection
  • get_project_names — List all project names in the database
  • get_summary — Generate an AI-powered summary for a specific data asset

Schema Navigation

  • get_schema_context — Explore the complete typed schema, compact query paths, and opt-in small examples
  • get_modality_types — List all available data modality names and abbreviations

The MCP initialize response includes a ready tool manifest. Use get_schema_context(node="subject", detail="example") only when a compact synthetic example is needed; ordinary path discovery does not load bulky schema examples.

Call get_schema_context() for complete root fields, then request a dot-separated branch such as get_schema_context(path="Acquisition.data_streams", max_depth=1) when nested model fields are needed. Use detail="paths" for compact query paths or detail="example" for a synthetic example.

NWB File Access

  • identify_nwb_contents_in_code_ocean — Load an NWB file from the /data directory in a Code Ocean capsule
  • identify_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 API
  • resource://load_nwbfile — Reference script for loading NWB files

Development

To develop the code, run

uv sync --extra 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 .

To refresh the bundled schema snapshot after updating the dev dependency:

uv run python scripts/generate_schema_tree_snapshot.py