ChatSpatial
Natural language-driven spatial transcriptomics analysis via MCP. Integrates 60+ methods for preprocessing, visualization, spatial statistics, cell communication, deconvolution, and trajectory analysis.
README
<div align="center">
ChatSpatial
MCP server for spatial transcriptomics analysis via natural language
</div>
<table> <tr> <td width="50%">
❌ 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
</td> <td width="50%">
✅ After
"Load my Visium data and identify
spatial domains"
✓ Loaded 3,456 spots, 18,078 genes
✓ Identified 7 spatial domains
✓ Generated visualization
</td> </tr> </table>
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.
Codex (CLI or IDE extension) — MCP config is shared in ~/.codex/config.toml.
Option A: add via CLI
codex mcp add chatspatial -- python -m chatspatial server
Option B: edit ~/.codex/config.toml
[mcp_servers.chatspatial]
command = "python"
args = ["-m", "chatspatial", "server"]
Virtual environment note: Codex runs whatever command you configure. To pin a venv, point command to that environment’s Python, e.g. command = "/path/to/venv/bin/python", or use the full path in the CLI:
codex mcp add chatspatial -- /path/to/venv/bin/python -m chatspatial server
In the Codex TUI, run /mcp to verify the server is active.
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
| Category | Methods |
|---|---|
| Spatial Domains | SpaGCN, STAGATE, GraphST, Leiden, Louvain |
| Deconvolution | FlashDeconv, Cell2location, RCTD, DestVI, Stereoscope, SPOTlight, Tangram, CARD |
| Cell Communication | LIANA+, CellPhoneDB, CellChat, FastCCC |
| Cell Type Annotation | Tangram, scANVI, CellAssign, mLLMCelltype, scType, SingleR |
| Trajectory & Velocity | CellRank, Palantir, DPT, scVelo, VeloVI |
| Spatial Statistics | Moran's I, Local Moran, Geary's C, Getis-Ord Gi*, Ripley's K, Neighborhood Enrichment |
| Enrichment | GSEA, ORA, Enrichr, ssGSEA, Spatial EnrichMap |
| Spatial Genes | SpatialDE, SPARK-X |
| Integration | Harmony, BBKNN, Scanorama, scVI |
| Other | CNV Analysis (inferCNVpy, Numbat), Spatial Registration (PASTE, STalign) |
60+ methods across 15 categories. Supports 10x Visium, Xenium, Slide-seq v2, MERFISH, seqFISH.
Docs
- Installation Guide — detailed setup for all platforms
- Examples — step-by-step workflows
- Full Documentation — complete reference
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}
}
<div align="center">
</div>
<!-- mcp-name: io.github.cafferychen777/chatspatial -->
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.