植物基因拷贝MCP服务器
用于结构化植物基因组学研究的轻量级开源MCP(模型上下文协议)前端。\ 它连接到后端MCP服务器,该服务器为基因查找、标识符规范化、多源注释检索(NCBI/UniProt/KEGG/InterPro/Pfam)、基因组定位(GFF衍生)和文献搜索(PubMed)提供统一的功能风格工具,使LLM代理能够以一致和可重复的方式访问植物基因组知识。
主要特点
- 用于植物功能基因组学工作流程的统一MCP工具接口
- 基因中心检索:基因搜索、ID规范化、跨数据库别名
- 注释整合:NCBI基因、UniProt、KEGG、InterPro+Pfam/CDD/SMART映射
- 基因组背景:染色体坐标、邻近基因、基因组位置可视化
- 通过STRING实现蛋白质相互作用(分辨率、网络、富集)
- PubMed文献检索(基础+高级查询+文章详情)
- 专为工具增强的LLM试剂和可重复的生物信息学管道而设计
建筑
此存储库提供MCP前端(MCP工具客户端)。\ 后端MCP服务器(除非添加,否则不包括在内)将MCP工具调用桥接到中间API服务和底层MySQL存储库。
高水位流量
- MCP前端(此仓库)
- MCP服务器端点(工具定义)
- 中介API服务(查询优化+数据完整性)
- MySQL知识库+外部资源集成
后端知识库(供参考)
- 功能知识库(9个表;1535469条记录)
- genes, main_entry, uniprot, kegg_details, ncbi_gene_details, interpro_main, interpro_pfam, interpro_cdd, interpro_smart
- 注释模块/GFF数据库(7个物种表;294808条记录)
- GFF衍生的基因特征: *拟南芥*, *玉米*, *番茄*, *黑杨*, *毛果杨*, *水稻。粳稻*, *地钱*
- 总计: 16张桌子;1830277条记录(约1.83米)
工具列表(MCP功能)
1) 基因查找和标识符规范化
geneSearch(gene_name, extended_search=false)\
按符号/名称/gene_id搜索基因;支持以分隔的多个查询 ;.\ 返回精选的基因记录和RefSeq链接(如果可用)。
fetchGeneId(gene_name)\
解析基因名称→ gene_id(s)。
entrezgeneId(gene_id)\
转换内部gene_id(例如。, AT1G01060) → NCBI Entrez基因数字ID(NCBI工具要求)。
fetchExternaldbs(gene_id, max_results=10, compact=true)\
从NCBI映射中检索别名/同义词和跨数据库标识符(TAIR/Araport/等)。
2) 基因组注释和定位(GFF)
fetchGffAnnotation(gene_id)\
返回染色体坐标、基因组邻域上下文和基因组位置可视化URL。
3) NCBI基因:结构和转录本
fetchNcbiInfo(entrezgene_id)\
NCBI基因的基因摘要和外显子-内含子结构可视化(图像链接)。
fetchGeneStructureDetails(entrezgene_id)\
用于选择性剪接分析的转录子/外显子/内含子坐标细节。
4) UniProt蛋白质元数据
fetchUniprotEntry(gene_id, extentional_search=false)\
解析gene_id→ UniProt条目。
fetchUniprotDetails(entries)\
检索条目的详细UniProt注释(包括UniProt链接)。
5) KEGG功能注释
fetchKeggInfo(kegg_id)\
检索通路、正构学、GO术语、酶/反应和DB链接。
6) InterPro/Pfam域和族注释
fetchInterpro(interpro)\
InterPro参赛详情。
fetchPfam(pfam)\
Pfam域详细信息。
7) PubMed文献检索
fetchPmid(query, max_results=20)\
PubMed基本查询→ PMIDs和头衔。
pubmedAdvancedSearch(query, page=1, sort="relevance", date_from="", date_to="", article_type="")\
带分页和过滤器的高级PubMed搜索。
fetchDetails(pmid)\
检索PMID列表的完整文章元数据(标题/作者/摘要/DOI/等)。
8) STRING蛋白质相互作用实用程序
stringQuerySpecies(species_text)\
解决STRING的物种名称/分类单元提示。
stringResolveProteins(proteins, species, show_sequence)\
地图标识符→ 字符串ID。
stringInteractionsQuerySet(proteins, species, required_score, network_type, extend_network)\
获取给定查询集之间的交互。
stringAllInteractionPartners(identifiers, species, required_score, network_type)\
检索所有伴侣的蛋白质。
stringEnrichment(proteins, species)\
蛋白质列表上的功能富集。
stringFunctionalAnnotation(identifiers, species)\
检索功能注释。
stringVisualNetwork(proteins, species, required_score, network_type, network_flavor, extend_network, hide_disconnected_nodes)\
生成网络图像URL。
stringNetworkLink(proteins, species, required_score, network_type, network_flavor, extend_network, hide_disconnected_nodes)\
生成交互式网络链接。
stringInteractionEvidence(identifier_a, identifiers_b, species)\
边缘证据页。
stringHomology(proteins, species, species_b)\
同源查找。
stringPpiEnrichment(identifiers, species, required_score)\
检查PPI浓度。
stringProteinsForTerm(species, term_text)\
用给定功能术语注释的蛋白质。
stringSequenceSearch(sequences, species)\
STRING中基于序列的查找。
stringEnrichmentImageUrl(identifiers, species, category)\
扩展图URL。
stringHelp(topic)\
STRING工具功能的帮助。
9) 服务健康
checkInitialization()\
后端服务是否已初始化且可访问。
快速开始
创建一个虚拟环境 uv 并安装 requirements.txt
# 1) Install uv
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
#Using pip
pip install uv
# 2) Go to your project directory
cd /path/to/your/project
# 3) Create a virtual environment (defaults to .venv)
uv venv
# 4) Activate the environment
# macOS / Linux
source .venv/bin/activate
# Windows (PowerShell)
.venv\Scripts\Activate.ps1
# 5) Install dependencies
uv pip install -r requirements.txt
# 6) Verify
python -V
python -c "import sys; print(sys.executable)"
# 7)Configration
Config your NCBI api key
# 8)Run
python mcp_server.py