ChatSpatial

io.github.cafferychen777Published by GitHub account cafferychen777v1.6.0Updated Oct 24, 2026

Schema-enforced spatial transcriptomics analysis with 20 tools and 67 methods via MCP

VerifiedSTDIODesktop onlyData & AnalyticsAI & ML

Overview

AI-generated overview

Local MCP server that lets an assistant run schema-validated spatial transcriptomics analyses, orchestrating 67 methods through 20 tools.

What you can do
  • Load and preprocess spatial data (Scanpy I/O, QC, normalization, HVG, PCA, neighbors)
  • Plot spatial coordinates, embeddings and gene expression overlays
  • Identify spatial domains and deconvolve cell types, annotate cell types, run differential expression
  • Run cell-cell communication, trajectory, RNA velocity, CNV and multi-sample integration methods
  • Compute spatial statistics, spatially variable genes, enrichment and spatial registration
When to use it
Useful when you work with spatial transcriptomics datasets (Visium, Xenium, Slide-seq, MERFISH, seqFISH) and want an assistant to run reproducible, parameter-driven analysis workflows instead of writing ad-hoc scripts.
Requirements
Runs locally over stdio as a PyPI package launched with uvx; uv must be installed. The standard install covers core methods; an optional full extra adds more Python method families, and R-based backends need separate setup. A Docker image is also offered. No authentication or environment variables are declared.
Before you install
Analyses read data files from paths you give it and write outputs such as plots and results; point it only at directories you intend to use. Optional method families and R bridges have extra system or platform requirements, so check the installation guide before enabling them. Large datasets and heavy methods can be resource-intensive.

Installation

In SourceWeft

  1. Open ChatSpatial in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

ChatSpatial

MCP server for spatial transcriptomics analysis via natural language

[Paper] [MLGenX @ ICLR 2026] [ENAR 2026] [IBC 2026] [CI] [PyPI] [Python 3.11-3.14] [License: MIT] [Docs] [Docker]

[ChatSpatial Overview]

ChatSpatial replaces ad-hoc LLM code generation with schema-enforced orchestration. Instead of generating arbitrary scripts, the LLM selects tools and parameters from a curated registry, making spatial transcriptomics workflows more reproducible across sessions and clients.

ChatSpatial exposes 20 schema-validated MCP tools that orchestrate 67 spatial transcriptomics methods across 13 analytical categories. The tools are the stable natural-language interface; the methods are the analysis backends selected through tool parameters.

The server implements MCP 2026-07-28 through the official Python SDK v2 and continues to serve 2025-11-25 clients through SDK-managed protocol negotiation. STDIO remains the secure local default; Streamable HTTP is available for explicitly configured HTTP deployments.


Start Here

Install uv once, then register ChatSpatial without creating or managing a Python environment:

Codex:

bash
codex mcp add chatspatial -- uvx --from chatspatial chatspatial server

Claude Code:

bash
claude mcp add --scope user chatspatial -- \  uvx --from chatspatial chatspatial server

uvx creates an isolated environment on first launch and reuses its cache on later launches. Restart the MCP client after adding the server.

The command above installs the standard runtime. To make all 15 composable Python method families available in the same isolated MCP environment, use:

bash
uvx --from 'chatspatial[full]' chatspatial server

full includes CellRank, FastCCC, the maintained spatial-domain and registration backends, annotation, enrichment, and the other portable Python families. R bridges, AESTETIK, and rctd-py remain separate because they have system, platform, or large-runtime requirements. See the installation guide before enabling those families.

Then:

  1. Run your first analysis — Quick Start
  2. Choose optional method families or a persistent environment — Installation Guide
  3. Configure another MCP client — Configuration Guide
  4. Reproduce the manuscript key results without an LLM — Reproduction image

Docker quick start:

bash
docker pull cafferyyang777/chatspatial:latest

Minimal example prompt:

text
Load /absolute/path/to/spatial_data.h5ad and plot gene expression at the spatial coordinates

The Quick Start provides a downloadable sample and a Leiden workflow that runs with the standard installation. Its sample has spatial coordinates but no H&E image. SpaGCN requires the optional spatial-domains extra.

If you use Docker, mount host data to /data and prompt with the container path, for example /data/spatial_data.h5ad.

