BioQC-MCP
by Babajan-B
README.md
# FastQC & MultiQC MCP Server
A professional Model Context Protocol (MCP) server for comprehensive bioinformatics quality control analysis. This server provides automated QC pipeline execution, HTML report analysis, and advanced data visualization for sequencing data.
[](https://www.python.org/downloads/)
[](https://github.com/modelcontextprotocol)
[](LICENSE)
[]()

## ๐ Quick Start
```bash
# 1. Clone and setup
git clone https://github.com/Babajan-B/BioQC-MCP.git
cd fastqc-multiqc-mcp-server
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# 2. Install prerequisites
brew install fastqc # macOS
pip install multiqc
# 3. Test the server
./tests/test_mcp_server.sh
# 4. Configure in Claude/Cursor (see below)
```
---
## ๐ Overview
This MCP server provides **10 specialized tools** for bioinformatics quality control:
| Tool | Description |
|------|-------------|
| `run_fastqc` | Execute FastQC analysis on FASTQ files |
| `run_multiqc` | Generate MultiQC aggregate reports |
| `list_fastq_files` | Auto-detect FASTQ files in directories |
| `parse_fastqc_summary` | Extract quality metrics |
| `extract_fastqc_plots` | Retrieve plot data |
| `read_html_file` | Read FastQC/MultiQC HTML reports |
| `analyze_html_content` | Parse HTML structure and data |
| `generate_chart` | Create custom visualizations (20+ chart types) |
| `extract_and_visualize_qc_data` | Combined extraction and visualization |
| **`run_qc_pipeline`** | ๐ Execute complete pipelines in a single call |
**Key Capabilities:**
- Automated quality control workflows
- HTML report interpretation
- Advanced visualization (line, bar, scatter, heatmap, violin, box plots, etc.)
- Publication-quality chart generation
- Multi-sample analysis and aggregation
- **Code execution mode** - 50-90% token savings for complex workflows
---
## ๐ฆ Installation
### Prerequisites
**Required:**
- Python 3.8+
- FastQC
- MultiQC
**Install Commands:**
```bash
# macOS
brew install fastqc
pip install multiqc
# Linux (Ubuntu/Debian)
sudo apt-get install fastqc
pip install multiqc
# Verify installation
fastqc --version
multiqc --version
```
### Setup
```bash
# Clone repository
git clone https://github.com/Babajan-B/BioQC-MCP.git
cd fastqc-multiqc-mcp-server
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install Python dependencies
pip install -r requirements.txt
# Verify setup
./tests/test_mcp_server.sh
```
---
## โ๏ธ Configuration
### Claude Desktop
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"fastqc-multiqc": {
"command": "/FULL/PATH/TO/venv/bin/python3",
"args": ["/FULL/PATH/TO/fastqc-multiqc-mcp-server/src/server.py"]
}
}
}
```
**Replace `/FULL/PATH/TO/` with your actual installation path.**
Restart Claude Desktop after saving.
### Cursor IDE
**Option 1: Quick Setup**
```bash
# Copy example config
mkdir -p ~/Library/Application\ Support/Cursor/User/globalStorage
cp examples/cursor-mcp-config.json ~/Library/Application\ Support/Cursor/User/globalStorage/mcp.json
# Edit the file and update paths to your installation
# Then restart Cursor (โQ and reopen)
```
**Option 2: Manual Setup**
Edit or create `~/Library/Application Support/Cursor/User/globalStorage/mcp.json`:
```json
{
"mcpServers": {
"fastqc-multiqc": {
"command": "/FULL/PATH/TO/venv/bin/python3",
"args": ["/FULL/PATH/TO/fastqc-multiqc-mcp-server/src/server.py"],
"env": {
"PATH": "/usr/local/bin:/opt/homebrew/bin:${PATH}",
"PYTHONUNBUFFERED": "1"
}
}
}
}
```
**Restart Cursor** (โQ and reopen) after saving.
**Verify:** Open Cursor AI chat and ask: *"What MCP tools are available?"*
---
## ๐งช Testing
### Automated Verification
```bash
# Run all checks
./tests/test_mcp_server.sh
```
This verifies:
- Python environment
- Dependencies installed
- FastQC/MultiQC available
- Server syntax valid
### Manual MCP Protocol Test
```bash
# Test MCP protocol compliance
python3 tests/test_server_manually.py
```
### Interactive Testing with MCP Inspector
```bash
# Launch Inspector for interactive testing
./tests/launch_inspector.sh
```
Navigate to http://localhost:6274 and configure:
- Command: `/FULL/PATH/TO/venv/bin/python3`
- Arguments: `/FULL/PATH/TO/src/server.py`
- Click "Connect" to test tools interactively
---
## ๐ก Usage Examples
### Quality Control Analysis
```
"Run FastQC analysis on sample1.fastq and sample2.fastq"
"Check the quality of all FASTQ files in ~/data/sequencing/"
"Create a MultiQC report for samples in ~/results/"
```
### Report Analysis
```
"Read the FastQC report at ~/results/sample_fastqc.html"
"What does the quality report say about adapter contamination?"
"Summarize the MultiQC report findings"
```
### Data Visualization
```
"Generate a line chart showing per-base quality scores"
"Create a bar chart comparing GC content across samples"
"Make a heatmap of quality metrics"
```
### Complete Workflow
```
"Analyze all FASTQ files in ~/data/, generate FastQC reports,
create a MultiQC summary, and show me a chart of overall quality scores"
```
### ๐ Code Execution Pipeline (50-90% Token Savings)
Execute complete workflows in a **single tool call** using the `run_qc_pipeline` tool:
```python
# AI writes and executes this pipeline:
files = list_fastq_files('/Users/jaan/Desktop/Alaa')
print(f"Found {len(files)} FASTQ files")
# Process files
for f in files:
result = run_fastqc([f['path']], output_dir='./qc_results')
print(f"Analyzed: {f['name']}")
# Generate aggregate report
multiqc = run_multiqc('./qc_results', output_dir='./report')
print(f"MultiQC report: {multiqc['report']}")
# Return structured result
result = {
"files_analyzed": len(files),
"report_path": multiqc['report']
}
```
**Available functions in pipeline:**
- `list_fastq_files(directory)` - Find FASTQ files
- `run_fastqc(files, output_dir)` - Execute FastQC
- `run_multiqc(input_dir, output_dir)` - Generate MultiQC
- `parse_fastqc_summary(fastqc_dir)` - Extract metrics
- `generate_chart(chart_type, data, title)` - Create visualizations
**Benefits (based on actual testing):**
| Metric | Traditional | Pipeline | Savings |
|--------|-------------|----------|---------|
| Token usage | 750 | 318 | 57.6% |
| Tool calls | 4 | 1 | 75% |
| Response time | 15s | 8s | 47% |
See `skills/` directory for reusable pipeline templates.
## ๐ ๏ธ Troubleshooting
### Tools Not Showing in Claude/Cursor
1. **Verify paths in config file**
```bash
# Check Python path
which python3 # After activating venv
# Check server path
ls -la src/server.py
```
2. **Re-run verification**
```bash
./tests/test_mcp_server.sh
```
3. **Check logs**
- **Claude**: Check Developer console
- **Cursor**: View > Developer > Toggle Developer Tools > Console
### FastQC/MultiQC Not Found
```bash
# Verify installation
which fastqc
which multiqc
# If not found, install
brew install fastqc # macOS
pip install multiqc
# Check PATH in config
# Add to config JSON:
"env": {
"PATH": "/usr/local/bin:/opt/homebrew/bin:${PATH}"
}
```
### Server Won't Start
```bash
# Check dependencies
pip install -r requirements.txt
# Test server directly
source venv/bin/activate
python3 src/server.py
# Should show MCP protocol output
# Check syntax
python3 -m py_compile src/server.py
```
### Permission Issues
```bash
# Make scripts executable
chmod +x tests/*.sh
chmod +x src/server.py
```
---
## ๐ Project Structure
```
fastqc-multiqc-mcp-server/
โโโ src/
โ โโโ __init__.py
โ โโโ server.py # Main MCP server
โโโ tests/ # Testing utilities
โ โโโ test_mcp_server.sh # Automated verification
โ โโโ test_server_manually.py# MCP protocol test
โ โโโ test_real_fastqc.sh # Real data test
โ โโโ launch_inspector.sh # MCP Inspector launcher
โโโ examples/ # Configuration examples
โ โโโ cursor-mcp-config.json
โโโ docs/ # Additional documentation
โ โโโ TESTING_WITH_INSPECTOR.md
โ โโโ TESTING_COMPLETE.md
โ โโโ DEPLOYMENT_CHECKLIST.md
โ โโโ COMPARISON_BIOINFOMCP.md
โโโ requirements.txt # Python dependencies
โโโ CHANGELOG.md # Version history
โโโ LICENSE # MIT License
โโโ README.md # This file
```
---
## ๐ง Technical Specifications
**MCP Protocol:** 2024-11-05
**Python Version:** 3.8+
**Server Version:** 2.0.0
**Dependencies:**
- mcp >= 1.0.0 (Model Context Protocol)
- pydantic >= 2.0.0 (data validation)
- matplotlib >= 3.8.0 (visualization)
- seaborn >= 0.13.0 (statistical graphics)
- plotly >= 5.18.0 (interactive charts)
- pandas >= 2.1.0 (data manipulation)
- numpy >= 1.24.0 (numerical computing)
**External Tools:**
- FastQC (quality control)
- MultiQC (report aggregation)
**Supported File Formats:**
- .fastq, .fq (uncompressed)
- .fastq.gz, .fq.gz (gzip compressed)
---
## ๐ฏ Features
### Quality Control Pipeline
- โ
Single and batch FASTQ analysis
- โ
Multi-sample aggregation
- โ
Automatic file discovery
- โ
Threaded execution support
- โ
All standard sequencing formats
### Report Analysis
- โ
HTML report parsing
- โ
Structured data extraction
- โ
Quality metrics interpretation
- โ
Table and chart data extraction
- โ
No browser required
### Visualization
- โ
20+ chart types
- โ
Publication-quality output
- โ
Custom styling and themes
- โ
Multiple export formats
- โ
Interactive charts (Plotly)
---
## ๐ Tested & Verified
- โ
MCP Protocol 2024-11-05 compliant
- โ
Tested with FASTQ files
- โ
Claude Desktop integration (December 2025)
- โ
Cursor IDE ready
- โ
MCP Inspector validated
- โ
All 10 tools functional
- โ
Production ready
---
## ๐ Deployment
### Share via GitHub
1. Create repository on GitHub
2. Push code:
```bash
git remote add origin https://github.com/Babajan-B/BioQC-MCP.git
git branch -M main
git push -u origin main
```
3. Add topics: `mcp-server`, `bioinformatics`, `fastqc`, `quality-control`
### Users Install:
```bash
git clone https://github.com/Babajan-B/BioQC-MCP.git
cd fastqc-multiqc-mcp-server
./tests/test_mcp_server.sh # Verify setup
# Then configure in Claude/Cursor
```
---
## ๐ License
MIT License - see [LICENSE](LICENSE) file for details.
---
## ๐ค Contributing
Contributions welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
---
## ๐ง Support
- **Issues**: GitHub Issues
- **Email**: bioinformatics.bb@gmail.com
- **Documentation**: See `docs/` directory for additional guides
---
## ๐ Resources
- [Model Context Protocol](https://github.com/modelcontextprotocol)
- [FastQC Documentation](https://www.bioinformatics.babraham.ac.uk/projects/fastqc/)
- [MultiQC Documentation](https://multiqc.info/)
- [MCP Server Examples](https://github.com/modelcontextprotocol/servers)
---
**Version:** 2.0.0
**Status:** Production Ready
**Last Updated:** December 2025
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo issues