Token导航 LogoToken导航TokenDH.com
rnamotif MCP logo
搜索检索stdio官方级别未说明来源级核验

rnamotif MCP

MCP Server

rnamotif MCP是一个用于RNA二级结构搜索和分析的工具,支持tRNA、IRE、假结和发夹等多种RNA基序的搜索,并提供批量处理和结果格式化功能。

工具数

15

提示词数

0

GitHub Stars

0

资源数

0
PythonClaude生物信息学Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

MacromNex

提供方

MacromNex

最后核验

2026/5/17 20:21

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install fastmcp loguru click pandas numpy tqdm

详细介绍

MCP名称

使用RNAMotif工具搜索和分析RNA二级结构基序的模型上下文协议服务器

目录

概述

rnamotif MCP通过直接脚本使用和模型上下文协议(MCP)集成提供对RNA二级结构搜索和分析工具的访问。它能够在RNA序列中搜索特定的RNA基序,如tRNA三叶草、铁反应元件(IRE)、假结和发夹。

特性

  • tRNA搜索:查找转移RNA三叶叶二级结构模式
  • IRE搜索:搜索带有评分的铁反应元素茎环图案
  • 伪结搜索:检测具有交叉碱基对的假结结构
  • 发夹搜索:查找具有茎和环区域的发夹结构
  • 结果格式:使用rmfmt、rmprune、rm2ct处理和格式化搜索结果
  • 批处理:处理多个文件和全面的分析工作流程
  • MCP集成:与Claude Code、Gemini CLI和其他MCP客户端一起使用

目录结构

./
├── README.md               # This file
├── env/                    # Conda environment (Python 3.10)
├── src/
│   └── server.py           # MCP server with 15 tools
├── scripts/
│   ├── trna_search.py      # tRNA motif search
│   ├── ire_search.py       # IRE motif search with scoring
│   ├── pseudoknot_search.py# Pseudoknot structure search
│   ├── hairpin_search.py   # Hairpin structure search
│   ├── format_results.py   # Results formatting and processing
│   ├── comprehensive_search.py # Combined analysis workflows
│   └── lib/                # Shared utilities
├── examples/
│   └── data/               # Demo RNA sequences and descriptors
├── configs/                # Configuration files
├── repo/                   # Original RNAMotif repository
└── reports/                # Step reports and documentation

______________________________________________________________________

安装

先决条件

  • Conda或Mamba(建议使用曼巴以加快安装速度)
  • Python 3.10+
  • GCC编译器(用于构建RNAMotif C工具)

创建环境

# Navigate to the MCP directory
cd /home/xux/Desktop/NucleicMCP/NucleicMCP/tool-mcps/rnamotif_mcp

# Create conda environment (use mamba if available)
mamba create -p ./env python=3.10 -y
# or: conda create -p ./env python=3.10 -y

# Activate environment
mamba activate ./env
# or: conda activate ./env

安装依赖项

# Install MCP dependencies
pip install fastmcp loguru click pandas numpy tqdm

# Build RNAMotif C tools (if not already built)
cd repo/rnamotif
make
cd ../..

______________________________________________________________________

本地使用(脚本)

您可以在没有MCP的情况下直接使用脚本进行本地处理。

可用脚本

脚本描述示例
scripts/trna_search.py搜索tRNA苜蓿叶状结构见下文
scripts/ire_search.py搜索带有评分的IRE图案见下文
scripts/pseudoknot_search.py搜索伪结结构见下文
scripts/hairpin_search.py搜索发夹结构见下文
scripts/format_results.py格式化和处理搜索结果见下文
scripts/comprehensive_search.py组合分析工作流程见下文

脚本示例

tRNA搜索

# Activate environment
mamba activate ./env

# Basic tRNA search
python scripts/trna_search.py \
  --input examples/data/ecoli_test.fastn \
  --output results/trna_output.txt \
  --verbose

# Using alternative descriptor for better matches
python scripts/trna_search.py \
  --input examples/data/ecoli_test.fastn \
  --descriptor trna.general.descr \
  --output results/trna_general.txt

