home / mcp / bio mcp bwa server
Provides BWA-based genome alignment tools via MCP, including indexing and multiple alignment modes.
Configuration
View docs{
"mcpServers": {
"bio-mcp-bio-mcp-bwa": {
"command": "python",
"args": [
"-m",
"src.server"
],
"env": {
"BIO_MCP_TIMEOUT": "3600",
"BIO_MCP_BWA_PATH": "/usr/local/bin/bwa",
"BIO_MCP_TEMP_DIR": "/tmp/bwa_mcp",
"BIO_MCP_MAX_FILE_SIZE": "Until 50GB by default (e.g., 53687091200)"
}
}
}
}You can access and run the BWA sequencing aligner through an MCP server, enabling AI assistants to perform genome read alignment tasks by invoking dedicated tools like index creation and various alignment modes. This setup lets you integrate BWA functionality into automated workflows and conversational agents with clear, programmatic endpoints.
To use the BWA MCP server with your MCP client, first ensure your environment is prepared with the required prerequisites and that the server is running locally or reachable via its configured command. You will call the available tools by name to perform specific tasks such as indexing a reference genome or aligning reads. Each tool exposes a focused set of parameters that you provide as inputs, and the server returns results appropriate for downstream processing in your pipelines or analysis notebooks.
# Prerequisites
python3.9+
# Ensure BWA is installed and available in PATH
# 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 .Configure your MCP client to recognize the BWA MCP server by adding a local entry that points to the server runtime. The example below shows how to configure a server named bio-bwa to run via Python and the server module.
{
"mcpServers": {
"bio-bwa": {
"command": "python",
"args": ["-m", "src.server"],
"cwd": "/path/to/bio-mcp-bwa"
}
}
}Create a BWA index for a reference genome using the MCP server, then align reads with BWA-MEM and generate SAM outputs for paired-end data. Adapt file paths to your environment and genome references.
Create a BWA index for a reference genome using the indexed FASTA file.
Align reads using the BWA-MEM algorithm with options for threads, seed length, band width, and read group information.
Find SA coordinates with the BWA-backtrack algorithm for a given reference and reads.
Generate single-end alignments in SAM format from reads using a prebuilt SA index.
Generate paired-end alignments in SAM format from reads using prebuilt SA indexes for both mates.