Get the FREE Ultimate OpenClaw Setup Guide →

ChatSpatial

🧬 Analyze spatial transcriptomics data through natural language conversation. Stop writing code, start having conversations with your data. MCP server for Claude Code and Codex.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio cafferychen777-chatspatial uvx chatspatial

How to use

ChatSpatial is a Python-based MCP server that provides a suite of spatial transcriptomics analysis capabilities accessible via natural language prompts. It exposes a broad set of methods across categories such as Spatial Domains (SpaGCN, STAGATE, GraphST, Leiden, Louvain), Deconvolution (e.g., Cell2location, Tangram, Stereoscope, CARD), Cell Communication (LIANA+, CellPhoneDB, CellChat, FastCCC), Cell Type Annotation (Tangram, scANVI, SingleR, etc.), Trajectory & Velocity (scVelo, Palantir, CellRank), Spatial Statistics, Enrichment, Spatial Genes, and Integration with tools like Harmony and Scanorama. You can issue natural language queries to load data, identify tissue structures, deconvolve spots, annotate cell types, construct spatial gene heatmaps, or run enrichment analyses. Examples confirm you can ask to load a dataset, identify spatial domains, or find spatially variable genes, and the tool supports multiple backends and visualization options through its API and integrated workflows.

How to install

Prerequisites:

  • Python 3.11+ installed on your system
  • a supported environment to install Python packages (virtualenv recommended)

Installation steps:

  1. Install a Python environment manager and Python if not already installed (e.g., Python 3.11+ from python.org).
  2. Create and activate a virtual environment:
    • python3 -m venv venv
    • source venv/bin/activate # Unix/macOS
    • venv\Scripts\activate # Windows
  3. Install ChatSpatial via UV (recommended for handling complex dependencies):
  4. Register the MCP server for use with your MCP client, pointing to the appropriate Python executable and module:
    • claude mcp add chatspatial /path/to/venv/bin/python -- -m chatspatial server

Notes:

  • The readme indicates installation and usage via UV and running the server with the Python module chatspatial.
  • If you prefer direct Python execution outside UV, you can also run the module as a standard Python process using python -m chatspatial server in a virtual environment.

Additional notes

Tips:

  • Ensure your Python environment has access to the required spatial transcriptomics libraries and dependencies (Scanpy, Squidpy, and related tools) as per ChatSpatial documentation.
  • The MCP server supports multiple backends; configure your MCP client to point to the chatspatial MCP server for seamless prompts.
  • If you encounter dependency conflicts, using a clean virtual environment per the installation steps helps isolate issues.
  • When troubleshooting, check the server logs for module import errors or missing data formats (e.g., .h5ad files) and verify that the data loaded matches the expected structure.
  • Environment variables are optional in the provided config; add them under env if your deployment requires API keys or backend configurations.

Related MCP Servers

Sponsor this space

Reach thousands of developers ↗