ChatSpatial works with any MCP-compatible client — Claude Code, Claude Desktop, Codex, OpenCode, and other MCP-capable tools.


Capabilities

Current coverage includes 67 methods across 13 analytical categories, exposed through 20 MCP tools. Supports 10x Visium, Xenium, Slide-seq v2, MERFISH, seqFISH.

CategoryExample methods
Data Loading & PreprocessingScanpy I/O, QC, Normalization, HVG, PCA, Neighbors
VisualizationSpatial plots, Embedding plots, Gene expression overlays
Spatial Domain IdentificationSpaGCN, STAGATE, GraphST, BANKSY, AESTETIK, Leiden, Louvain
DeconvolutionFlashDeconv, Cell2location, RCTD (spacexr or rctd-py), DestVI, Stereoscope, SPOTlight, Tangram, CARD
Cell-Cell CommunicationLIANA+, CellPhoneDB, CellChat (cellchat_r), FastCCC
Cell Type AnnotationTangram, scANVI, CellAssign, mLLMCelltype, scType, SingleR, marker-score and threshold rules
Differential ExpressionWilcoxon, t-test, Logistic Regression, pyDESeq2
Trajectory InferenceCellRank, Palantir, DPT
RNA VelocityscVelo, VeloVI
Spatial StatisticsMoran's I, Local Moran, Geary's C, Getis-Ord Gi*, Ripley's K, Co-occurrence, Neighborhood Enrichment, Centrality Scores, Local Join Count, Network Properties
Enrichment AnalysisGSEA, ORA, Enrichr, ssGSEA, Spatial EnrichMap
Spatially Variable GenesSpatialDE, SPARK-X, FlashS
Multi-sample IntegrationHarmony, BBKNN, Scanorama, scVI
CNV AnalysisInferCNVPy, Numbat
Spatial RegistrationPASTE, STalign

Documentation

GuideUse this when...
InstallationYou need optional methods or a persistent Python environment
DockerYou want a reproducible container runtime or local dependency resolution fails
ConfigurationYou need exact MCP client syntax or the runtime path model
Quick StartChatSpatial is installed and you want the first successful analysis
ConceptsYou need to choose an analysis strategy from a biological question
ExamplesYou want copy-pasteable natural-language workflow prompts
Methods ReferenceYou need canonical tool names, method names, parameters, and defaults
TroubleshootingSetup, data loading, or analysis behavior is not working
Full DocsYou want the complete documentation site

Reproducibility

Each release publishes a reproduction image under the -repro tag. It re-executes the DLPFC spatial-domain and OSCC CARD deconvolution tool calls recorded during the manuscript experiments, without calling any LLM, and compares the results with the reported values:

bash
docker run --rm -v "$PWD/out:/outputs" \  cafferyyang777/chatspatial@sha256:ac3ba1ed8235c3d53ca72005d8ad2556cac007f5ddb932ae3e1d1241fa2cf9d8 \  chatspatial-reproduce

reproducibility/ contains the image definition and describes what it checks. The experiment and analysis scripts for the manuscript are in ChatSpatial-Reproducibility.


Citation

If you use ChatSpatial in your research, please cite:

bibtex
@article{Yang2026.02.26.708361,  author = {Yang, Chen and Zhang, Xianyang and Chen, Jun},  title = {ChatSpatial: Schema-Enforced Agentic Orchestration for Reproducible and Cross-Platform Spatial Transcriptomics},  elocation-id = {2026.02.26.708361},  year = {2026},  doi = {10.64898/2026.02.26.708361},  publisher = {Cold Spring Harbor Laboratory},  URL = {https://www.biorxiv.org/content/early/2026/03/01/2026.02.26.708361},  journal = {bioRxiv}}

ChatSpatial orchestrates many excellent third-party methods. Please also cite the original tools your analysis used.


Contributing

Documentation improvements, bug reports, and new analysis methods are all welcome. See CONTRIBUTING.md.

MIT License · GitHub · Issues

Source: README.md at commit 30eb958

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

6
  1. v1.6.0LatestOct 20, 2026
  2. v1.5.10Oct 12, 2026
  3. v1.5.9Oct 10, 2026
  4. v1.5.7Oct 9, 2026
  5. v1.5.5Oct 9, 2026
  6. v1.5.3Sep 16, 2026

Score

50% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts