gRNAde MCP Server

gRNAde MCP Server

Enables RNA structure analysis, sequence evaluation, and inverse design using geometric deep learning models. Supports both quick computational analysis and long-running batch processing for generating RNA sequences that fold into target structures.

Category
访问服务器

README

gRNAde MCP Server

MCP server providing tools for RNA structure analysis, sequence evaluation, inverse design, and batch processing using gRNAde (geometric RNA design).

Installation

Prerequisites

# Ensure dependencies are installed
pip install fastmcp loguru

Install with Claude Code CLI (Recommended)

  1. Navigate to MCP directory:

    cd /path/to/grnade_mcp
    
  2. Register MCP server:

    claude mcp add geometric-rna-design -- python $(pwd)/src/server.py
    
  3. Verify installation:

    claude mcp list | grep geometric-rna-design
    # Should show: geometric-rna-design: ... - ✓ Connected
    
  4. Start using:

    claude
    # In Claude: "What tools are available from geometric-rna-design?"
    

Alternative: Claude Desktop

Add to ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "geometric-rna-design": {
      "command": "python",
      "args": ["/absolute/path/to/grnade_mcp/src/server.py"]
    }
  }
}

Alternative: Other MCP Clients

{
  "mcpServers": {
    "geometric-rna-design": {
      "command": "python",
      "args": ["/absolute/path/to/src/server.py"],
      "env": {
        "PYTHONPATH": "/absolute/path/to/grnade_mcp"
      }
    }
  }
}

Available Tools

Quick Operations (Sync API)

These tools return results immediately:

Tool Description Runtime
analyze_rna_structure Analyze RNA secondary structures & statistics ~30 sec
evaluate_rna_sequences Evaluate sequences with computational metrics ~2 min
validate_rna_inputs Validate RNA sequences and structures ~1 sec
get_example_data Get example datasets and usage examples ~1 sec

Long-Running Tasks (Submit API)

These tools return a job_id for tracking:

Tool Description Runtime
submit_rna_inverse_design Generate RNA sequences from structures >10 min
submit_batch_rna_pipeline High-throughput multi-target pipeline >30 min
submit_batch_rna_evaluation Batch evaluation of sequence sets >10 min

Job Management

Tool Description
get_job_status Check job progress
get_job_result Get results when completed
get_job_log View execution logs
cancel_job Cancel running job
list_jobs List all jobs

Workflow Examples

Quick Analysis (Sync)

Use the analyze_rna_structure tool with secondary_structure "(((...)))"

Long-Running Design (Async)

1. Submit: Use submit_rna_inverse_design with secondary_structure "(((...)))" and mode "2d"
   → Returns: {"job_id": "abc123", "status": "submitted"}

2. Check: Use get_job_status with job_id "abc123"
   → Returns: {"status": "running", ...}

3. Get result: Use get_job_result with job_id "abc123"
   → Returns: {"status": "success", "result": {"sequences": [...], ...}}

Batch Processing

Use submit_batch_rna_pipeline with targets_file "targets.csv" and output_dir "results/batch"
→ Processes multiple targets in a single job

Development

# Run tests
mamba run -p ./env python test_mcp.py
mamba run -p ./env python test_jobs.py

# Test server
mamba run -p ./env python src/server.py --help

# Test with MCP inspector
npx @anthropic/mcp-inspector src/server.py

Tool Details

analyze_rna_structure

Analyze RNA secondary structure properties and statistics. Fully independent tool - no external dependencies.

Parameters:

  • secondary_structure (str, optional): Secondary structure in dot-bracket notation
  • sequence (str, optional): RNA sequence for prediction
  • predict_structure (bool, optional): Whether to predict structure from sequence
  • output_file (str, optional): Path to save results as JSON
  • verbose (bool, optional): Include detailed output

Example:

analyze_rna_structure(secondary_structure="(((...)))")
analyze_rna_structure(sequence="GGGAAACCC", predict_structure=True)

evaluate_rna_sequences

Evaluate RNA sequences using computational metrics. Graceful fallback to basic statistics when models unavailable.

Parameters:

  • sequences (List[str] or str): RNA sequences or comma-separated string
  • target_structure (str): Target secondary structure in dot-bracket notation
  • output_file (str, optional): Path to save results as CSV
  • use_basic_stats (bool): Whether to use basic statistics mode
  • verbose (bool): Include detailed output

Example:

evaluate_rna_sequences(["GGGAAACCC", "AUCGAUCG"], "(((...)))")
evaluate_rna_sequences("GGGAAACCC,AUCGAUCG", "(((...)))")

submit_rna_inverse_design

Submit RNA inverse design for background processing. Generates RNA sequences that fold into specified 2D/3D structures using gRNAde models.

Parameters:

  • secondary_structure (str, optional): Secondary structure for 2D mode
  • pdb_file (str, optional): PDB file path for 3D mode
  • mode (str): Design mode - "2d" or "3d"
  • n_designs (int): Number of sequences to generate
  • partial_seq (str, optional): Partial sequence constraints
  • temperature_min (float): Minimum sampling temperature
  • temperature_max (float): Maximum sampling temperature
  • output_dir (str, optional): Directory to save outputs
  • job_name (str, optional): Custom job name

Example:

submit_rna_inverse_design(secondary_structure="(((...)))", mode="2d", n_designs=20)
submit_rna_inverse_design(pdb_file="structure.pdb", mode="3d", n_designs=50)

submit_batch_rna_pipeline

Submit batch RNA design pipeline for multiple targets. Runs high-throughput RNA design with evaluation and filtering.

Parameters:

  • targets_file (str, optional): Path to CSV file with targets
  • pdb_dir (str, optional): Directory with PDB files
  • targets (List[str], optional): List of target dictionaries
  • output_dir (str, optional): Directory for outputs
  • n_designs_per_target (int): Number of sequences per target
  • max_workers (int, optional): Maximum parallel workers
  • enable_evaluation (bool): Whether to run evaluation phase
  • enable_filtering (bool): Whether to run filtering phase
  • max_results_per_target (int): Maximum results to keep per target
  • job_name (str, optional): Custom job name

Example:

submit_batch_rna_pipeline(targets_file="targets.csv", output_dir="results/batch", n_designs_per_target=100)

validate_rna_inputs

Validate RNA inputs before processing.

Parameters:

  • sequence (str, optional): RNA sequence to validate
  • secondary_structure (str, optional): Secondary structure to validate
  • pdb_file (str, optional): PDB file path to validate

Example:

validate_rna_inputs(sequence="GGGAAACCC", secondary_structure="(((...)))")

get_example_data

Get information about available example datasets for testing.

Example:

get_example_data()

File Structure

src/
├── server.py                     # Main MCP server
├── jobs/
│   ├── __init__.py
│   └── manager.py                # Job management system
├── test_mcp.py                   # MCP tools tests
└── test_jobs.py                  # Job system tests

jobs/                             # Job execution directory
├── <job_id>/                    # Individual job directories
│   ├── metadata.json           # Job metadata
│   ├── job.log                 # Execution logs
│   └── output.json             # Results

scripts/                          # Clean scripts from Step 5
├── lib/                         # Shared utilities
├── rna_structure_analysis.py    # ✅ Fully independent
├── rna_evaluation.py            # ⚠️ Graceful fallback
├── rna_inverse_design.py        # ⚠️ Requires gRNAde models
└── batch_rna_pipeline.py        # ⚠️ Depends on others

configs/                          # Configuration files
└── *.json                       # Per-script configurations

Dependencies

Required

  • fastmcp>=2.14.1 - MCP server framework
  • loguru>=0.7.3 - Logging
  • numpy - Scientific computing
  • pandas - Data manipulation

Optional (for advanced features)

  • torch - Deep learning (for gRNAde models)
  • Various RNA analysis packages (graceful fallbacks implemented)

API Design

The server implements a dual API design:

Sync API (< 10 min operations)

  • analyze_rna_structure: Structure analysis (~30 seconds)
  • evaluate_rna_sequences: Sequence evaluation (~2 minutes)

Submit API (> 10 min operations)

  • submit_rna_inverse_design: RNA generation (>10 minutes)
  • submit_batch_rna_pipeline: Batch processing (>30 minutes)

Job Management

All submit operations return a job_id for tracking:

  1. Submit: Get job_id
  2. Monitor: Use get_job_status(job_id)
  3. Retrieve: Use get_job_result(job_id) when completed
  4. Debug: Use get_job_log(job_id) for execution logs

Testing

# Test all MCP tools
mamba run -p ./env python test_mcp.py

# Test job management
mamba run -p ./env python test_jobs.py

# Test server startup
mamba run -p ./env python src/server.py --help

Features

  • Robust Job Management: Persistent jobs, real-time monitoring, cancellation support
  • Graceful Degradation: Works even without full model setup
  • Dual API Design: Sync for fast ops, Submit for long ops
  • Production Ready: Comprehensive error handling, structured responses
  • Well Tested: 100% automated test coverage

Status

  • Ready for Production: Structure analysis and basic evaluation work immediately
  • Easy Integration: Works with Claude Desktop and fastmcp CLI
  • Scalable Design: Job system handles large-scale processing
  • ⚠️ Model Setup Required: Advanced features need gRNAde model configuration

For complete documentation, see reports/step6_mcp_tools.md.

Troubleshooting

Server Won't Start

# Check syntax and imports
python -m py_compile src/server.py
python -c "from src.server import mcp; print('✅ OK')"

# Check dependencies
pip list | grep -E "fastmcp|loguru"

Tools Not Found in Claude

# Verify registration
claude mcp list | grep geometric-rna-design

# Re-register if needed
claude mcp remove geometric-rna-design
claude mcp add geometric-rna-design -- python $(pwd)/src/server.py

Jobs Stuck in Pending

# Check job directory
ls -la jobs/

# View job logs
cat jobs/[job_id]/job.log

# Check job manager
python -c "from src.jobs.manager import job_manager; print(job_manager.list_jobs())"

Port Conflicts (FastMCP Dev Mode)

# Kill process using port
lsof -ti :6277 | xargs kill

# Or run with different port
FASTMCP_PORT=8080 fastmcp dev src/server.py

Path Resolution Issues

  • Use absolute paths in configuration
  • Ensure PYTHONPATH includes project root
  • Check file permissions for input/output directories

Testing

Quick Validation

# Run automated integration tests
python tests/run_integration_tests.py

# Manual test with Claude
claude
"What tools are available from geometric-rna-design?"
"Analyze the RNA structure in examples/data/structures/8t2p_A.pdb"

Full Test Suite

See tests/test_prompts.md for comprehensive testing scenarios including:

  • Tool discovery and parameter validation
  • Synchronous tool execution
  • Asynchronous job workflow
  • Error handling and edge cases
  • End-to-end real-world scenarios

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选