Skip to main content

Model Context Protocol server providing BioPython library capabilities for biological sequence analysis, alignment, database access, and structural bioinformatics

Project description

BioPython MCP Server

CI Python 3.10+ License: MIT Code style: black

A Model Context Protocol (MCP) server that provides comprehensive BioPython capabilities for biological sequence analysis, alignment, database access, and structural bioinformatics.

Overview

BioPython MCP bridges the powerful BioPython library with MCP-enabled applications like Claude Desktop, allowing seamless integration of bioinformatics tools into AI-assisted workflows. This enables researchers, clinicians, and developers to perform complex biological analyses through natural language interfaces.

Motivation

Bioinformatics workflows often require switching between multiple tools and writing custom scripts. BioPython MCP simplifies this by:

  • Unified Interface: Access BioPython's capabilities through a standardized MCP protocol
  • AI Integration: Combine computational biology with AI-powered analysis and interpretation
  • Workflow Automation: Chain complex bioinformatics tasks through conversational interfaces
  • Accessibility: Make advanced bioinformatics tools available to non-programmers

Features

  • Sequence Operations

    • DNA/RNA translation and transcription
    • Reverse complement calculation
    • GC content analysis
    • Motif finding and pattern matching
  • Sequence Alignment

    • Pairwise global and local alignment
    • Multiple sequence alignment support
    • Alignment scoring with substitution matrices
  • Database Access

    • GenBank sequence retrieval
    • UniProt protein data access
    • PubMed literature search
    • NCBI database queries
  • Protein Structure Analysis

    • PDB structure fetching and parsing
    • Structure statistics calculation
    • Active site residue analysis
  • Phylogenetics

    • Phylogenetic tree construction (NJ, UPGMA)
    • Distance matrix calculation
    • Tree visualization

Installation

Requirements

  • Python 3.10 or higher
  • pip or uv package manager

Quick Install with uvx (Recommended)

The fastest way to run BioPython MCP without installation:

uvx biopython-mcp

Or run from source:

git clone https://github.com/kmaneesh/biopython-mcp.git
cd biopython-mcp
uvx --from . biopython-mcp

Install from PyPI

pip install biopython-mcp

Install from Source with uv

git clone https://github.com/kmaneesh/biopython-mcp.git
cd biopython-mcp
uv venv --python 3.10
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"

Install from Source with pip

git clone https://github.com/kmaneesh/biopython-mcp.git
cd biopython-mcp
pip install -e ".[dev]"

Development Installation

For contributing or development:

git clone https://github.com/kmaneesh/biopython-mcp.git
cd biopython-mcp
uv venv --python 3.10
source .venv/bin/activate
uv pip install -e ".[dev]"
pre-commit install

Quick Start

Running the Server

Start the MCP server:

# With uvx (no installation needed)
uvx biopython-mcp

# Or if installed
biopython-mcp

Configuration for Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

Using uvx (recommended):

{
  "mcpServers": {
    "biopython": {
      "command": "uvx",
      "args": ["biopython-mcp"]
    }
  }
}

Using installed package:

{
  "mcpServers": {
    "biopython": {
      "command": "biopython-mcp"
    }
  }
}

Using local development version:

{
  "mcpServers": {
    "biopython": {
      "command": "uvx",
      "args": ["--from", "/path/to/biopython-mcp", "biopython-mcp"]
    }
  }
}

Basic Usage Example

Once configured, you can use BioPython tools through Claude Desktop:

User: Translate the DNA sequence ATGGCCATTGTAATGGGCCGC to protein

Claude: [Uses translate_sequence tool]
Result: MAIVMGR (7 amino acids)

User: What's the GC content of this sequence?

Claude: [Uses calculate_gc_content tool]
Result: 57.14% GC content

Available Tools

Sequence Operations

Tool Description
translate_sequence Translate DNA/RNA to protein
reverse_complement Get reverse complement of DNA
transcribe_dna Transcribe DNA to RNA
calculate_gc_content Calculate GC percentage
find_motif Find sequence motifs

Alignment

Tool Description
pairwise_align Align two sequences
multiple_sequence_alignment Align multiple sequences
calculate_alignment_score Score alignments

Database Access

