Skip to main content
Glama
README.md
# antibody-mcp

**An MCP server for antibody and biologics research — PubMed, ClinicalTrials.gov, RCSB PDB and antibody numbering in one tool call.**

[![CI](https://github.com/partrita/antibody-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/partrita/antibody-mcp/actions/workflows/ci.yml)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE)
[![MCP](https://img.shields.io/badge/MCP-compatible-6f42c1)](https://modelcontextprotocol.io)
<!-- PyPI badge: enable after the first release
[![PyPI](https://img.shields.io/pypi/v/antibody-mcp)](https://pypi.org/project/antibody-mcp/)
-->

Give Claude Desktop, Claude Code, Cursor or any MCP-compatible agent the four things an
antibody engineer looks up every day: **what has been published**, **what is in the clinic**,
**what the structure looks like**, and **how the sequence numbers**.

No API keys are required. Everything is queried from free public endpoints.

---

## Why another bio MCP server?

| | Generic literature MCP | **antibody-mcp** |
| --- | --- | --- |
| PubMed search | ✅ | ✅ with date windows and DOI/PMID |
| ClinicalTrials.gov | ⚠️ often missing | ✅ status / phase / intervention filters |
| PDB | ⚠️ raw file dump | ✅ entry summary + chain composition, coordinates on demand |
| Antibody numbering | ❌ | ✅ IMGT · Kabat · Chothia · Martin · AHo + CDR1/2/3 via [`abcat`](https://github.com/partrita/abcat) |
| Context cost | large blobs | compact JSON, one record per hit |

The tools are designed to be **cheap in tokens and explicit about sources**: every result
carries the query, the source URL and an `error` field instead of raising, so an agent can
retry with a better query instead of losing the turn.

---

## Quick start

```bash
# Run without installing (once published to PyPI)
uvx antibody-mcp

# or install it into a project
uv add antibody-mcp

# numbering support is an optional extra (installs abcat / ANARCI)
# note: abcat currently requires Python 3.14+, the rest of the server does not
uv add "antibody-mcp[numbering]"
```

### Claude Desktop

`~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or
`%APPDATA%\Claude\claude_desktop_config.json` (Windows):

```json
{
  "mcpServers": {
    "antibody": {
      "command": "uvx",
      "args": ["antibody-mcp"],
      "env": {
        "NCBI_EMAIL": "you@example.com",
        "NCBI_API_KEY": ""
      }
    }
  }
}
```

### Cursor

`~/.cursor/mcp.json` — same `mcpServers` block as above.

### Claude Code

```bash
claude mcp add antibody -- uvx antibody-mcp
```

Restart the client and ask:

> *"Find recent papers on anti-PD-1 nanobodies, then show me the chain composition of PDB 5DK3."*

---

## Tools

| Tool | Arguments | What it returns | Source |
| --- | --- | --- | --- |
| `search_pubmed` | `query`, `max_results=5`, `years=5` | PMID, title, journal, year, authors, DOI, URL. Sorted by relevance. | NCBI E-utilities |
| `search_clinical_trials` | `condition`, `intervention?`, `status?`, `max_results=5` | NCT id, title, status, phase, conditions, interventions, sponsor, dates, URL | ClinicalTrials.gov API v2 |
| `get_pdb_entry` | `pdb_id`, `include_fasta=false` | Title, method, resolution, deposition date, polymer entities + descriptions, download URL, optional FASTA | RCSB PDB Data API |
| `annotate_antibody` | `sequence`, `scheme="imgt"` | Chain type (VH/VK/VL), numbering scheme, CDR1/2/3 and framework sequences, isotype/subclass when a constant region is present | [`abcat`](https://github.com/partrita/abcat) (optional) |

`scheme` accepts `imgt`, `kabat`, `chothia`, `martin`, `aho`.

### Example tool output (trimmed)

```json
{
  "query": "anti-PD-1 nanobody",
  "count": 1,
  "results": [
    {
      "pmid": "31234567",
      "title": "A compact anti-PD-1 nanobody with…",
      "journal": "mAbs",
      "year": "2024",
      "doi": "10.1080/19420862.2024.xxxxxxx",
      "url": "https://pubmed.ncbi.nlm.nih.gov/31234567/"
    }
  ]
}
```

---

## Architecture

```mermaid
flowchart LR
    A[MCP client<br/>Claude · Cursor · Code] -->|stdio / JSON-RPC| B[antibody-mcp<br/>FastMCP]
    B --> C[search_pubmed]
    B --> D[search_clinical_trials]
    B --> E[get_pdb_entry]
    B --> F[annotate_antibody]
    C --> C1[(NCBI<br/>E-utilities)]
    D --> D1[(ClinicalTrials.gov<br/>API v2)]
    E --> E1[(RCSB PDB<br/>Data API)]
    F --> F1[abcat / ANARCI<br/>optional]
```

```
src/antibody_mcp/
├── server.py        # FastMCP instance + the four @mcp.tool functions
├── clients.py       # thin, typed HTTP wrappers for the three public APIs
├── abcat_bridge.py  # optional antibody numbering via abcat
└── __main__.py      # `python -m antibody_mcp`
```

---

## Configuration

| Environment variable | Default | Purpose |
| --- | --- | --- |
| `NCBI_EMAIL` | unset | NCBI asks for a contact address; improves rate-limit behaviour |
| `NCBI_API_KEY` | unset | Raises NCBI limit from 3 to 10 requests/second |
| `ANTIBODY_MCP_TIMEOUT` | `20` | HTTP timeout in seconds |

---

## Development

```bash
git clone https://github.com/partrita/antibody-mcp.git
cd antibody-mcp
uv sync --extra dev          # numbering is optional and needs Python 3.14+
uv run pytest -q
uv run ruff check .
uv run antibody-mcp          # starts the stdio server
```

Inspect the server interactively:

```bash
npx @modelcontextprotocol/inspector uv run antibody-mcp
```

---

## Status and roadmap

- **0.1.0 (this scaffold)** — tool signatures, HTTP clients, error envelopes, smoke tests.
  The PubMed / ClinicalTrials / PDB paths are implemented; responses are normalised but not
  cached.
- [ ] Response cache (SQLite, 24 h TTL) to make repeated agent calls free
- [ ] `search_antibody_structures` — query the PDB by antigen + resolution + antibody type
- [ ] `get_binding_interface` — Fab–antigen contact residues from a PDB entry
- [ ] Streaming for large FASTA/coordinate payloads

Contributions and tool requests are welcome — open an issue with the question you wish your
agent could answer.

## Related projects

- [`abcat`](https://github.com/partrita/abcat) — antibody V/C-domain annotation used by `annotate_antibody`
- [`pubmed-miner`](https://github.com/partrita/pubmed-miner) — literature scoring and MdBook publishing
- [`clinicaltrial-watch`](https://github.com/partrita/clinicaltrial-watch) — change monitoring for tracked trials

## License

MIT © Kim Taeyun