Cbioportal Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Cbioportal Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A high-performance, production-ready Model Context Protocol (MCP) server that enables AI assistants to seamlessly interact with cancer genomics data from cBioPortal. Built with modern async Python architecture, enterprise-grade modular design, and BaseEndpoint pattern for maximum reliability, maintainability, and 4.5x faster performance.
This project demonstrates cutting-edge human-AI collaboration in bioinformatics software development:
Recent Achievements: External code review integration with comprehensive quality improvements including Ruff configuration, configurable performance settings, and modern Python best practices.
Methodology: This collaborative approach combines deep biological domain knowledge with AI-powered development capabilities, accelerating innovation while maintaining rigorous code quality and scientific accuracy.
# Install uv if needed
pipx install uv
# Clone and setup
git clone https://github.com/yourusername/cbioportal-mcp.git
cd cbioportal-mcp
uv sync
# Launch server
uv run cbioportal-mcpThat's it! 🎉 Your server is running and ready for AI assistant connections.
Modern, lightning-fast package management with automatic environment handling:
# Install uv
pipx install uv
# Or with Homebrew: brew install uv
# Clone repository
git clone https://github.com/yourusername/cbioportal-mcp.git
cd cbioportal-mcp
# One-command setup (creates venv + installs dependencies)
uv syncStandard Python package management approach:
# Create virtual environment
python -m venv cbioportal-mcp-env
# Activate environment
# Windows: cbioportal-mcp-env\Scripts\activate
# macOS/Linux: source cbioportal-mcp-env/bin/activate
# Install dependencies
pip install -e .The server supports flexible configuration with priority: CLI args > Environment variables > Config file > Defaults
#### YAML Configuration 📄 Create config.yaml for persistent settings:
# cBioPortal MCP Server Configuration
server:
base_url: "https://www.cbioportal.org/api"
transport: "stdio"
client_timeout: 480.0
logging:
level: "INFO"
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
api:
rate_limit:
enabled: false
requests_per_second: 10
retry:
enabled: true
max_attempts: 3
backoff_factor: 1.0
cache:
enabled: false
ttl_seconds: 300
batch_size:
genes: 100 # Configurable gene batch size for concurrent operations#### Environment Variables 🌍
export CBIOPORTAL_BASE_URL="https://custom-instance.org/api"
export CBIOPORTAL_LOG_LEVEL="DEBUG"
export CBIOPORTAL_CLIENT_TIMEOUT=600
export CBIOPORTAL_GENE_BATCH_SIZE=50 # Configure gene batch size
export CBIOPORTAL_RETRY_MAX_ATTEMPTS=5#### CLI Options 💻
# Basic usage
uv run cbioportal-mcp
# Custom configuration
uv run cbioportal-mcp --config config.yaml --log-level DEBUG
# Custom API endpoint
uv run cbioportal-mcp --base-url https://custom-instance.org/api
# Generate example config
uv run cbioportal-mcp --create-example-configConfigure in your Claude Desktop MCP settings:
Option 1: Direct Script Path (Recommended)
{
"mcpServers": {
"cbioportal": {
"command": "/path/to/your/project/cbioportal_MCP/.venv/bin/cbioportal-mcp",
"env": {
"CBIOPORTAL_LOG_LEVEL": "INFO"
}
}
}
}Option 2: uv run (Alternative)
{
"mcpServers": {
"cbioportal": {
"command": "uv",
"args": ["run", "cbioportal-mcp"],
"cwd": "/path/to/your/project/cbioportal_MCP",
"env": {
"CBIOPORTAL_LOG_LEVEL": "INFO"
}
}
}
}Important Setup Steps:
/path/to/your/project/cbioportal_MCP with your actual project pathuv pip install -e .Add to your workspace settings:
{
"mcp.servers": {
"cbioportal": {
"command": "uv",
"args": ["run", "cbioportal-mcp"],
"cwd": "/path/to/cbioportal-mcp"
}
}
}# Development server with debug logging
uv run cbioportal-mcp --log-level DEBUG
# Production server with custom config
uv run cbioportal-mcp --config production.yaml
# Using custom cBioPortal instance
uv run cbioportal-mcp --base-url https://private-instance.org/apicbioportal-mcp/
├── 📁 cbioportal_mcp/ # Main package directory
│ ├── 📊 server.py # Main MCP server implementation
│ ├── 🌐 api_client.py # Dedicated HTTP client class
│ ├── ⚙️ config.py # Multi-layer configuration system
│ ├── 📋 constants.py # Centralized constants
│ ├── 📁 endpoints/ # Domain-specific API modules
│ │ ├── 🏗️ base.py # BaseEndpoint pattern (60% duplication reduction)
│ │ ├── 🔬 studies.py # Cancer studies & search
│ │ ├── 🧬 genes.py # Gene operations & mutations
│ │ ├── 🧪 samples.py # Sample data management
│ │ └── 📈 molecular_profiles.py # Molecular & clinical data
│ └── 📁 utils/ # Shared utilities
│ ├── 📄 pagination.py # Efficient pagination logic
│ ├── ✅ validation.py # Input validation
│ └── 📝 logging.py # Logging configuration
├── 📁 tests/ # Comprehensive test suite (93 tests)
├── 📁 docs/ # Documentation
├── 📁 scripts/ # Development utilities
└── 📄 pyproject.toml # Modern Python project configThe server provides 12 high-performance tools for AI assistants:
| 🔧 Tool | 📝 Description | ⚡ Features |
|---|---|---|
get_cancer_studies | List all available cancer studies | 📄 Pagination, 🔍 Filtering |
search_studies | Search studies by keyword | 🔎 Full-text search, 📊 Sorting |
get_study_details | Detailed study information | 📈 Comprehensive metadata |
get_samples_in_study | Samples for specific studies | 📄 Paginated results |
get_genes | Gene information by ID/symbol | 🏷️ Flexible identifiers |
search_genes | Search genes by keyword | 🔍 Symbol & name search |
get_mutations_in_gene | Gene mutations in studies | 🧬 Mutation details |
get_clinical_data | Patient clinical information | 👥 Patient-centric data |
get_molecular_profiles | Study molecular profiles | 📊 Profile metadata |
get_multiple_studies | 🚀 Concurrent study fetching | ⚡ Bulk operations |
get_multiple_genes | 🚀 Concurrent gene retrieval | 📦 Automatic batching |
get_gene_panels_for_study | Gene panels in studies | 🧬 Panel information |
get_multiple_* methods use asyncio.gather for parallel processingOur async implementation delivers significant performance improvements:
🏃♂️ Sequential Study Fetching: 1.31 seconds (10 studies)
⚡ Concurrent Study Fetching: 0.29 seconds (10 studies)
🎯 Performance Improvement: 4.57x faster!get_multiple_studies for fetching multiple studies concurrentlyget_multiple_genes with automatic batching for gene listsconcurrent_batch_size in config for optimal performance# Setup development environment
uv sync
# Run tests
uv run pytest
# Run with coverage
uv run pytest --cov=.
# Run specific test file
uv run pytest tests/test_server_lifecycle.py
# Update snapshots
uv run pytest --snapshot-update
# Lint code
uv run ruff check .
# Format code
uv run ruff format .Comprehensive test suite with 93 tests across 8 categories:
git checkout -b feature/amazing-feature)uv run pytest)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)#### Server Fails to Start
# Check Python version
python --version # Should be 3.10+
# Verify dependencies
uv sync
# Check for conflicts
uv run python -c "import mcp, httpx, fastmcp; print('Dependencies OK')"#### Claude Desktop Connection Issues
~ or relative paths)uv pip install -e . in project directory.venv/bin/cbioportal-mcp script existsuv is in your system PATH and cwd points to project directory#### Performance Issues
concurrent_batch_size in configmax_concurrent_requests for your systemget_multiple_* methods for bulk operations#### Configuration Problems
# Generate example config
uv run cbioportal-mcp --create-example-config
# Validate configuration
uv run cbioportal-mcp --config your-config.yaml --log-level DEBUG
# Check environment variables
env | grep CBIOPORTAL# Test cBioPortal API accessibility
curl https://www.cbioportal.org/api/cancer-types
# Test with custom instance
curl https://your-instance.org/api/studies"What cancer studies are available for breast cancer research?"
"Search for melanoma studies with genomic data"
"Get mutation data for TP53 in lung cancer studies"
"Find clinical data for patients in the TCGA-BRCA study"
"What molecular profiles are available for pediatric brain tumors?""Compare mutation frequencies between two cancer studies"
"Get all genes in the DNA repair pathway for ovarian cancer"
"Find studies with both RNA-seq and mutation data"
"What are the most frequently mutated genes in glioblastoma?""Fetch data for multiple cancer studies concurrently"
"Get information for a list of cancer genes efficiently"
"Compare clinical characteristics across multiple studies"
"Retrieve molecular profiles for several cancer types"This project is licensed under the MIT License - see the LICENSE file for details.
🌟 Production-ready bioinformatics platform built through innovative human-AI collaboration! 🧬✨
Demonstrating the power of domain expertise + AI-assisted development for enterprise-grade scientific software.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.