Skip to main content

MCP server for querying Neo4j Knowledge Graphs with custom tools for quering GeneLab

Project description

MCP GeneLab Server

License: BSD-3-Clause Python 3.10+ Model Context Protocol PyPI version

A Model Context Protocol (MCP) server that converts natural language queries into Cypher queries and executes them against the configured Neo4j endpoints. Customized tools provide seamless access to the NASA GeneLab Knowledge Graph, enabling AI-assisted analysis of spaceflight experiments and their biological effects. This server allows researchers to query differential gene expression and DNA methylation data from NASA's space biology experiments through natural language interactions with AI assistants like Claude.

The GeneLab Knowledge Graph with data from NASA's GeneLab Data Repository, part of the NASA Open Science Data Repository (OSDR), can be integrated with biomedical knowledge from the SPOKE (Scalable Precision Medicine Open Knowledge Engine) knowledge graph. This integration connects spaceflight experimental results with a comprehensive biological context, including genes, proteins, anatomical structures, pathways, and diseases.

This server is part of the NSF-funded Proto-OKN Project (Prototype Open Knowledge Network). It's an extension of the Neo4j Cypher MCP server.

Features

  • Natural Language Querying: Ask questions in plain English - no need to write complex graph queries
  • NASA GeneLab Queries: Ask questions about spaceflight experiments in the NASA GeneLab knowledge graph
  • Differential Gene Expression Analysis: Find genes that are upregulated or downregulated in spaceflight conditions compared to ground controls
  • DNA Methylation Data: Access epigenetic changes observed in spaceflight experiments
  • Multi-Organism Support: Query data across multiple model organisms including mice, rats, and other species used in space research
  • Tissue-Specific Analysis: Filter results by specific organs, tissues, or cell types
  • Biomedical Context Integration: Connect spaceflight gene expression changes to pathways, diseases, and other biological knowledge from SPOKE
  • Federated Queries: Combine data from GeneLab with other Neo4j knowledge graphs for comprehensive biomedical analysis
  • Multiple Access Methods: Use through Claude Desktop, VS Code with GitHub Copilot, or programmatically via the MCP protocol
  • Pre-configured Endpoints: Ready-to-use access to both local and remote Neo4j databases containing the GeneLab Knowledge Graph

Prerequisites

Before installing the MCP server, ensure you have:

  • Operating System: macOS, Linux, or Windows
  • Client Application: One of the following:
    • Claude Desktop with Pro or Max subscription
    • VS Code Insiders with GitHub Copilot subscription
  • Neo4j Knowledge Graphs:
    • For a local installation of the GeneLab KG see setup
    • For remote access to GeneLab and SPOKE KGs request credentials

Installation

Installation instructions for Claude Desktop and VS Code Insiders

Quick Start

Once configured, you can start querying knowledge graphs through natural language prompts in Claude Desktop or VS Code chat interface.

Select and Configure MCP Tools (Claude Desktop)

From the top menu bar:

1. Select: Claude->Settings->Connectors
2. Click: Configure for the MCP endpoints you want to use
3. Select Tool permissions: Always allow

In the prompt dialog box, click the + button:

1. Turn off Web search
2. Toggle MCP services on/off as needed

Tool Selector

Use @kg_name to refer to a specific knowledge graph in chat (for example, @spoke-genelab).

To create a transcript of a chat (see examples below), use the following prompt: Create a chat transcript. The transcript can then be downloaded in .md or .pdf format.

Example Queries

Knowledge Graph Overviews & Class Diagrams

Each link below points to a chat transcript that demonstrates how to generate a knowledge-graph overview and class diagram for a given Neo4j Knowledge Graph.

spoke-genelab

spoke-okn

Node and Relationship Metadata Examples

spoke-genelab: Assay Node Metadata

spoke-genelab: MEASURED_DIFFERENTIAL_EXPRESSION_ASmMG relationship

SPOKE-GeneLab KG Inventory

spoke-genelab Inventory

Differential Expression Analysis with MCP tools

spoke-genelab Study OSD-244


Development

Instructions for local development

Building and Publishing (maintainers only)

Instructions for building, testing, and publishing the mcp-genelab package on PyPI

API Reference

mcp-genelab server API

Troubleshooting

Common Issues

MCP server not appearing in Claude Desktop:

  • Ensure you've completely quit and restarted Claude Desktop (not just closed the window)
  • Check that your JSON configuration is valid (attach your config file to a chat and ask it to fix any errors)
  • Verify that uvx is installed and accessible in your PATH

Connection errors:

  • Verify the Neo4j endpoint URL is correct and accessible
  • Some endpoints may have rate limits or temporary downtime

Performance issues:

  • Complex Cypher queries may take time to execute
  • Consider breaking down complex queries into smaller parts
  • Check the endpoint's documentation for query best practices

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.

Citation

If you use MCP GeneLab in your research, please cite the following works:

@software{rose2025mcp-genelab,
  title={MCP GeneLab Server},
  author={Rose, P.W. and Saravia-Butler, A.M. and Nelson, C.A. and Shi, Y. and Baranzini, S.E.},
  year={2025},
  url={https://github.com/sbl-sdsc/mcp-proto-okn}
}

@software{rose2025spoke-genelab,
  title={NASA SPOKE-GeneLab Knowledge Graph},
  author={Rose, P.W. and Nelson, C.A. and Saravia-Butler, A.M. and Gebre, S.G. and Soman, K. and Grigorev, K.A. and Sanders, L.M. and Costes, S.V. and Baranzini, S.E.},
  year={2025},
  url={https://github.com/BaranziniLab/spoke_genelab}
}

Related Publications

  • Nelson, C.A., Rose, P.W., Soman, K., Sanders, L.M., Gebre, S.G., Costes, S.V., Baranzini, S.E. (2025). "Nasa Genelab-Knowledge Graph Fabric Enables Deep Biomedical Analysis of Multi-Omics Datasets." NASA Technical Reports, 20250000723. Link

  • Sanders, L., Costes, S., Soman, K., Rose, P., Nelson, C., Sawyer, A., Gebre, S., Baranzini, S. (2024). "Biomedical Knowledge Graph Capability for Space Biology Knowledge Gain." 45th COSPAR Scientific Assembly, July 13-21, 2024. Link

Acknowledgments

Funding

This work is supported in part by:

  • National Science Foundation Award #2333819: "Proto-OKN Theme 1: Connecting Biomedical information on Earth and in Space via the SPOKE knowledge graph"

Related Projects


For questions, issues, or contributions, please visit our GitHub repository.

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

mcp_genelab-0.4.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_genelab-0.4.0-py3-none-any.whl (65.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_genelab-0.4.0.tar.gz.

File metadata

  • Download URL: mcp_genelab-0.4.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.3

File hashes

Hashes for mcp_genelab-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0cb77f3cf04cf2ea8ad3f499aaf1d6bc27c0226c18683cf4438eb7760ca35bd5
MD5 20eb04ae18f0df270c499cca5ca60127
BLAKE2b-256 f232e1b012daa683a0f39c1d57ff6b5ba54f76c71845bc04e027e01ff41e678a

See more details on using hashes here.

File details

Details for the file mcp_genelab-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_genelab-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4766e3ccc7bea8548f66b60a99b4be5779d2e2fd3a1fb5e43c7e7c7fa7937e3f
MD5 c076af191edb4b644d8ac9e61088cc8d
BLAKE2b-256 36e3e041687761cc2f9f3fcbf65773f115c20d514c4fe52b7a248cd2e5856deb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page