Sponsored by Deepsite.site

Chatspatial

Created By
cafferychen777a month ago
Natural language-driven spatial transcriptomics analysis via MCP. Integrates 60+ analytical methods across 15 categories including preprocessing, visualization, spatial statistics, cell communication, deconvolution, and trajectory analysis.
Content
ChatSpatial Logo

ChatSpatial

Python 3.10+ MCP Protocol License: MIT Docs

Agentic Workflow Orchestration for Spatial Transcriptomics Analysis

Eliminate the implementation tax. Focus on biological insight.

ChatSpatial is an agentic workflow orchestration platform that integrates 60 state-of-the-art methods from fragmented Python and R ecosystems into a unified conversational interface. Built on the Model Context Protocol (MCP), it enables human-steered discovery through natural language in Claude Desktop or Claude Code, eliminating the need for manual data conversion and complex programming.

🎯 Example: Analyze spatial transcriptomics data through conversation with Claude

👤 "Load my 10x Visium dataset and identify spatial domains"
🤖 ✅ Loaded 3,456 spots, 18,078 genes
    ✅ Identified 7 spatial domains using SpaGCN
    ✅ Generated spatial domain visualization

👤 "Find marker genes for domain 3 and create a heatmap"
🤖 ✅ Found 23 significant markers (adj. p < 0.05)
    ✅ Top markers: GFAP, S100B, AQP4 (astrocyte signature)
    ✅ Generated expression heatmap

👤 = You chatting with Claude | 🤖 = ChatSpatial MCP executing analysis


🚀 Why Researchers Choose ChatSpatial

Before: Traditional Analysis

# 50+ lines of code for basic analysis
import scanpy as sc
import squidpy as sq
import pandas as pd
import matplotlib.pyplot as plt

adata = sc.read_h5ad("data.h5ad")
sc.pp.filter_cells(adata, min_genes=200)
sc.pp.filter_genes(adata, min_cells=3)
# ... 40+ more lines ...

❌ Hours of coding
❌ Complex syntax
❌ Error-prone
❌ Steep learning curve

After: ChatSpatial

Chat with Claude using natural language:

"Analyze my Visium data and find
 spatially variable genes"

5 seconds to resultsPlain English in Claude chatZero programming requiredPublication-ready output60 methods via MCP


⚡ Quick Start (2 Minutes)

1. Create Virtual Environment & Install

# Clone and enter directory
git clone https://github.com/cafferychen777/ChatSpatial.git
cd chatspatial

# Create virtual environment (strongly recommended)
# For macOS with Homebrew Python:
/opt/homebrew/bin/python3.10 -m venv chatspatial_env  # macOS Homebrew
# For other systems:
# python3 -m venv chatspatial_env  # Linux/other systems
source chatspatial_env/bin/activate  # macOS/Linux
# chatspatial_env\Scripts\activate  # Windows

# Verify Python version and install
python --version  # Should be 3.10+
pip install --upgrade pip
pip install -e ".[full]"  # Recommended: All features included

💡 Windows Users: SingleR and PETSc acceleration are not available on Windows due to C++ compilation limitations. Use alternative cell type annotation methods (Tangram, scANVI, CellAssign). All R-based methods (RCTD, SPOTlight, Numbat) work on Windows. See INSTALLATION.md for details.

2. Configure Your Client

Option A: Claude Desktop (GUI Application)

💡 New to Claude Desktop? Download Claude Desktop from Anthropic's official site (available for Mac & Windows)

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "chatspatial": {
      "command": "/path/to/chatspatial_env/bin/python",
      "args": ["-m", "chatspatial", "server"]
    }
  }
}
Option B: Claude Code (Terminal/IDE)

Step 1: Install Claude Code CLI

npm install -g @anthropic-ai/claude-code

Step 2: Find Your Virtual Environment Path

# First, activate your virtual environment
source chatspatial_env/bin/activate

# Then get the exact Python path (copy this output!)
which python

Example output: /Users/yourname/Research/chatspatial_env/bin/python

Step 3: Add ChatSpatial MCP Server

# Replace <PYTHON_PATH_FROM_STEP_2> with the actual path from step 2
claude mcp add chatspatial <PYTHON_PATH_FROM_STEP_2> -- -m chatspatial server

# Example with real path:
# claude mcp add chatspatial /Users/yourname/Research/chatspatial_env/bin/python -- -m chatspatial server

Step 4: Verify Installation

claude mcp list

Step 5: Restart Claude Code ⚠️

# IMPORTANT: Exit and restart Claude Code for changes to take effect
/quit

# Then re-enter Claude Code
claude

💡 Note: After adding the MCP server, you MUST restart Claude Code using /quit and then re-enter with claude for ChatSpatial to appear in the available tools.

3. Download Sample Data & Start Analyzing

🎯 Quick Test (1 minute):

  1. Download sample datasets: Go to ChatSpatial Releases
  2. Download these files:
    • card_reference_filtered.h5ad (36MB - pancreatic reference with 9 cell types)
    • card_spatial.h5ad (7.7MB - spatial data with clear tissue domains)

3. Open Claude Desktop or Claude Code and chat with ChatSpatial:

💡 Important: Tell Claude to use ChatSpatial MCP for your spatial analysis (e.g., "Use ChatSpatial MCP for all my spatial transcriptomics analysis"). This ensures Claude calls the MCP tools instead of writing scripts.

