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

An MCP server that connects Claude (or any MCP client) to the **iGEM Registry of
Standard Biological Parts**, plus offline tools for the BioBrick design work
that surrounds it.

Built for iGEM teams. Read access to the Registry needs no account.

---

## Why this exists

The Registry was rebuilt in August 2025 with a public REST API, but nothing
connects it to an AI assistant. This server closes that gap and adds the checks
teams normally do by hand in SnapGene or Benchling:

- **Part lookup and search** against the live Registry.
- **Usage-ranked search, honestly bounded.** The Registry API ignores `orderBy`
  entirely and always returns *newest-first*, so searching `GFP` gives 8,400 hits
  led by unused 2026 student plasmids. This server re-ranks by usage count over a
  bounded scan and **always reports how much of the result set that scan covered**
  (`ranking_covers_all_matches`), so a partial ranking is never passed off as a
  Registry-wide one.
- **Part names resolved directly.** Search matches description text, not names —
  searching `E0040` returns 481 hits *without* `BBa_E0040` among them. A query
  naming a part is resolved through the slug endpoint and returned first.
- **Assembly-standard checking** for RFC10, RFC12, RFC21, RFC23, RFC25, RFC1000,
  MoClo and BsmBI Golden Gate — scanning **both strands**, so non-palindromic
  Type IIS sites are caught in either orientation, and optionally **circular**,
  so a site spanning a plasmid's start/end junction isn't missed.
- **RFC10 assembly simulation** with correct scar insertion.
- **BioBrick primer design** with prefix/suffix tails and Tm-matched annealing regions.
- **Pre-submission screening** for GC extremes, homopolymers, direct repeats and
  reading-frame errors.

## Tools

### Registry (network)

| Tool | What it does |
|---|---|
| `igem_get_part` | Full record for one part: sequence, role (SO term), usage count, licence |
| `igem_search_parts` | Search, ranked by real-world usage rather than submission date |
| `igem_get_composition` | Sub-parts of a composite, in order along the sequence |
| `igem_get_authors` | Credited authors, for citation |
| `igem_find_twins` | Parts with an identical sequence — check before submitting a duplicate |

### Sequence work (offline, no network)

| Tool | What it does |
|---|---|
| `igem_check_standards` | Finds restriction sites illegal under each assembly standard |
| `igem_screen_sequence` | Pre-synthesis screen: GC windows, homopolymers, repeats, CDS frame |
| `igem_assemble_rfc10` | Simulates BioBrick assembly, returns composite sequence and layout |
| `igem_design_biobrick_primers` | Primers adding the RFC10 prefix/suffix, with Tm and GC reporting |

## Install

Requires Python 3.10+.

```bash
git clone <your-repo-url> igem-mcp
cd igem-mcp
pip install -e .
```

## Check it works

```bash
python examples/check_live_api.py    # probes every live Registry endpoint
python examples/demo_bsai_catch.py   # why both-strand scanning matters (offline)
python -m pytest tests/ -q           # 75 tests
```

The BsaI demo is the quickest way to see the point of this tool: BBa_E0040 (GFP)
carries a BsaI site on the **minus** strand, so a plus-strand-only check calls it
Type IIS compatible and the Golden Gate assembly then fails at the bench.

## Connect it to Claude

Add this to your Claude Desktop config file:

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

```json
{
  "mcpServers": {
    "igem": {
      "command": "igem-mcp"
    }
  }
}
```

If `igem-mcp` isn't on your PATH, point at the module directly:

```json
{
  "mcpServers": {
    "igem": {
      "command": "python",
      "args": ["-m", "igem_mcp.server"]
    }
  }
}
```

Restart Claude Desktop. For Claude Code: `claude mcp add igem -- igem-mcp`.

## What you can then ask

> Is BBa_K1149051 RFC10-compatible, and who should I cite for it?

> Find me the most-used constitutive promoters in the Registry.

> Here's my codon-optimised CDS — screen it before I order synthesis, then design
> BioBrick primers for it.

> Assemble BBa_J23100, BBa_B0034, my CDS and BBa_B0015 as an RFC10 composite.

## Validation

75 tests. The restriction logic is checked against sources outside this project,
not only against itself:

- **Every recognition site** is asserted equal to Biopython's REBASE entry.
- **Real pUC19** (GenBank L09137.2, 2686 bp): all 15 enzymes agree with
  Biopython's own `search()`; EcoRI, BamHI, XbaI and PstI each return exactly one
  site, matching the published map, in the correct polylinker order.
