非官方NCBI数据集MCP服务器
模型上下文协议(MCP)服务器,提供对NCBI数据集API的全面访问。该服务器通过31个专用工具与NCBI的大量基因组、分类和生物数据无缝集成。
由开发 增强自然
特性
- 31种综合工具 涵盖所有主要的NCBI数据集功能
- 9个有组织的类别 生物数据操作
- 资源模板 用于基于URI的直接数据访问
- 完整的TypeScript实现 通过适当的错误处理
- 速率限制和缓存 为了获得最佳性能
- 环境变量配置 对于API密钥
安装
npm install
npm run build配置
环境变量
NCBI_API_KEY(可选):您的NCBI API密钥用于更高的速率限制和优先级访问
MCP配置
添加到MCP设置中:
{
"mcpServers": {
"ncbi-datasets-server": {
"command": "node",
"args": ["/path/to/ncbi-datasets-server/build/index.js"],
"env": {
"NCBI_API_KEY": "your_api_key_here"
}
}
}
}可用工具
🧬 基因组操作
search_genomes-按生物体、关键字或标准搜索基因组组装get_genome_info-获取特定基因组组装的详细信息get_genome_summary-获取基因组组装的汇总统计数据
🧬 基因手术
search_genes-按符号、名称、生物体或位置搜索基因get_gene_info-获取特定基因的详细信息get_gene_sequences-检索特定基因的序列
🏷️ 分类操作
search_taxonomy-按生物名称搜索分类信息get_taxonomy_info-获取分类群的详细分类信息get_organism_info-获取特定生物体的信息和数据集
🏗️ 装配操作
search_assemblies-通过详细过滤搜索基因组组装get_assembly_info-获取程序集的详细元数据和统计信息get_assembly_reports-获取装配质量报告和验证信息download_genome_data-获取基因组数据文件的下载URLbatch_assembly_info-获取多个程序集的信息
🦠 病毒操作
search_virus_genomes-搜索病毒基因组组装get_virus_info-获取病毒基因组的详细信息
🧪 蛋白质操作
search_proteins-按名称或功能搜索蛋白质序列get_protein_info-获取特定蛋白质的详细信息
📝 注释操作
get_genome_annotation-获取程序集的注释信息search_genome_features-搜索特定的基因组特征
🔬 比较基因组学
compare_genomes-比较两个或多个基因组组装find_orthologs-在生物体内寻找直系同源基因
🧬 顺序操作
get_sequence_data-检索基因组/基因/蛋白质的序列数据blast_search-对NCBI数据库执行BLAST搜索
🌳 系统发育操作
get_phylogenetic_tree-获取生物体的系统发育树数据get_taxonomic_lineage-获得完整的分类谱系
📊 统计操作
get_database_stats-获取NCBI数据集内容的统计信息search_by_bioproject-按BioProject登录搜索数据集search_by_biosample-按BioSample登录搜索数据集
✅ 质量控制
get_assembly_quality-获取基因组组装的质量指标validate_sequences-验证序列数据并检查问题
使用示例
基因组分析
// Search for E. coli genomes
{
"tool": "search_genomes",
"arguments": {
"tax_id": 511145,
"assembly_level": "complete",
"max_results": 10
}
}
// Get detailed genome information
{
"tool": "get_genome_info",
"arguments": {
"accession": "GCF_000005845.2",
"include_annotation": true
}
}
// Get genome summary statistics
{
"tool": "get_genome_summary",
"arguments": {
"accession": "GCF_000005845.2"
}
}基因研究
// Search for BRCA1 gene
{
"tool": "search_genes",
"arguments": {
"gene_symbol": "BRCA1",
"organism": "Homo sapiens",
"max_results": 5
}
}
// Get detailed gene information
{
"tool": "get_gene_info",
"arguments": {
"gene_id": 672,
"include_sequences": true
}
}
// Get gene sequences
{
"tool": "get_gene_sequences",
"arguments": {
"gene_id": 672,
"sequence_type": "transcript"
}
}范畴理论
// Search taxonomy by organism name
{
"tool": "search_taxonomy",
"arguments": {
"query": "Escherichia coli",
"max_results": 10
}
}
// Get detailed taxonomic information
{
"tool": "get_taxonomy_info",
"arguments": {
"tax_id": 511145,
"include_lineage": true
}
}
// Get organism information
{
"tool": "get_organism_info",
"arguments": {
"organism": "Escherichia coli"
}
}装配操作
// Search assemblies with filtering
{
"tool": "search_assemblies",
"arguments": {
"query": "human",
"assembly_level": "chromosome",
"assembly_source": "refseq",
"max_results": 20
}
}
// Get assembly information
{
"tool": "get_assembly_info",
"arguments": {
"assembly_accession": "GCF_000001405.40",
"include_annotation": true
}
}
// Batch assembly lookup
{
"tool": "batch_assembly_info",
"arguments": {
"accessions": ["GCF_000001405.40", "GCF_000005825.2", "GCF_000002305.1"]
}
}比较基因组学
// Compare multiple genomes
{
"tool": "compare_genomes",
"arguments": {
"accessions": ["GCF_000005845.2", "GCF_000001405.40"],
"comparison_type": "basic_stats",
"include_orthologs": true
}
}
// Find orthologous genes
{
"tool": "find_orthologs",
"arguments": {
"gene_symbol": "BRCA1",
"source_organism": "Homo sapiens",
"target_organisms": ["Mus musculus", "Rattus norvegicus"],
"similarity_threshold": 80
}
}病毒研究
// Search viral genomes
{
"tool": "search_virus_genomes",
"arguments": {
"virus_name": "SARS-CoV-2",
"host": "Homo sapiens",
"max_results": 50
}
}
// Get viral genome information
{
"tool": "get_virus_info",
"arguments": {
"accession": "NC_045512.2",
"include_proteins": true,
"include_metadata": true
}
}资源模板
服务器提供用于直接数据访问的资源模板:
ncbi://genome/{accession}-完整的基因组组装信息ncbi://gene/{gene_id}-带注释的基因信息ncbi://taxonomy/{tax_id}-分类学分类和谱系ncbi://assembly/{assembly_accession}-程序集元数据和统计数据ncbi://search/{data_type}/{query}-指定查询的搜索结果
API费率限制
- 没有API密钥:每秒3个请求
- 带API键:每秒10个请求,具有优先访问权限
要获取API密钥,请访问:https://www.ncbi.nlm.nih.gov/account/settings/
错误处理
服务器实现了全面的错误处理:
- 网络错误:使用指数回退自动重试
- 速率限制:智能请求排队和限制
- 无效参数:清除验证错误消息
- API错误:带上下文的详细错误报告
数据源
此服务器从以下位置访问数据:
- NCBI数据集API v2:原始基因组和组装数据
- 分类学:分类学分类和谱系
- NCBI基因:基因注释和序列
- NCBI组装:装配元数据和质量指标
- NCBI生物项目/生物样本:项目和样品信息
许可证
MIT许可证-有关详细信息,请参阅许可证文件。
贡献
欢迎投稿!请随时提交问题、功能请求或拉取请求。
支持
关于以下问题:
- 服务器功能:在此存储库中打开一个问题
- NCBI 数据:查阅NCBI数据集文档
- API访问:联系NCBI支持部门了解API相关问题
