Biomart MCP
与 Biomart 接口的 MCP 服务器
模型上下文协议(MCP) 是一个开放协议,它标准化了应用程序如何向Anthropic开发的 LLM 提供上下文。在这里,我们使用MCP python-sdk创建一个 MCP 服务器,该服务器通过pybiomart包与 Biomart 交互。
有一个简短的演示视频展示了 MCP 服务器在 Claude Desktop 上的运行情况。
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 Biomart MCP:
克隆存储库
克劳德桌面
光标
通过 Cusror 的代理模式,其他模型也可以利用 MCP 服务器,例如来自 OpenAI 或 DeepSeek 的服务器。点击光标设置齿轮,导航至MCP
,将 MCP 服务器添加到全局配置,或通过在项目中添加.cursor/mcp.json
将其添加到项目范围。
示例.cursor/mcp.json
:
格拉玛
发展
特征
Biomart-MCP 提供了几种与 Biomart 数据库交互的工具:
- 集市和数据集发现:列出可用的集市和数据集,以探索 Biomart 数据库结构
- 属性和过滤器探索:查看特定数据集的常见或所有可用属性和过滤器
- 数据检索:使用特定属性和过滤器查询 Biomart 以获取生物数据
- ID 翻译:在不同的生物标识符之间进行转换(例如,基因符号到 Ensembl ID)
贡献
欢迎提交 Pull 请求!开发过程中的一些小提示:
- 我们在这里仅使用
@mcp.tool()
,这是为了最大限度地提高与支持 MCP 的客户端的兼容性,如文档中所示。 - 我们使用
@lru_cache
来缓存计算成本高昂或进行外部 API 调用的函数的结果。 - 我们需要注意不要过度占用模型的上下文窗口,例如,你会在很多地方看到
df.to_csv(index=False).replace("\r", "")
代码。这种 csv 格式的返回比df.to_string()
之类的方法(后者大多数 token 都是空格)更高效。还要注意,从染色体中提取所有基因或类似的大型请求,对于上下文窗口来说也会过大。
未来的潜在功能
当然,还有很多功能可以添加,有些功能可能超出了biomart-mcp
这个名称的范围。以下是一些想法:
- 使用
bs4
添加资源站点的网络抓取,例如,我们获得了 NOTCH1 的 Ensembl 基因 ID,那么在某些情况下,从UCSC 页面上的Comments and Description Text from UniProtKB
可能会很有用 - Loading...
Tools
与 Biomart 数据库接口的模型上下文协议服务器,允许模型发现生物数据集、探索属性/过滤器、检索生物数据以及在不同的生物标识符之间进行转换。
Related Resources
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server that provides tools for connecting to and interacting with various database systems (SQLite, PostgreSQL, MySQL/MariaDB, SQL Server) through a unified interface.Last updated -3Python
MCP TapData Serverofficial
-securityFlicense-qualityA Model Context Protocol server that enables Large Language Models to access and interact with database connections, including viewing schemas and performing CRUD operations on connected databases.Last updated -- -securityFlicense-qualityA Model Context Protocol server that provides comprehensive access to Microsoft SQL Server databases, enabling Language Models to inspect schemas, execute queries, manage database objects, and perform advanced database operations.Last updated -6Python
- AsecurityAlicenseAqualityA production-ready Model Context Protocol (MCP) server that provides comprehensive access to the BioOntology API for searching, annotating, and exploring over 1,200 biological ontologies.Last updated -106JavaScriptMIT License