这是一个功能全面的模型上下文协议(MCP)服务器,它公开了 Ensembl 的 REST API。该服务器使用 TypeScript MCP SDK 构建。
本服务器提供了一系列工具,可用于获取基因信息、搜索基因、检索序列等。以下是一些常见的使用场景:
你可以选择以下首选的安装方法:
# claude:
npx -y @smithery/cli@latest install @effieklimi/ensembl-mcp-server --client claude --key your-smithery-secret-key
# cursor:
npx -y @smithery/cli@latest install @effieklimi/ensembl-mcp-server --client cursor --key your-smithery-secret-key
# vscode:
npx -y @smithery/cli@latest install @effieklimi/ensembl-mcp-server --client vscode --key your-smithery-secret-key
# windsurf:
npx -y @smithery/cli@latest install @effieklimi/ensembl-mcp-server --client windsurf --key your-smithery-secret-key
你可以查看 MCP 的 Smithery 链接以获取更多平台选项。
对于开发或自定义设置:
git clone https://github.com/effieklimi/ensembl-mcp-server.git
cd ensembl-mcp-server
npm install
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json添加以下服务器配置:
{
"mcpServers": {
"ensembl": {
"command": "npm",
"args": ["run", "start"],
"cwd": "/absolute/path/to/ensembl-mcp-server"
}
}
}
# 热重载开发
npm run dev
# 运行测试
npm test
# 生产构建(可选)
npm run build
npm run start:prod
ensembl_feature_overlap查找与某个区域或另一个特征重叠的基因、转录本或调控元件。
GET /overlap/region/:species/:region
GET /overlap/id/:id
典型查询:“哪些基因位于 17 号染色体的 43 - 44 Mb 区域?” – “与 BRCA1 重叠的有哪些?”
ensembl_regulatory调控特征、结合矩阵及相关注释。
GET /overlap/region/:species/:region (with regulatory filters)
GET /overlap/translation/:id (regulatory features on proteins)
GET /species/:species/binding_matrix/:binding_matrix_stable_id
使用场景:转录因子结合位点、调控注释。
ensembl_protein_features蛋白质水平的结构域和功能位点。
GET /overlap/translation/:id
使用场景:蛋白质结构域、信号肽、催化残基。
ensembl_meta服务器元数据、物种列表、版本信息和诊断信息。
GET /info/ping
GET /info/rest
GET /info/software
GET /info/data
GET /info/species
GET /info/divisions
GET /info/assembly/:species
GET /info/biotypes/:species
GET /info/analysis/:species
GET /info/external_dbs/:species
GET /info/variation/:species
GET /archive/id/:id
POST /archive/id
典型查询:“人类有哪些组装版本?” – 服务器健康检查。
ensembl_lookup转换 ID 与符号,获取交叉引用,重新编码变异。
GET /lookup/id/:id
GET /lookup/symbol/:species/:symbol
POST /lookup/id
POST /lookup/symbol
GET /xrefs/id/:id
GET /xrefs/symbol/:species/:symbol
GET /xrefs/name/:species/:name
GET /variant_recoder/:species/:id
POST /variant_recoder/:species
使用场景:“BRCA1 的 Ensembl ID 是什么?” – 交叉引用 UniProt。
ensembl_sequence检索 DNA、RNA 或蛋白质序列。
GET /sequence/id/:id
GET /sequence/region/:species/:region
POST /sequence/id
POST /sequence/region
使用场景:基因 FASTA 序列、转录本 cDNA、基因组区域。
ensembl_mapping坐标转换(基因组 ↔ cDNA/CDS/蛋白质)和组装提升。
GET /map/cdna/:id/:region
GET /map/cds/:id/:region
GET /map/translation/:id/:region
GET /map/:species/:asm_one/:region/:asm_two
使用场景:将 CDS 映射到 GRCh38,将蛋白质坐标转换为基因组坐标。
ensembl_compara比较基因组学 — 同源性、基因树、比对。
GET /homology/id/:species/:id
GET /homology/symbol/:species/:symbol
GET /genetree/id/:id
GET /genetree/member/symbol/:species/:symbol
GET /genetree/member/id/:species/:id
GET /cafe/genetree/id/:id
GET /cafe/genetree/member/symbol/:species/:symbol
GET /cafe/genetree/member/id/:species/:id
GET /alignment/region/:species/:region
使用场景:查找直系同源物、构建系统发育树、提取物种比对。
ensembl_variation变异查找、VEP 后果、连锁不平衡(LD)、表型映射。
GET /variation/:species/:id
GET /variation/:species/pmcid/:pmcid
GET /variation/:species/pmid/:pmid
POST /variation/:species
GET /vep/:species/hgvs/:hgvs_notation
POST /vep/:species/hgvs
GET /vep/:species/id/:id
POST /vep/:species/id
GET /vep/:species/region/:region/:allele
POST /vep/:species/region
GET /ld/:species/:id/:population_name
GET /phenotype/variant/:species/:id
GET /phenotype/region/:species/:region
GET /transcript_haplotypes/:species/:id
使用场景:VEP 预测、LD 块、表型关联。
ensembl_ontotax本体术语搜索和 NCBI 分类学遍历。
GET /ontology/id/:id
GET /ontology/name/:name
GET /taxonomy/id/:id
GET /taxonomy/name/:name
使用场景:GO 术语查找、表型本体、分类学分类。
要通过 Smithery 自动为 Claude Desktop 安装 ensembl-mcp-server,请使用以下命令:
npx -y @smithery/cli install @effieklimi/ensembl-mcp-server --client claude
本项目使用 TypeScript MCP SDK 构建,全程使用 TypeScript,具备强大的错误处理能力和简洁的 API 客户端层。通过将工具按生物任务分组,而非按底层 REST 路径分组,提高了对生物学家的友好性。
以下是一个使用 ensembl_feature_overlap 工具查找特定区域重叠基因的示例:
GET /overlap/region/human/chr17:43-44Mb
如果你需要同时使用多个工具进行复杂的查询,可以结合不同工具的端点进行调用。例如,先使用 ensembl_lookup 工具获取基因 ID,再使用 ensembl_sequence 工具检索该基因的序列:
# 获取基因 ID
GET /lookup/symbol/human/BRCA1
# 使用获取的 ID 检索序列
GET /sequence/id/
我们非常欢迎你的帮助!以下是开始贡献的步骤:
git clone https://github.com/YOUR_USERNAME/ensembl-mcp-server.git
cd ensembl-mcp-server
npm install
npm test
npm run dev
npm run dev - 热重载开发npm run start - 运行服务器npm test - 运行所有测试npm run build - 编译 TypeScript(可选)npm run start:prod - 运行编译后的版本