Simply type this natural language request in your Claude chat:

Load /Users/yourname/Downloads/card_reference_filtered.h5ad and /Users/yourname/Downloads/card_spatial.h5ad, then show me the tissue structure

💡 How it works: ChatSpatial MCP server interprets your natural language and automatically calls the appropriate analysis tools. No coding required!

⚠️ IMPORTANT: Use absolute paths when loading data (e.g., /Users/yourname/Downloads/card_reference_filtered.h5ad)

🎯 That's it! ChatSpatial will load your data and create a beautiful spatial visualization - all through natural language conversation.

📚 Detailed Setup Guides: Claude Desktop | Claude Code


🧬 What You Can Do

💬 All examples below are natural language commands you type in Claude chat with ChatSpatial MCP

📊 Try These Examples (After Loading Sample Data)

Chat with Claude using these natural language requests:

Identify spatial domains using SpaGCN

Deconvolve the spatial data using the reference with Cell2location

Analyze cell communication between spatial regions

Find spatially variable genes and create heatmaps

What happens: ChatSpatial MCP automatically selects the right tools, runs the analysis, and returns publication-ready visualizations.

🔍 Spatial Analysis - Just Ask in Plain English

Your QuestionWhat ChatSpatial Does
"Find spatial domains"Runs SpaGCN/STAGATE/Leiden clustering
"Detect hotspots"Applies Getis-Ord Gi* spatial statistics
"Map cell territories"Performs spatial neighborhood analysis

🧮 Advanced Methods - No Coding Knowledge Required

Your RequestMethods Used
"Deconvolve this spatial data"Cell2location + scvi-tools
"Analyze cell communication"LIANA+ + CellPhoneDB
"Find developmental trajectories"CellRank + Palantir
"Run pathway enrichment"GSEA + spatial smoothing

🎨 Instant Visualizations

  • Spatial plots with tissue overlays
  • Interactive heatmaps for gene expression
  • Communication networks between cell types
  • Trajectory flow maps for development
  • Domain boundary visualizations

🎯 Choose Your Path

🚀 Researchers

Quick start?

pip install -e .

✅ 80% of features
✅ Most common methods
✅ 6-minute install

Research Quick Start

🧠 Power Users

Want everything?

pip install -e ".[full]"

✅ 100% of features
✅ All 16+ methods
✅ Deep learning included

Advanced Setup Guide

👩‍💻 Developers

Want to contribute?

pip install -e ".[dev]"

✅ Development tools
✅ Testing framework
✅ Documentation

Contributor Guide


🛠️ Technical Capabilities

📊 Data Formats Supported
  • 10x Genomics: Visium, Xenium
  • Spatial Technologies: Slide-seq v2
  • Multiplexed Imaging: MERFISH, seqFISH
  • Standard Formats: H5AD, H5, MTX, CSV
🔬 Analysis Methods (12 Categories, 75+ Methods)
CategoryMethods
Cell Type AnnotationTangram, scANVI, CellAssign, mLLMCellType, sc-type, SingleR
Spatial DomainsSpaGCN, STAGATE, Leiden clustering
Cell CommunicationLIANA+, CellPhoneDB, CellChat (via LIANA)
DeconvolutionCell2location, DestVI, RCTD, Tangram, Stereoscope, SPOTlight
CNV Analysisinfercnvpy, Numbat (haplotype-aware CNV analysis)
Spatial Variable GenesSpatialDE, SPARK-X
Trajectory & VelocityCellRank, Palantir, DPT, scVelo, VeloVI
Sample IntegrationHarmony, BBKNN, Scanorama, scVI
Differential ExpressionWilcoxon, t-test, Logistic Regression (scanpy methods)
Gene Set EnrichmentGSEA, ORA, ssGSEA, Enrichr, Spatial EnrichMap
Spatial StatisticsMoran's I, Local Moran's I (LISA), Geary's C, Getis-Ord Gi*, Neighborhood Enrichment, Co-occurrence, Ripley's K/L, Bivariate Moran's I, Join Count, Network Properties, Spatial Centrality
Spatial RegistrationPASTE, STalign
⚙️ System Requirements
  • Python: 3.10+ (required for MCP)
  • Memory: 8GB+ RAM (16GB+ for large datasets)
  • Storage: 5GB+ for dependencies
  • OS: Linux, macOS, Windows (WSL recommended)
  • GPU: Optional (speeds up deep learning methods)

🤝 Community & Support


📄 License & Citation

MIT License - Free for academic and commercial use.

If ChatSpatial helps your research, please cite:

@software{chatspatial2025,
  title={ChatSpatial: An Agentic Framework for Reproducible Cross-Platform Spatial Transcriptomics Analysis},
  author={Chen Yang and Xianyang Zhang and Jun Chen},
  year={2025},
  url={https://github.com/cafferychen777/ChatSpatial},
  note={Manuscript in preparation}
}

🙏 Built With

ChatSpatial stands on the shoulders of giants: ScanpySquidpyscvi-toolsLIANAAnthropic MCP


Made with ❤️ for the spatial transcriptomics community

Star us on GitHub if this project helps you!

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
ChatWiseThe second fastest AI chatbot™
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Serper MCP ServerA Serper MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
CursorThe AI Code Editor
Tavily Mcp
Amap Maps高德地图官方 MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright McpPlaywright MCP server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.