参数:

  • --input, -i:输入带有RNA序列的FASTA文件(必填)
  • --output, -o:结果输出文件(默认:打印到stdout)
  • --descriptor:描述符文件名(默认值:trna.descr)
  • --strict:使用严格搜索模式
  • --verbose, -v:启用详细输出

IRE搜索

# IRE search with scoring
python scripts/ire_search.py \
  --input examples/data/ecoli_test.fastn \
  --min-score 0.5 \
  --max-results 10 \
  --output results/ire_scored.txt \
  --verbose

参数:

  • --input, -i:输入FASTA文件(必填)
  • --min-score:最低分数阈值0.0-1.0(默认值:0.0)
  • --max-results:最大结果数(默认值:无限制)
  • --output, -o:结果输出文件
  • --verbose, -v:启用详细输出

格式化结果

# Format results for viewing
python scripts/format_results.py rmfmt results.txt \
  --format view \
  --output formatted_view.txt \
  --verbose

# Prune redundant results
python scripts/format_results.py rmprune results.txt \
  --output pruned_results.txt

# Convert to CT format
python scripts/format_results.py rm2ct results.txt \
  --output structures.ct

参数:

  • tool:工具名称(rmfmt、rmprune、rm2ct)(必填)
  • input_file:要处理的RNAMotif输出文件(必需)
  • --format:rmfmt的格式类型(视图、对齐、两者)
  • --sort-max:用于排序的最大内存(MB)
  • --output, -o:结果输出文件
  • --verbose, -v:启用详细输出

______________________________________________________________________

MCP服务器安装

选项1:使用fastmcp(推荐)

# Install MCP server for Claude Code
fastmcp install src/server.py --name rnamotif

选项2:Claude代码的手动安装

# Add MCP server to Claude Code
claude mcp add rnamotif -- $(pwd)/env/bin/python $(pwd)/src/server.py

# Verify installation
claude mcp list

选项3:在settings.json中配置

增添 ~/.claude/settings.json:

{
  "mcpServers": {
    "rnamotif": {
      "command": "/home/xux/Desktop/NucleicMCP/NucleicMCP/tool-mcps/rnamotif_mcp/env/bin/python",
      "args": ["/home/xux/Desktop/NucleicMCP/NucleicMCP/tool-mcps/rnamotif_mcp/src/server.py"]
    }
  }
}

______________________________________________________________________

使用Claude代码

安装MCP服务器后,您可以直接在Claude Code中使用它。

快速开始

# Start Claude Code
claude

示例提示

工具发现

What tools are available from rnamotif?

基本用法

Use search_trna_motifs with input_file @examples/data/ecoli_test.fastn and descriptor "trna.general.descr"

与评分

Use search_ire_motifs on @examples/data/ecoli_test.fastn with min_score 0.5 and max_results 10

格式化结果

Use format_search_results with tool "rmfmt", input_file @results/trna_output.txt, and format_type "view"

长期运行任务(提交API)

Submit comprehensive motif search for @examples/data/ecoli_large.fastn
Then check the job status

批处理

Process these files in batch for tRNA motifs:
- @examples/data/ecoli_test.fastn
- @examples/data/ecoli_small.fastn
- @examples/data/test_sequences.fastn

使用@引用

在克劳德代码中,使用 @ 引用文件和目录:

参考说明
@examples/data/ecoli_test.fastn参考特定的FASTA文件
@configs/trna_search_config.json引用配置文件
@results/参考输出目录

______________________________________________________________________

与Gemini CLI一起使用

配置

增添 ~/.gemini/settings.json:

{
  "mcpServers": {
    "rnamotif": {
      "command": "/home/xux/Desktop/NucleicMCP/NucleicMCP/tool-mcps/rnamotif_mcp/env/bin/python",
      "args": ["/home/xux/Desktop/NucleicMCP/NucleicMCP/tool-mcps/rnamotif_mcp/src/server.py"]
    }
  }
}

示例提示

# Start Gemini CLI
gemini

# Example prompts (same as Claude Code)
> What tools are available?
> Use search_trna_motifs with file examples/data/ecoli_test.fastn

______________________________________________________________________

可用工具

快速操作(同步API)

这些工具会立即返回结果(\10分钟或批处理):

工具说明参数
submit_batch_trna_search批量tRNA搜索多个文件input_files, descriptor, output_dir, job_name
submit_batch_ire_search批量IRE搜索多个文件input_files, min_score, max_results, output_dir, job_name
submit_batch_pseudoknot_search批量伪结搜索input_files, pk_type, output_dir, job_name
submit_batch_hairpin_search批量发夹搜索input_files, hairpin_type, output_dir, job_name
submit_comprehensive_motif_search在一个文件上运行所有搜索类型input_file, search_types, output_dir, job_name

作业管理工具

工具说明
get_job_status检查作业进度和状态
get_job_result完成后获取结果
get_job_log查看执行日志
cancel_job取消正在运行的作业
list_jobs列出所有具有可选筛选的作业

______________________________________________________________________

例子

示例1:tRNA分析

目标: 在大肠杆菌序列中发现tRNA苜蓿叶状结构

使用脚本:

python scripts/trna_search.py \
  --input examples/data/ecoli_test.fastn \
  --descriptor trna.general.descr \
  --output results/ecoli_trna/ \
  --verbose

使用MCP(克劳德代码):

Use search_trna_motifs to process @examples/data/ecoli_test.fastn with descriptor "trna.general.descr" and save results to results/ecoli_trna/

预期产量:

  • tRNA与结构注释匹配
  • 三叶草次生结构模式
  • 匹配位置和信心得分

示例2:IRE主题发现

目标: 查找得分较高的铁反应元素

使用脚本:

python scripts/ire_search.py \
  --input examples/data/ecoli_test.fastn \
  --min-score 0.5 \
  --max-results 20 \
  --output results/ire_analysis.txt \
  --verbose

使用MCP(克劳德代码):

Run search_ire_motifs on @examples/data/ecoli_test.fastn with min_score 0.5 and max_results 20

预期产量:

  • 具有质量分数的IRE茎环结构
  • 筛选结果高于最小阈值
  • 分数分布统计

示例3:综合主题分析

目标: 在序列集上运行所有搜索类型

使用脚本:

python scripts/comprehensive_search.py \
  --input examples/data/test_sequences.fastn \
  --search-types trna ire pseudoknot hairpin \
  --output results/comprehensive/

使用MCP(克劳德代码):

Submit comprehensive motif search for @examples/data/test_sequences.fastn with all search types

预期产量:

  • 所有主题搜索算法的结果
  • 不同母题类型的比较分析
  • 摘要统计和可视化

示例4:批处理

目标: 一次处理多个文件

使用脚本:

