Metadata-Version: 2.5
Name: antibody-mcp
Version: 0.1.0
Summary: MCP server for antibody and biologics research: PubMed, ClinicalTrials.gov, RCSB PDB and antibody numbering.
Project-URL: Homepage, https://github.com/partrita/antibody-mcp
Project-URL: Issues, https://github.com/partrita/antibody-mcp/issues
Project-URL: Changelog, https://github.com/partrita/antibody-mcp/releases
Author: Kim Taeyun
License: MIT License
        
        Copyright (c) 2026 Kim Taeyun
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: antibody,bioinformatics,clinicaltrials,llm,mcp,model-context-protocol,pdb,pubmed
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27
Requires-Dist: mcp[cli]>=2.3
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: numbering
Requires-Dist: abcat; extra == 'numbering'
Description-Content-Type: text/markdown

# 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
