Biomart MCP server

Integrates with Biomart to enable advanced biological data queries, including gene information retrieval, ID translation, and dataset exploration using the pybiomart package.
Back to servers
Provider
John Zinno
Release date
Feb 27, 2025
Language
Python
Stats
5 stars

Biomart MCP is a server implementation of the Model Context Protocol (MCP) that allows AI assistants to interact with biological data through Biomart databases. It provides standardized access to genomic and biological data sources, enabling AI models like Claude to directly query biological databases in a structured manner.

Installation Options

Via Smithery

The easiest installation method is using Smithery for Claude Desktop:

npx -y @smithery/cli install @jzinno/biomart-mcp --client claude

Manual Installation

If you prefer manual installation:

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

Then for Claude Desktop:

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

Integration with Cursor

Cursor's agent mode allows other AI models to utilize MCP servers. Configure it through Cursor settings:

  1. Click the Cursor settings cogwheel
  2. Navigate to MCP
  3. Add the MCP server globally or at project level with .cursor/mcp.json

Example .cursor/mcp.json configuration:

{
    "mcpServers": {
        "Biomart": {
            "command": "uv",
            "args": [
                "run",
                "--with",
                "mcp[cli]",
                "--with",
                "pybiomart",
                "mcp",
                "run",
                "/your/path/to/biomart-mcp.py"
            ]
        }
    }
}

Glama Integration

The server is also available through Glama.ai.

Features and Usage

Mart and Dataset Discovery

Explore available Biomart databases and their datasets:

# List available marts
list_marts()

# List datasets within a specific mart
list_datasets(mart_name="ensembl")

Attribute and Filter Exploration

Discover available attributes and filters for specific datasets:

# View common attributes for a dataset
get_common_attributes(mart_name="ensembl", dataset_name="hsapiens_gene_ensembl")

# List all available attributes
get_all_attributes(mart_name="ensembl", dataset_name="hsapiens_gene_ensembl")

# View available filters
get_filters(mart_name="ensembl", dataset_name="hsapiens_gene_ensembl")

Data Retrieval

Query Biomart for specific biological data:

# Query data with specific attributes and filters
query_biomart(
    mart_name="ensembl",
    dataset_name="hsapiens_gene_ensembl",
    attributes=["ensembl_gene_id", "external_gene_name", "chromosome_name"],
    filters={"chromosome_name": "1"},
    limit=10
)

ID Translation

Convert between different biological identifiers:

# Translate gene symbols to Ensembl IDs
translate_ids(
    mart_name="ensembl",
    dataset_name="hsapiens_gene_ensembl",
    from_type="external_gene_name",
    to_type="ensembl_gene_id",
    ids=["BRCA1", "TP53", "NOTCH1"]
)

Usage Tips

  • Use the discovery functions first to explore available data sources
  • Limit result sizes to avoid context window limitations
  • Attributes and filters are dataset-specific, so explore each dataset's options
  • CSV-formatted responses are used to maximize token efficiency

The Biomart MCP server provides structured, token-efficient access to biological databases, allowing AI assistants to retrieve specific genomic information on demand.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later