BV-BRC MCP Server

BV-BRC MCP Server

Enables querying and retrieving bacterial and viral genomic data, features, antimicrobial resistance, and epitopes from the BV-BRC API using natural language.

Category
访问服务器

README

mcp-bvbrc

A Model Context Protocol (MCP) server for interacting with the BV-BRC (Bacterial and Viral Bioinformatics Resource Center) API. This server provides tools for querying and retrieving genomic data, features, antimicrobial resistance data, epitopes, and more.

Overview

BV-BRC is a comprehensive bioinformatics resource for bacterial and viral pathogen data. This MCP server exposes the BV-BRC API through a set of tools that can be used with Claude and other MCP-compatible applications.

Key Features

  • Query Genomes: Search and retrieve genome data with filters for organism, strain, and more
  • Genomic Features: Query genes, proteins, RNA molecules, and other genomic features
  • Antimicrobial Resistance: Access AMR data and resistance mechanisms
  • Epitopes & Assays: Retrieve vaccine target and epitope assay data
  • Advanced Queries: Use RQL (Relational Query Language) for complex data queries
  • Multiple Data Types: Access 13+ different data types in the BV-BRC database

Installation

Prerequisites

  • Python 3.10 or higher
  • pip (Python package manager)

Quick Start

  1. Clone or download this repository:
git clone https://github.com/soham-shukla/mcp-bvbrc.git
cd mcp-bvbrc
  1. Install dependencies:
pip install -r requirements.txt
  1. (Optional) Install in development mode with additional tools:
pip install -e ".[dev]"

Configuration

For Claude Desktop

The easiest way to use this server is with Claude Desktop:

  1. Find your Claude Desktop configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the server configuration:

{
  "mcpServers": {
    "bvbrc": {
      "command": "python",
      "args": ["/absolute/path/to/bvbrc.py"]
    }
  }
}
  1. Restart Claude Desktop

See CONFIG.md for more configuration options.

Available Tools

1. query_data_type

Perform advanced queries on any BV-BRC data type using RQL syntax.

Parameters:

  • data_type (required): The data type to query (e.g., genome, genome_feature, epitope)
  • query (optional): RQL query string
  • limit (optional, default: 10): Maximum results to return
  • offset (optional, default: 0): Results to skip

Example:

Query genomes of Salmonella with organism name and genome size
data_type: "genome"
query: "eq(organism,Salmonella)&select(genome_id,organism,dna_size)"
limit: 5

2. get_record_by_id

Retrieve a specific record by its ID.

Parameters:

  • data_type (required): The data type (e.g., genome, genome_feature)
  • record_id (required): The ID of the record

Example:

Get genome with ID "1234567.890"
data_type: "genome"
record_id: "1234567.890"

3. search_genomes

Search for genomes with convenient filtering.

Parameters:

  • organism (optional): Filter by organism name
  • genome_id (optional): Filter by genome ID
  • strain (optional): Filter by strain
  • limit (optional, default: 10): Maximum results
  • offset (optional, default: 0): Results to skip

Example:

Search for Escherichia coli genomes
organism: "Escherichia coli"
limit: 20

4. search_features

Search for genomic features (genes, proteins, etc.) with filtering.

Parameters:

  • genome_id (optional): Filter by genome ID
  • feature_type (optional): Filter by type (e.g., CDS, RNA)
  • keyword (optional): Keyword search
  • limit (optional, default: 10): Maximum results
  • offset (optional, default: 0): Results to skip

Example:

Search for CDS features in a genome
genome_id: "1234567.890"
feature_type: "CDS"
limit: 50

5. get_available_data_types

Get information about all available data types in BV-BRC.

Returns: List of data types with descriptions and common fields.

Supported Data Types

Data Type Description Primary Key
genome Genome records with assembly and taxonomy genome_id
genome_feature Genomic features (genes, proteins, RNA) feature_id
strain Strain information and metadata strain_id
genome_amr Antimicrobial resistance data genome_id
epitope Epitope data including vaccine targets epitope_id
epitope_assay Epitope assay results assay_id
experiment Experiment metadata and results experiment_id
bioset Collection of genomes bioset_id
bioset_result Results associated with biosets result_id
feature_sequence Nucleotide and protein sequences feature_id
antibiotics Antibiotic information database antibiotic_id
enzyme_class_ref Enzyme classification reference enzyme_class_id
gene_ontology_ref Gene Ontology reference data go_id

RQL Query Syntax

The BV-BRC API uses RQL (Relational Query Language) for advanced queries. Here are common operators:

Comparison Operators

  • eq(field,value) - Field equals value
  • ne(field,value) - Field not equal to value
  • gt(field,value) - Field greater than value
  • lt(field,value) - Field less than value
  • in(field,(value1,value2)) - Field contains any of the values

Logical Operators

  • and(expr1,expr2,...) - AND expressions together
  • or(expr1,expr2,...) - OR expressions together

Query Modifiers

  • keyword(value) - Full-text search
  • select(field1,field2) - Return only specified fields
  • sort([+|-]field) - Sort results (+ ascending, - descending)
  • limit(count,offset) - Limit and offset results

Examples

Find Salmonella genomes with specific fields:

eq(organism,Salmonella)&select(genome_id,organism,strain,dna_size)&limit(10,0)

Search for antibiotic-resistant Salmonella:

and(eq(organism,Salmonella),eq(amr_phenotype,resistant))&select(genome_id,organism,antibiotic)&limit(20,0)

Full-text search across features:

keyword(virulence)&select(feature_id,product)&limit(15,0)

Python Usage

You can also use the server programmatically:

import asyncio
from client import BVBRCClient

async def main():
    client = BVBRCClient()
    
    # Query genomes
    results = await client.query(
        "genome",
        "eq(organism,Salmonella)&select(genome_id,organism)",
        limit=10
    )
    
    # Get a specific record
    record = await client.get_by_id("genome", "1234567.890")

asyncio.run(main())

Error Handling

The server handles common errors gracefully:

  • Invalid data types: Returns error message
  • Network errors: Returns connection error details
  • Invalid queries: API returns error information
  • Missing records: Returns 404 error message

Performance Considerations

  • Default limit is 10 records; use offset for pagination
  • Large result sets may take longer to retrieve
  • Use specific filters to reduce result size
  • RQL queries are optimized server-side for efficiency

Authentication

The BV-BRC public API requires no authentication. However, if you have private data access:

  1. Set the BVBRC_API_TOKEN environment variable with your token
  2. The client will automatically include it in requests
export BVBRC_API_TOKEN="your-token-here"
python bvbrc.py

API Documentation

For complete BV-BRC API documentation, visit:

Architecture

The server consists of three main modules:

  • bvbrc.py: Main MCP server with tool definitions and orchestration
  • client.py: HTTP client for BV-BRC API interactions
  • data_types.py: Data type definitions and metadata

Development

Running Tests

pytest tests/

Code Style

black bvbrc.py client.py data_types.py
isort bvbrc.py client.py data_types.py

Type Checking

mypy bvbrc.py client.py data_types.py

License

MIT License - See LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

Support

For issues with this MCP server, please open a GitHub issue.

For questions about the BV-BRC API itself, visit the BV-BRC help documentation.


Note: This MCP server is an independent tool and is not officially affiliated with or endorsed by BV-BRC.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选