for f in examples/data/*.fastn; do
  python scripts/trna_search.py --input "$f" --output results/batch/
done

使用MCP(克劳德代码):

Submit batch tRNA search for all FASTA files in @examples/data/

预期产量:

  • 每个输入文件的结果
  • 所有文件的聚合统计信息
  • 作业跟踪和进度监控

工作流示例

快速分析(同步API)

1. Use search_trna_motifs with input_file "examples/data/ecoli_test.fastn"
   → Returns: {"status": "success", "result": {...}, "metadata": {...}}

2. Use format_search_results with tool "rmfmt" and input_file from step 1
   → Returns: Formatted view of tRNA matches

长期运行批处理作业(提交API)

1. Submit: Use submit_batch_trna_search with input_files ["file1.fastn", "file2.fastn", "file3.fastn"]
   → Returns: {"job_id": "abc123", "status": "submitted"}

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

3. Monitor: Use get_job_log with job_id "abc123"
   → Returns: {"log_lines": ["Processing file1.fastn...", ...]}

4. Result: Use get_job_result with job_id "abc123"
   → Returns: {"status": "success", "result": {...}} when completed

综合分析

1. Submit: Use submit_comprehensive_motif_search with input_file "large_genome.fastn"
   → Returns: {"job_id": "xyz789", "status": "submitted"}

2. Monitor: Use get_job_status with job_id "xyz789" (check periodically)
   → Returns: Status updates as each search completes

3. Result: Use get_job_result with job_id "xyz789"
   → Returns: Complete analysis with all motif types found

______________________________________________________________________

演示数据

examples/data/ 目录包含用于测试的示例数据:

文件描述使用大小
ecoli_test.fastn用于快速检测的小型大肠杆菌序列所有搜索工具~50KB
ecoli_small.fastn中等大小的大肠杆菌序列批量测试~3MB
ecoli_large.fastn大型大肠杆菌序列集提交API检测~5.6MB
ecoli_genome.fastn完整的大肠杆菌基因组序列综合分析~5.6MB
test_sequences.fastn一般测试序列快速验证~1KB
sample_sequences.fastnGenBank RNA序列常规检测~2.6MB
*.descr主题定义的描述符文件搜索配置各种

______________________________________________________________________

配置文件

configs/ 目录包含配置模板:

配置描述参数
default_config.json所有脚本的基本设置常见超时、路径、验证
trna_search_config.jsontRNA特定设置描述符选项、性能说明
ire_search_config.jsonIRE特定设置评分参数、过滤选项
pseudoknot_search_config.json伪结设置类型映射,复杂性注释
hairpin_search_config.json发夹设置类型描述、评分变体
format_results_config.json格式化工具设置工具参数、工作流建议

配置示例

{
  "timeout": 300,
  "max_filesize_mb": 100,
  "descriptor_search_paths": [
    "examples/data/",
    "repo/rnamotif/test/",
    "repo/rnamotif/descr/",
    "repo/rnamotif/Ecoli.trna.example/"
  ],
  "output_format": "text",
  "verbose": false
}

______________________________________________________________________

故障排除

环境问题

问题: 未找到环境

# Recreate environment
mamba create -p ./env python=3.10 -y
mamba activate ./env
pip install fastmcp loguru click pandas numpy tqdm

问题: 导入错误

# Verify installation
python -c "from src.server import mcp"

问题: 未找到RNAMotif工具

# Rebuild C tools
cd repo/rnamotif
make clean && make
cd ../..

MCP问题

问题: 在Claude代码中找不到服务器

# Check MCP registration
claude mcp list

# Re-add if needed
claude mcp remove rnamotif
claude mcp add rnamotif -- $(pwd)/env/bin/python $(pwd)/src/server.py

问题: 工具不工作

# Test server directly
mamba run -p ./env python -c "
from src.server import mcp
print('Server loaded successfully')
"

工作问题

问题: 作业挂起

# Check job directory
ls -la jobs/

# View job log
Use get_job_log with job_id "" to see details

问题: 作业失败

# Check logs for error details
Use get_job_log with job_id "" and tail 100 to see error details

常见错误消息

“找不到文件”:检查输入文件路径是否正确以及文件是否存在 “描述符无效”:确保描述符文件存在于搜索路径中 “超时”:大型文件可能需要提交API,而不是同步API “FASTA格式无效”:验证输入文件是否包含有效的RNA/DNA序列

______________________________________________________________________

发展

运行测试

# Activate environment
mamba activate ./env

# Test individual scripts
python scripts/trna_search.py --help
python scripts/trna_search.py --input examples/data/ecoli_test.fastn --verbose

# Test MCP server
mamba run -p ./env fastmcp dev src/server.py

正在启动开发服务器

# Run MCP server in development mode
fastmcp dev src/server.py

使用Claude代码进行测试

# Add development server
claude mcp add rnamotif-dev -- $(pwd)/env/bin/python $(pwd)/src/server.py

# Test tools
claude
# Then: "What tools are available from rnamotif?"

______________________________________________________________________

业绩说明

预期执行时间

  • 小文件 (\1000个序列):使用submit API进行后台处理

内存使用

  • 典型用法:每次搜索40-50MB
  • 大型数据集:高达200MB
  • 环境:总计约1.2GB

优化提示

  1. 使用特定的描述符(例如“trna.general.descr”)以获得更好的性能
  2. 为IRE搜索设置合理的min_score值以减少结果
  3. 对多个文件使用批处理操作以利用并行化
  4. 监控作业日志,了解长时间运行的任务的进度更新

______________________________________________________________________

许可证

基于 Rnamotif David A.Case等人。

学分

  • Rnamotif:原始的基于C的RNA二级结构搜索工具
  • FastMCP:用于工具集成的模型上下文协议框架
  • NucleicMCP:核酸序列分析工具的综合套件

目录标签

目录标签

PythonClaude生物信息学RNA分析本地部署二级结构搜索tRNA搜索IRE搜索

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

15

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP