Biomart MCP

by jzinno
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Biomart MCP

与 Biomart 接口的 MCP 服务器

模型上下文协议(MCP) 是一个开放协议,它标准化了应用程序如何向Anthropic开发的 LLM 提供上下文。在这里,我们使用MCP python-sdk创建一个 MCP 服务器,该服务器通过pybiomart包与 Biomart 交互。

有一个简短的演示视频展示了 MCP 服务器在 Claude Desktop 上的运行情况。

安装

克隆存储库

git clone https://github.com/jzinno/biomart-mcp.git cd biomart-mcp

克劳德桌面

uv run --with mcp[cli] mcp install --with pybiomart biomart-mcp.py

光标

通过 Cusror 的代理模式,其他模型也可以利用 MCP 服务器,例如来自 OpenAI 或 DeepSeek 的服务器。点击光标设置齿轮,导航至Features -> MCP Servers -> Add new MCP Server 。将名称设置为biomart (或任何你喜欢的名称),并将Typecommand

将命令设置为:

uv run --with mcp[cli] --with pybiomart mcp run /your/path/to/biomart-mcp.py

格拉玛

发展

# Create a virtual environment uv venv # MacOS/Linux source .venv/bin/activate # Windows .venv\Scripts\activate uv sync #or uv add mcp[cli] pybiomart # Run the server in dev mode mcp dev biomart-mcp.py

特征

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...

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

与 Biomart 数据库接口的模型上下文协议服务器,允许模型发现生物数据集、探索属性/过滤器、检索生物数据以及在不同的生物标识符之间进行转换。

  1. A MCP server to interface with Biomart
    1. Installation
      1. Clone the repository
      2. Claude Desktop
      3. Cursor
      4. Glama
      5. Development
    2. Features
      1. Contributing
        1. Potential Future Features
          ID: v5a3mlxviu