CoolFace
Apppublic

Agents-MCP-Hackathon/SpatialAI_MCP

sourceHugging Facemitupdated 1y agoView on Hugging Face
2likes
CONTINUE_DEV_INTEGRATION.md243 linesDownload Raw Back to docs
1# Continue.dev Integration Guide2 3This guide covers two approaches for integrating OpenProblems spatial transcriptomics documentation with Continue.dev:4 51. **Enhanced MCP Server** (Primary approach - what we've built)62. **Continue.dev Document Artifacts** (Alternative approach)7 8## šŸŽÆ Approach 1: Enhanced MCP Server (RECOMMENDED)9 10Our OpenProblems MCP Server now provides **real, comprehensive documentation** from official sources through the Model Context Protocol.11 12### Features13 14āœ… **Real-time documentation access** from official sources15āœ… **Structured knowledge delivery** via MCP Resources16āœ… **File system operations** for local development17āœ… **Environment validation** and setup assistance18āœ… **Pipeline creation and validation**19āœ… **Automated documentation updates**20 21### Setup22 23#### 1. Install Dependencies24```bash25pip install -e .26```27 28#### 2. Download Real Documentation29```bash30openproblems-mcp download-docs31```32 33This command downloads and caches:34- **Nextflow Documentation** - Complete official docs from nextflow.io35- **Viash Documentation** - Comprehensive guides from viash.io36- **OpenProblems Documentation** - READMEs and guides from GitHub repositories37- **Docker Best Practices** - Bioinformatics-specific containerization patterns38- **Spatial Workflow Templates** - Ready-to-use pipeline templates39 40#### 3. Configure Continue.dev41 42Add to your Continue.dev configuration (`~/.continue/config.json`):43 44```json45{46  "mcpServers": {47    "openproblems": {48      "command": "python",49      "args": ["-m", "mcp_server.main"],50      "cwd": "/path/to/SpatialAI_MCP"51    }52  }53}54```55 56#### 4. Verify Integration57```bash58openproblems-mcp doctor --check-tools59openproblems-mcp info60```61 62### Continue.dev Workflow Example63 64Once configured, Continue.dev agents can:65 66```typescript67// Agent can access comprehensive documentation68const nextflowDocs = await mcp.readResource("documentation://nextflow");69const spatialTemplates = await mcp.readResource("templates://spatial-workflows");70 71// Agent can perform file operations72const projectFiles = await mcp.callTool("list_directory", { directory_path: "." });73const pipelineContent = await mcp.callTool("read_file", { file_path: "main.nf" });74 75// Agent can validate and create pipelines76const validation = await mcp.callTool("validate_nextflow_config", {77  pipeline_path: "main.nf"78});79 80// Agent can check environment setup81const environment = await mcp.callTool("check_environment", {});82```83 84### Available MCP Resources85 86| Resource URI | Content | Size |87|--------------|---------|------|88| `documentation://nextflow` | Complete Nextflow docs | ~50KB+ |89| `documentation://viash` | Complete Viash docs | ~30KB+ |90| `documentation://docker` | Bioinformatics Docker patterns | ~10KB |91| `templates://spatial-workflows` | Spatial pipeline templates | ~15KB |92| `server://status` | Server status and capabilities | ~1KB |93 94### Available MCP Tools95 96| Tool | Description | Use Case |97|------|-------------|----------|98| `read_file` | Read file contents | Analyze configs, scripts |99| `write_file` | Create/modify files | Generate pipelines, configs |100| `list_directory` | Navigate project structure | Explore repositories |101| `check_environment` | Validate tool installation | Setup verification |102| `validate_nextflow_config` | Pipeline syntax checking | Quality assurance |103| `run_nextflow_workflow` | Execute pipelines | Testing and deployment |104| `build_docker_image` | Container preparation | Environment setup |105| `analyze_nextflow_log` | Debug pipeline errors | Troubleshooting |106 107---108 109## šŸ”„ Approach 2: Continue.dev Document Artifacts (ALTERNATIVE)110 111For users who prefer to manage documentation directly in Continue.dev:112 113### Setup114 115#### 1. Download Documentation116```bash117openproblems-mcp download-docs118cd data/docs_cache119```120 121#### 2. Add to Continue.dev Documents122 123In Continue.dev, add these cached documentation files as document artifacts:124 125```126data/docs_cache/nextflow_docs.md127data/docs_cache/viash_docs.md128data/docs_cache/openproblems_docs.md129data/docs_cache/docker_docs.md130data/docs_cache/spatial_templates_docs.md131```132 133#### 3. Configure Continue.dev134 135Add to `~/.continue/config.json`:136 137```json138{139  "docs": [140    {141      "title": "Nextflow Documentation",142      "startUrl": "file:///path/to/SpatialAI_MCP/data/docs_cache/nextflow_docs.md"143    },144    {145      "title": "Viash Documentation",146      "startUrl": "file:///path/to/SpatialAI_MCP/data/docs_cache/viash_docs.md"147    },148    {149      "title": "OpenProblems Documentation",150      "startUrl": "file:///path/to/SpatialAI_MCP/data/docs_cache/openproblems_docs.md"151    },152    {153      "title": "Docker Best Practices",154      "startUrl": "file:///path/to/SpatialAI_MCP/data/docs_cache/docker_docs.md"155    },156    {157      "title": "Spatial Pipeline Templates",158      "startUrl": "file:///path/to/SpatialAI_MCP/data/docs_cache/spatial_templates_docs.md"159    }160  ]161}162```163 164### Pros and Cons165 166| | MCP Server Approach | Document Artifacts Approach |167|---|---|---|168| **Pros** | • Real-time access<br>• Structured delivery<br>• File operations<br>• Tool execution | • Simple setup<br>• Direct file access<br>• No server dependency |169| **Cons** | • Requires MCP setup<br>• More complex | • Manual updates<br>• No tool execution<br>• Static content |170 171---172 173## šŸ† Recommendation: Use Enhanced MCP Server174 175The **Enhanced MCP Server approach** is recommended because:176 1771. **Real-time Documentation** - Always up-to-date with official sources1782. **Interactive Capabilities** - Agent can perform actions, not just read docs1793. **Structured Knowledge** - Organized, searchable, contextual information1804. **Complete Workflow** - From documentation to execution1815. **Environment Integration** - Validates setup and provides guidance182 183### Example Continue.dev Agent Conversation184 185```186🧬 User: "Help me create a spatial transcriptomics quality control pipeline"187 188šŸ¤– Agent: Let me help you with that! I'll:1891. Check your environment setup1902. Get the latest Nextflow best practices1913. Use spatial transcriptomics templates1924. Create an optimized pipeline for you193 194[Agent uses MCP tools to check environment, read documentation, and create pipeline]195 196āœ… Agent: "I've created a spatial QC pipeline following OpenProblems standards.197The pipeline includes:198- Scanpy-based quality control199- Proper Docker containerization200- DSL2 Nextflow syntax201- Resource management202- Output publishing203 204Would you like me to validate the syntax and explain any part?"205```206 207---208 209## šŸ”§ Maintenance210 211### Updating Documentation212```bash213# Refresh all documentation214openproblems-mcp download-docs215 216# Check server status217openproblems-mcp doctor218 219# Test integration220openproblems-mcp tool check_environment221```222 223### Monitoring224```bash225# View cached documentation226ls -la data/docs_cache/227 228# Check server resources229openproblems-mcp info230```231 232---233 234## šŸš€ Next Steps235 2361. **Set up the Enhanced MCP Server** using Approach 12372. **Download real documentation** with `openproblems-mcp download-docs`2383. **Configure Continue.dev** to connect to the MCP server2394. **Test the integration** with spatial transcriptomics workflows2405. **Enjoy AI-assisted bioinformatics development!**241 242The integration provides computational biologists with **unprecedented AI assistance** for spatial transcriptomics pipeline development, combining the power of Continue.dev with comprehensive, real-time bioinformatics knowledge.243