Skip to content

cafferychen777/ChatSpatial

MCP Data & Storage

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

Python Latest v1.2.10 · 2mo ago Security brief →

Features

  • Schema‑enforced orchestration for reproducible spatial transcriptomics workflows
  • Exposes 20 MCP tools covering 65 spatial‑transcriptomics methods across 15 analysis categories
  • Works with any MCP‑compatible client (Claude Code, Claude Desktop, Codex, OpenCode, etc.)

Recent releases

View all 13 releases →
v0.2.0 Breaking risk
Breaking changes
  • Python 3.10+ required (was 3.8+)
  • MCP tool names updated to action+object pattern
Notable features
  • 16 MCP tools with comprehensive error handling
  • Preferred analysis methods documented
Full changelog

🧬 ChatSpatial MCP Server v0.2.0

Production-ready Model Context Protocol server for spatial transcriptomics analysis

🎯 What's New

📚 Documentation & CI Improvements

  • FIXED: All broken documentation links in README.md
  • ALIGNED: Feature descriptions with actual code implementation
  • UPDATED: Installation guides and dependency configuration
  • ENHANCED: CI workflow with Python 3.10/3.11 testing matrix
  • IMPROVED: Code quality checks and automated testing

🔧 Technical Enhancements

  • RESOLVED: Python version compatibility issues in CI
  • OPTIMIZED: Package configuration and optional dependencies
  • STANDARDIZED: Tool naming conventions (action+object pattern)
  • VALIDATED: All 16 MCP tools with comprehensive error handling

🧬 Spatial Analysis Capabilities

Core Tools (16 MCP Tools):

  • load_data - Multi-format spatial data loading (10x Visium, Slide-seq, MERFISH, etc.)
  • preprocess_data - Quality control and normalization
  • visualize_data - Spatial plots, UMAP, heatmaps with MCP-optimized rendering
  • annotate_cells - Cell type annotation (Marker-based, Tangram, scANVI, CellAssign)
  • find_markers - Differential expression analysis
  • find_spatial_genes - GASTON (preferred), SpatialDE, SPARK methods
  • identify_spatial_domains - SpaGCN (preferred), STAGATE, BANKSY, Leiden/Louvain
  • analyze_cell_communication - LIANA (preferred), CellPhoneDB integration
  • deconvolve_data - Cell2location (preferred), DestVI, RCTD, Stereoscope, Tangram, MRVI
  • integrate_samples - Harmony, batch correction
  • analyze_trajectory_data - Palantir, CellRank, DPT pseudotime
  • analyze_enrichment - GSEA, ORA, Enrichr with spatial context
  • analyze_spatial_data - Unified spatial analysis pipeline
  • get_spatial_analysis_stats - Analysis statistics and metadata
  • download_example_data - Example datasets for testing
  • get_analysis_help - Interactive help and guidance

Preferred Methods (Based on performance and reliability):

  • Spatial Domains: SpaGCN > STAGATE > BANKSY
  • Spatial Variable Genes: GASTON > SpatialDE > SPARK
  • Cell Communication: LIANA > CellPhoneDB
  • Deconvolution: Cell2location > DestVI > RCTD

🚀 Installation

Quick Start

# Full installation (recommended)
pip install -e .[all]

# Or install specific feature sets
pip install -e .[advanced]     # Core spatial analysis methods
pip install -e .[enrichmap]    # EnrichMap spatial enrichment
pip install -e .[experimental] # Experimental features
pip install -e .[dev]          # Development tools

MCP Client Configuration

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "chatspatial": {
      "command": "python3",
      "args": ["-m", "chatspatial"],
      "env": {
        "PYTHONPATH": "/path/to/chatspatial"
      }
    }
  }
}

Cherry Studio (Recommended for longer analyses):

  • Supports configurable timeouts (>4 minutes)
  • Better handling of large spatial datasets
  • Enhanced visualization support

📊 Supported Data Formats

  • 10x Genomics: Visium, Xenium, Chromium
  • Slide-seq: v1, v2
  • MERFISH: Vizgen platform
  • seqFISH+: Spatial sequencing
  • STARmap: 3D spatial transcriptomics
  • Standard formats: H5AD, CSV, TSV, HDF5, Zarr

🔬 Example Workflows

Basic Spatial Analysis

1. "Load my 10x Visium dataset from /path/to/data.h5ad"
2. "Preprocess with genes in ≥10 cells and cells with ≥500 genes"
3. "Identify spatial domains using SpaGCN"
4. "Visualize spatial domains"

Cell Communication Analysis

1. "Annotate cell types using marker genes"
2. "Analyze cell communication using LIANA with cosine similarity"
3. "Visualize communication for VEGFA-KDR interaction"

Advanced Deep Learning

1. "Find spatial variable genes using GASTON with GLM-PCA"
2. "Deconvolve spatial data using Cell2location"
3. "Visualize deconvolution results and GASTON isodepth map"

🛠️ System Requirements

  • Python: 3.10+ (3.11 recommended)
  • Memory: 8GB+ RAM (16GB+ for large datasets)
  • Storage: 2GB+ free space
  • OS: macOS, Linux, Windows (WSL2)

📖 Documentation

| Document | Description |
|----------|-------------|
| INSTALLATION.md | Detailed installation and setup guide |
| Error Handling Guide | Troubleshooting and error resolution |
| Dataset Guide | Dataset management and organization |
| Project Structure | Codebase architecture and organization |

🔄 Migration from v0.1.x

  • Tool Names: Updated to consistent action+object pattern
  • Dependencies: Moved CellPhoneDB from experimental to advanced
  • Python Version: Now requires Python 3.10+ (was 3.8+)
  • CI/CD: Enhanced testing and quality checks

🐛 Known Issues & Limitations

  • Claude Desktop: 4-minute timeout limit (use Cherry Studio for longer analyses)
  • Large Datasets: >50k cells may require memory optimization
  • Visualization: Images displayed as object references in Claude Desktop

🤝 Contributing

We welcome contributions! Please see:

📄 License

MIT License - see LICENSE for details.

🙏 Acknowledgments

  • Model Context Protocol: Anthropic's MCP specification
  • Spatial Analysis Methods: GASTON, SpaGCN, LIANA, Cell2location communities
  • Python Ecosystem: scanpy, squidpy, anndata, and spatial transcriptomics tools

Full Changelog: v0.1.2...v0.2.0

Installation: pip install -e .[all]
MCP Integration: See INSTALLATION.md for client setup
Support: Open an issue for help

v0.1.1 Bug fix

Minor fixes and improvements.

Full changelog

🚀 Release v0.1.1

🛠 GitHub Actions Improvements

  • ✅ Fixed all GitHub Actions workflows
  • ✅ Resolved dependency resolution issues
  • ✅ Added minimal test workflow for quick validation
  • ✅ Improved CI/CD pipeline reliability

📊 Current Status

All workflows now passing with 100% success rate:

  • CI ✅
  • Tests ✅
  • Code Quality ✅
  • ChatSpatial Test Suite ✅
  • Minimal Test ✅

🐛 Bug Fixes

  • Fixed missing requirements.txt references
  • Fixed pip install dependency resolution depth issues
  • Fixed black formatter strict mode failures
  • Fixed missing run_tests.py references

📦 Package Improvements

  • Improved pyproject.toml dependency management
  • Better error handling in workflows
  • Simplified test matrix for faster CI

Full Changelog: https://github.com/cafferychen777/ChatSpatial/compare/v0.1.0...v0.1.1

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

About

Stars
40
Forks
11
Languages
Python R Dockerfile

Install & Platforms

Install via
pip docker

Beta — feedback welcome: [email protected]