BWA MCP Server

BWA MCP Server

Enables AI assistants to perform DNA/RNA sequence alignment using BWA (Burrows-Wheeler Aligner), supporting both short and long read alignment to reference genomes with indexing, BWA-MEM, and BWA-backtrack algorithms.

Category
Visit Server

README

bio-mcp-bwa

MCP (Model Context Protocol) server for the BWA (Burrows-Wheeler Aligner) sequence alignment tool.

Overview

This MCP server provides access to BWA functionality, allowing AI assistants to perform alignment of short and long sequencing reads to a reference genome.

Features

  • bwa_index: Create an index for a reference genome.
  • bwa_mem: Align reads using the BWA-MEM algorithm.
  • bwa_aln: Find SA coordinates with the BWA-backtrack algorithm.
  • bwa_samse: Generate single-end alignments in SAM format.
  • bwa_sampe: Generate paired-end alignments in SAM format.
  • Support for large reference genomes and read files.

Installation

Prerequisites

  • Python 3.9+
  • BWA installed (bwa)

Install BWA

# macOS
brew install bwa

# Ubuntu/Debian
sudo apt-get install bwa

# From conda
conda install -c bioconda bwa

Install the MCP server

git clone https://github.com/bio-mcp/bio-mcp-bwa
cd bio-mcp-bwa
pip install -e .

Configuration

Add to your MCP client configuration (e.g., Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "bio-bwa": {
      "command": "python",
      "args": ["-m", "src.server"],
      "cwd": "/path/to/bio-mcp-bwa"
    }
  }
}

Environment Variables

  • BIO_MCP_MAX_FILE_SIZE: Maximum input file size in bytes (default: 50GB)
  • BIO_MCP_TIMEOUT: Command timeout in seconds (default: 3600)
  • BIO_MCP_BWA_PATH: Path to BWA executable (default: finds in PATH)
  • BIO_MCP_TEMP_DIR: Temporary directory for processing

Usage

Once configured, the AI assistant can use the following tools:

bwa_index - Create BWA Index

Create a BWA index for a reference genome.

Parameters:

  • reference_fasta (required): Path to the reference FASTA file.
  • algorithm: Indexing algorithm (bwtsw or is). Defaults to bwtsw for genomes >2GB.

bwa_mem - Align with BWA-MEM

Align reads using the BWA-MEM algorithm.

Parameters:

  • reference (required): Path to the indexed reference genome.
  • reads1 (required): Path to the first reads file (FASTQ).
  • reads2: Path to the second reads file for paired-end alignment.
  • threads: Number of threads to use (default: 4).
  • min_seed_length: Minimum seed length (default: 19).
  • band_width: Band width for banded alignment (default: 100).
  • read_group: Read group header line.

bwa_aln - Find SA Coordinates

Find SA coordinates with the BWA-backtrack algorithm.

Parameters:

  • reference (required): Path to the indexed reference genome.
  • reads (required): Path to the reads file (FASTQ).
  • threads: Number of threads to use (default: 4).
  • max_mismatches: Maximum number of mismatches (default: 4).
  • max_gap_opens: Maximum number of gap opens (default: 1).

bwa_samse - Generate Single-End SAM

Generate alignments in SAM format for single-end reads.

Parameters:

  • reference (required): Path to the indexed reference genome.
  • sai_file (required): Path to the .sai file from bwa_aln.
  • reads (required): Path to the original reads file.

bwa_sampe - Generate Paired-End SAM

Generate alignments in SAM format for paired-end reads.

Parameters:

  • reference (required): Path to the indexed reference genome.
  • sai_file1 (required): Path to the .sai file for read 1.
  • sai_file2 (required): Path to the .sai file for read 2.
  • reads1 (required): Path to the reads file 1.
  • reads2 (required): Path to the reads file 2.

Examples

Index a reference genome

Create a BWA index for the file hg38.fasta.

Align paired-end reads

Align the paired-end reads from r1.fastq and r2.fastq to the hg38 reference genome using BWA-MEM.

Development

Running tests

pytest tests/

Building Docker image

docker build -t bio-mcp-bwa .

License

MIT License

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured