ChatSpatial

MCP server for spatial transcriptomics analysis with 60+ integrated methods

ChatSpatial

MCP server for spatial transcriptomics analysis via natural language

PyPI Python 3.10+ License: MIT Docs


❌ Before

import scanpy as sc
import squidpy as sq
adata = sc.read_h5ad("data.h5ad")
sc.pp.filter_cells(adata, min_genes=200)
sc.pp.normalize_total(adata)
sc.pp.log1p(adata)
sc.pp.highly_variable_genes(adata)
sc.tl.pca(adata)
sc.pp.neighbors(adata)
# ... 40 more lines

✅ After

"Load my Visium data and identify
 spatial domains"
✓ Loaded 3,456 spots, 18,078 genes
✓ Identified 7 spatial domains
✓ Generated visualization

Note: This is a demo version. If you encounter any issues or have feedback, please open an issue or contact us anytime. Your feedback helps us improve!


Install

pip install chatspatial

Configure

Claude Desktop — add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "chatspatial": {
      "command": "python",
      "args": ["-m", "chatspatial", "server"]
    }
  }
}

Claude Code:

claude mcp add chatspatial python -- -m chatspatial server

Restart Claude after configuration.


Use

Open Claude and chat:

Load /path/to/spatial_data.h5ad and show me the tissue structure
Identify spatial domains using SpaGCN
Find spatially variable genes and create a heatmap

Capabilities

CategoryMethods
Spatial DomainsSpaGCN, STAGATE, GraphST, Leiden, Louvain
DeconvolutionFlashDeconv, Cell2location, RCTD, DestVI, Stereoscope, SPOTlight, Tangram, CARD
Cell CommunicationLIANA+, CellPhoneDB, CellChat, FastCCC
Cell Type AnnotationTangram, scANVI, CellAssign, mLLMCelltype, scType, SingleR
Trajectory & VelocityCellRank, Palantir, DPT, scVelo, VeloVI
Spatial StatisticsMoran's I, Local Moran, Geary's C, Getis-Ord Gi*, Ripley's K, Neighborhood Enrichment
EnrichmentGSEA, ORA, Enrichr, ssGSEA, Spatial EnrichMap
Spatial GenesSpatialDE, SPARK-X
IntegrationHarmony, BBKNN, Scanorama, scVI
OtherCNV Analysis (inferCNVpy, Numbat), Spatial Registration (PASTE, STalign)

60+ methods across 15 categories. Supports 10x Visium, Xenium, Slide-seq v2, MERFISH, seqFISH.


Docs


Citation

@software{chatspatial2025,
  title={ChatSpatial: Agentic Workflow for Spatial Transcriptomics},
  author={Chen Yang and Xianyang Zhang and Jun Chen},
  year={2025},
  url={https://github.com/cafferychen777/ChatSpatial}
}

MIT License · GitHub · Issues

Related Servers