Tool Description
fetch_genbank Retrieve GenBank records
fetch_uniprot Retrieve UniProt entries
search_pubmed Search PubMed literature
fetch_sequence_by_id Get sequences by ID

Structure Analysis

Tool Description
fetch_pdb_structure Download PDB structures
calculate_structure_stats Analyze structure statistics
find_active_site Extract active site info

Phylogenetics

Tool Description
build_phylogenetic_tree Build phylogenetic trees
calculate_distance_matrix Compute distance matrices
draw_tree Visualize trees

See the Tools Reference for detailed documentation.

Configuration Options

Environment Variables

  • NCBI_EMAIL: Email address for NCBI Entrez queries (recommended)
  • NCBI_API_KEY: API key for higher NCBI rate limits (optional)

Setting Environment Variables

export NCBI_EMAIL="your.email@example.com"
export NCBI_API_KEY="your_api_key_here"

Examples

Analyze a Gene Sequence

# 1. Fetch from GenBank
fetch_genbank(accession="NM_000207", email="user@example.com")

# 2. Calculate GC content
calculate_gc_content(sequence="ATGGCC...")

# 3. Translate to protein
translate_sequence(sequence="ATGGCC...")

# 4. Find start codons
find_motif(sequence="ATGGCC...", motif="ATG")

Compare Sequences

# Perform global alignment
pairwise_align(
    seq1="ATGGCCATTGTAATGGGCCGC",
    seq2="ATGGCCATTGTTATGGGCCGC",
    mode="global"
)

Build Phylogenetic Tree

# Build tree from aligned sequences
build_phylogenetic_tree(
    sequences=["ATGGCC...", "ATGGCT...", "ATGGCA..."],
    method="nj",
    labels=["Species_A", "Species_B", "Species_C"]
)

See examples/ for complete workflow examples.

Documentation

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

Development Setup

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/yourusername/biopython-mcp.git
  3. Install development dependencies: pip install -e ".[dev]"
  4. Install pre-commit hooks: pre-commit install
  5. Create a feature branch: git checkout -b feature-name
  6. Make your changes and commit
  7. Run tests: pytest
  8. Push and create a pull request

Code Quality

We use:

  • Black for code formatting
  • Ruff for linting
  • mypy for type checking
  • pytest for testing
  • pre-commit for automated checks

Testing

Run tests:

pytest

Run tests with coverage:

pytest --cov=biopython_mcp --cov-report=term-missing

Run type checking:

mypy biopython_mcp/

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use BioPython MCP in your research, please cite:

@software{biopython_mcp,
  title = {BioPython MCP: Model Context Protocol Server for BioPython},
  author = {BioPython MCP Contributors},
  year = {2026},
  url = {https://github.com/kmaneesh/biopython-mcp}
}

Acknowledgments

Support

Roadmap

  • Add support for protein secondary structure prediction
  • Implement BLAST search integration
  • Add sequence feature annotation tools
  • Support for custom HMM profiles
  • Interactive structure visualization
  • Batch processing capabilities
  • REST API wrapper

Related Projects


Made with BioPython and MCP

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

biopython_mcp-0.1.0.tar.gz (38.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

biopython_mcp-0.1.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file biopython_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: biopython_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 38.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for biopython_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1cf499042c546fb896a83bfbad57ec4a06ebeb5cfaaafdada302495b8baa3e49
MD5 784db05047e07d2b48002fc4a4e19708
BLAKE2b-256 6c0627455c6c2f4bcfa3b13682f4aef01ada2bb7c9215e5666752fc9461ebd22

See more details on using hashes here.

Provenance

The following attestation bundles were made for biopython_mcp-0.1.0.tar.gz:

Publisher: publish.yml on kmaneesh/biopython-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biopython_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: biopython_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for biopython_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b448e64a47e91ce827f56cbbb671982db609ab19cbe30036f00f2cedf396844f
MD5 ef0389c4b73a9600aa988fad1137868a
BLAKE2b-256 6f5efeb903da6df9137ce17c7585d5dde1af6455cdb93de0817d6e99ff78847a

See more details on using hashes here.

Provenance

The following attestation bundles were made for biopython_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on kmaneesh/biopython-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page