- **Fuzzing**: 6,000 random sequence/enzyme comparisons against an independent
  oracle, zero mismatches.
- **Real Registry parts**: BBa_J23100's two NheI sites (legal in RFC10, illegal in
  RFC12) and BBa_E0040's minus-strand BsaI site are both pinned as tests.
- **End-to-end**: a J23100 + B0034 + E0040 + B0015 assembly is checked against a
  hand-computed 961 bp, with the layout required to tile the composite exactly.

Three bugs were found this way and fixed, each now covered by a regression test:

1. **Sites spanning a plasmid's origin were missed.** A rotated pUC19 reported
   zero EcoRI sites — a whole plasmid could be passed as standard-compatible when
   it was not. Fixed with a `circular` option.
2. **Tandem stop codons were flagged as errors.** BBa_E0040 ends `TAA TAA`,
   deliberate read-through insurance; calling that an "internal stop codon" was a
   false alarm on one of the most-used parts in the Registry.
3. **An unreachable target Tm was reported silently.** GFP's AT-rich 3' end can't
   reach 60 °C within the length cap; the tool now says so instead of returning a
   colder primer without comment.

### A deliberate difference from Biopython

For Type IIS enzymes near the end of a linear sequence, Biopython reports no cut
(the cut position falls off the fragment) while this tool still reports the
recognition site. That is intentional: a part is screened for submission into a
larger construct, where such a site *will* be cut. Verified as the cause of the
only systematic disagreement observed.

## Scope and limits

- **Read-only.** Submitting parts needs an authenticated iGEM account; this
  server deliberately does not write.
- **The screen is a first pass,** not a vendor complexity check. Secondary
  structure and codon-usage optimisation are out of scope.
- **Pass `circular: true` for whole plasmids.** The default is linear, which is
  right for a part sequence but will miss a site straddling a plasmid's
  arbitrary start point.
- **Primer design is BioBrick-specific** (Tm via Biopython `Tm_NN`, 50 mM Na⁺,
  250 nM primer). For general cloning use primer3.
- **`sequence-features` returns empty** for the parts tested, so annotations are
  not exposed yet.
- **Ranking is bounded, not global.** The API gives no server-side sort, so
  ranking the full 89,000-part Registry would mean ~890 requests and would breach
  its rate limits. The default scan is 500 parts per query; narrow the query for
  full coverage, and always read `ranking_covers_all_matches`.
- Registry API shapes were verified in **September 2026**; the API is young and
  may change. The two limitations above were measured, not assumed — if iGEM
  implements `orderBy`, the client-side ranking should be removed.

## Credit

Endpoint structure was cross-checked against
[`igem_registry_api`](https://github.com/igem-munich/igem_registry_api) by **iGEM
Munich 2025** (MIT), the first public wrapper for the new Registry API. This
server calls the API directly and tracks fields their 0.1.0 release predates
(`role` as an SO term, `usageCount`).

Assembly standards follow the BBF RFCs (RFC10 Knight; RFC12; RFC21 Anderson;
RFC23 Phillips & Silver; RFC25 Freiburg) and the Registry's own compatibility
definitions.

## Licence

MIT.

TDQS

A3.8/5.0

Scored across 9 tools

Disambiguation4/5

Most tools target clearly distinct operations: registry lookup, composition, search, authorship, twin detection, standards checking, screening, assembly, and primer design. The main soft overlap is between igem_check_standards and igem_screen_sequence, since screening explicitly includes assembly-standard compatibility, which could cause occasional misselection, but descriptions clarify the narrow vs. broad scope.

Naming Consistency5/5

All nine tools share the igem_ prefix followed by a consistent verb_noun snake_case pattern (get_part, search_parts, get_authors, find_twins, check_standards, screen_sequence, assemble_rfc10, design_biobrick_primers). Format-suffixed names like assemble_rfc10 still fit the pattern readably.

Tool Count5/5

Nine tools is well within the ideal range and each earns its place, covering a coherent synthetic-biology workflow from lookup through screening to assembly and primer design. No redundant or filler tools are present.

Completeness4/5

The surface covers the core lifecycle well: search, fetch, composition, attribution, deduplication, standards/screening checks, RFC10 assembly simulation, and primer design. Minor gaps exist, such as assembly simulation for non-RFC10 standards (only checked, not simulated) and no sequence utility tools (translate, reverse complement), but agents can work around these.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues