使用说明
基因组MCP
通过模型上下文协议实现人工智能驱动的基因组智能
基因组MCP 是研究级 模型上下文协议(MCP)服务器 这使人工智能代理能够查询临床基因组学数据库,检索支持科学文献,分析群体遗传学,并可视化生物途径——所有这些都是实时的。
🖥️ CLI工具
GenomeMCP包括一个漂亮的命令行界面,具有丰富的格式和交互式TUI模式。
快速安装
# Recommended (any platform with Python)
pipx install genomemcp
# macOS (Homebrew)
brew install nexisdev/tap/genomemcp
# Windows (Scoop)
scoop bucket add genomemcp https://github.com/nexisdev/scoop-genomemcp
scoop install genomemcp
# From source
git clone https://github.com/nexisdev/GenomeMCP.git
cd GenomeMCP && ./install.sh
独立二进制文件 可用的 GitHub发布.
CLI命令
genomemcp search BRCA1 # 🔍 Search ClinVar
genomemcp variant 12345 # 📋 Get variant report
genomemcp gene TP53 # 🧬 Get gene info
genomemcp pathway EGFR --visualize # 🔬 Pathway analysis
genomemcp population 1-55516888-G-GA # 👥 gnomAD frequencies
genomemcp discover "Lynch Syndrome" # 🔗 Discover related genes
genomemcp tui # 🖥️ Interactive mode
主题选项
genomemcp --theme cyberpunk search BRCA1
genomemcp --theme professional gene TP53
genomemcp --theme minimal pathway EGFR
看 CLI指南 以获取完整的文档。
🎯 为什么选择GenomeMCP?
| 问题 | 基因组MCP解决方案 |
|---|---|
| AI代理缺乏基因组知识 | 直接ClinVar、gnomAD、Reactome集成 |
| 没有临床声明的证据 | 自动检索PubMed摘要 |
| 变体解释很复杂 | 群体频率+途径背景 |
| 基因-疾病联系不透明 | 自动关系发现 |
🧬 特性
核心基因组学工具
search_clinvar(term)--向ClinVar查询基因、变异或疾病get_variant_report(id)--详细的临床意义报告get_gene_info(symbol)--NCBI基因的基因功能、位置和别名get_supporting_literature(id)--PubMed文章链接到变体
群体遗传学
get_population_stats(variant)--来自gnomAD(基因组聚集数据库)的等位基因频率
通路分析
get_pathway_info(gene)--基因的反应组生物途径visualize_pathway(gene)--生成基因通路关系的Mermaid.js图
发现与合成
find_related_genes(phenotype)--发现与疾病相关的基因get_genomic_context(gene, position)--识别外显子与内含子区域get_discovery_evidence(phenotype)--用于人工智能推理的PubMed摘要汇总
🚀 快速开始
MCP服务器安装
# Clone the repository
git clone https://github.com/nexisdev/GenomeMCP.git
cd GenomeMCP
# Install dependencies with uv
uv sync
# Run the MCP server
uv run python src/main.py
CLI安装
# Using the install script
./install.sh
# Or with pip
pip install genomemcp[cli]
# Or for development
./setup-dev.sh
source .venv/bin/activate
Claude桌面集成
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"genomemcp": {
"command": "uv",
"args": [
"--directory",
"/path/to/GenomeMCP",
"run",
"python",
"src/main.py"
]
}
}
}
### ☁️ Cloud Deployment (Railway)
You can deploy the GenomeMCP server to the cloud with one click. It will be exposed as an SSE (Server-Sent Events) endpoint, ready for remote agents.
1. Click the **Deploy on Railway** button above.
2. Provide your `SUPABASE_URL` and `SUPABASE_KEY` (optional, for persistence).
3. Connect your agent to the deployment URL (e.g. `https://your-app.up.railway.app/sse`).
---
## 📖 Usage Examples
### Search for a Gene Variant
用户:“哪些变异与BRCA1有关?” 代理使用:search_clinvar(“BRCA1”)
### Get Population Frequency
用户:“变体1-55516888-G-GA有多常见?” 代理使用:get_population_stats(“1-55516888-G-GA”) → 返回gnomAD等位基因频率:0.000123(0.01%)
### Discover Gene-Disease Relationships
用户:“哪些基因与林奇综合征有关?” 试剂用途:查找相关基因(“林奇综合征”) → 返回:MSH2(12个变体)、MLH1(8个变体)和PMS2(5个变体)
### Visualize Pathways
用户:“显示TP53的路径” 代理使用:可视化路径(“TP53”) → 返回美人鱼图:
```mermaid
graph TD
TP53((TP53))
TP53 --> P_123["Transcriptional Regulation by TP53"]
TP53 --> P_456["Cell Cycle Checkpoints"]
TP53 --> P_789["DNA Damage Response"]
🔬 数据源
| 来源 | 说明 | API |
|---|---|---|
| 克林瓦尔 | 临床变异解释 | NCBI电子工具 |
| gnomAD | 群体等位基因频率 | gnomAD-GraphQL |
| 反应组 | 生物途径数据库 | 反应组内容服务 |
| PubMed | 科学文献 | NCBI电子公用事业 |
| NCBI基因 | 基因注释 | NCBI电子工具 |
🏗️ 建筑
GenomeMCP/
├── src/
│ ├── main.py # MCP server & tool definitions
│ ├── clinvar.py # ClinVar & PubMed API client
│ ├── genomics.py # Exon/Intron mapping
│ ├── population.py # gnomAD integration
│ ├── pathways.py # Reactome integration
│ ├── utils.py # Shared utilities
│ └── cli/ # Command-line interface
│ ├── app.py # Typer CLI application
│ ├── formatters/ # Rich output formatters
│ ├── tui/ # Textual interactive UI
│ └── config.py # Theme configuration
├── tests/ # Unit tests
├── docs/ # Documentation
├── install.sh # Quick install script
├── setup-dev.sh # Development setup
└── pyproject.toml # Project configuration
🧪 测试
# Run all tests
uv run pytest
# Run CLI tests
uv run pytest tests/test_cli.py -v
# Run specific test suite
uv run pytest tests/test_phase4.py tests/test_phase5.py
📚 文档
🤝 贡献
欢迎投稿!请打开问题或提交拉取请求。
📄 许可证
MIT许可证——见 许可证 了解详情。
🔗 关键词
genomics bioinformatics clinvar gnomad mcp model-context-protocol ai-agent claude variant-interpretation population-genetics reactome pathway-analysis pubmed ncbi gene-discovery clinical-genomics precision-medicine llm-tools cli tui terminal
Built for AI agents. Powered by open genomic data.