feat: Add comprehensive SRA (Sequence Read Archive) raw data support with safety constraints - #2
feat: Add comprehensive SRA (Sequence Read Archive) raw data support with safety constraints#2KQDtianxiaK wants to merge 13 commits into
Conversation
|
Thanks for the PR — the overall direction looks good. That said, I can’t merge this as-is because it currently mixes the intended change with broad restructuring:
I’m not against the new structure, but I’d strongly prefer we get there in small, reviewable steps so we can merge value incrementally and keep the current codebase stable. Suggested path forward
If you think the larger restructuring is required for the feature, let’s align on the plan first (e.g., a short note in the PR description or an issue outlining the goal and migration impact), then we can sequence it into mergeable PRs. Happy to re-review once this PR is narrowed to the feature (or once the restructuring is split into the steps above). |
|
@KQDtianxiaK are you still updating that? also was thinking of the same thing lol |
Summary
This PR implements comprehensive SRA (Sequence Read Archive) raw sequencing data support as requested in #1, with full safety constraints as recommended by the maintainers.
Key Achievement: Extends GEOmcp from 11 tools to 18 tools, enabling complete workflows from GEO search → SRA query → size estimation → safe download → FASTQ conversion.
🆕 New Features
1. SRA Query & Resolution (GSE → GSM → SRR)
sra_query_from_geo: Map GEO Series to SRA Run accessionssra_get_metadata: Retrieve SRA run metadata2. Size Estimation (Dry-Run Mode)
sra_estimate_size: Query EBI ENA to estimate file sizes before downloading3. Safe Download & Convert
sra_download_and_convert: Integrated prefetch + fastq-dump workflowsra_generate_download_commands: Generate commands for various methods (prefetch, wget, curl, aspera)sra_check_toolkit: Verify sra-toolkit installationsra_download: Direct HTTP download for small files🛡️ Safety Constraints (As Recommended)
Following the maintainer's guidance in #1, this implementation includes:
dry_run=Trueby default - only estimates sizes without downloadingsra_estimate_size()tool +dry_runparameter in download toolsoutput_dirfor files >1GBconfirm_large=Truefor files >5GBSafety Examples
📊 Comparison
🔄 Complete Workflow Example
🏗️ Technical Implementation
Architecture
Key Design Decisions
Dependencies
mcp>=1.9.0- MCP Python SDKhttpx>=0.27.0- Async HTTP client (already in use)pydantic>=2.0.0- Input validation (already in use)aiofiles>=23.0.0- Async file operationsOptional: sra-toolkit (for actual downloads)
🧪 Testing
📝 Documentation
README.mdwith comprehensive examplesSKILL.mdfor Claude Desktop integrationNone. All existing 11 tools remain unchanged and fully functional.
🎯 Addresses Issue #1
This PR directly addresses the enhancement request in #1:
✅ Implemented in
sra_query_from_geo✅ Implemented in
sra_download_and_convert✅ Implemented safety constraints:
🚀 Migration Guide for Users
No migration needed. Existing functionality unchanged. To use new SRA features:
sra_toolkit_path(optional)dry_run=Truefirst to check sizes📋 Checklist
All code modifications and reports for this PR were completed using the Kimi Code CLI (powered by the kimi-k2.5 model) under my guidance. I conducted initial testing, and it ran successfully. Finally, I suggest creating a test branch first to review and test the code I submitted.