API & MCP
Pick the surface you're working in. Each recipe is self-contained: one paragraph, one snippet. The data is the same — only the transport differs.
What's available
REST endpoints
The site holds 6,740 gene cards, of which
2,485 carry a literature-derived annotation
(at least one reading-pass discovery). The other 4,255 have
no discoveries and no teleology; 4,255 of them return the
placeholder narrative “No mechanistic discoveries found in literature.” — but a
corpus may still be present: 1,221 of those cards have
citation-ranked papers under /api/corpus, so check the corpus before
concluding Affinage has nothing on a gene. The placeholder means Affinage found no
mechanistic findings for the gene — it is not a finding that the gene is
uncharacterised.
A further 3 annotated cards carry a refusal narrative that
begins “Insufficient on-target evidence to synthesize a narrative.”:
the reading pass found papers, but the synthesis pass judged none of them to be
about the queried gene. Their discoveries are still served. Treat the exact
placeholder, or a narrative beginning “Insufficient on-target evidence”, as a
no-data result; a few annotated cards have narratives beginning “No
mechanistic findings specific to…” that still carry discoveries, so
check /api/discoveries before discarding a card. Live row counts:
/healthz.
| Endpoint | Returns |
|---|---|
GET /api/gene/{symbol} | Full GeneRecord JSON |
GET /api/mechanistic_narrative/{symbol} | Description paragraph |
GET /api/discoveries/{symbol} | Reading-pass per-paper findings (annotated cards only — 2,485 of 6,740) |
GET /api/teleology/{symbol} | Synthesis-pass mechanistic history (2,475 of 6,740 cards; 404 otherwise) |
GET /api/mechanism_profile/{symbol} | Partners and complexes (the controlled-vocab term axes are empty in this build) |
GET /api/uniprot/{symbol} | UniProt prefetch slice (no UniProt rows in this build — 404s for every gene) |
GET /api/audit/{symbol} | Deterministic R1–R12 audit flag: a hold (identity, grounding, behavior) or a note (coverage, identity check); null if clean |
GET /api/corpus/{symbol} | Source papers (citation-ranked) (3,706 of 6,740 cards have a corpus, including 1,221 placeholder cards) |
GET /api/paper/{pmid} | Paper lookup by PMID |
GET /api/search?q={term} | Gene name / ID / alias search — exact, then prefix, then substring for accession fragments; then UniProt-name and narrative matches |
MCP tools
Ten read-only tools mirror the REST endpoints above. They accept typed arguments (gene name or ID, PMID, row limit) and return structured JSON. The same coverage caveats apply.
get_geneget_mechanistic_narrativeget_discoveriesget_teleologyget_mechanism_profileget_uniprotget_audit_flagget_corpusget_papersearch_genes
Lookups resolve a gene name, any species' PlasmoDB gene ID, or an alias to
the same card: AMA1, PF3D7_1133400
(Pf), PBANKA_0915000
(Pb) and PKNH_0931500
(Pk) all reach the AMA1 card, and the
response carries resolved_from so you can see the redirect.
Cards are keyed by the Pf ID where the
card has one, otherwise by the Pb or Pk ID. Where a name is shared by
several cards the lookup resolves only when one card stands out (most
specific kind, then annotated, then P. falciparum); a product
description carried by many cards is not resolved.
/api/search?q= lists every card carrying an exact name or ID match
first, in that order, then narrative text — use it when a name is not
found. If a name does not resolve, look the ID up in PlasmoDB rather than
concluding the gene is absent.
This server covers Plasmodium only. Gene nicknames collide across
organisms, so a name that also exists in human or Toxoplasma will
never return that organism's gene. Findings are attributed to the specific
species the work was done in — do not carry a result from
P. falciparum over to P. berghei.
GET /api/gene/{symbol} and get_gene return the card's
member gene per species as strains (species code, gene_id, name,
product, UniProt accession); discoveries carry no species column, so per-finding
attribution lives in the narrative text.
Recipes
Click a surface to expand its recipe. Each one is a complete setup — no other steps needed unless noted.
Script (Python or curl) REST · no setup
Hit the REST API directly from any HTTP client. No authentication, no SDK, no MCP. Returns JSON.
# curl
curl https://affinage-plasmodium.wi.mit.edu/api/mechanistic_narrative/PF3D7_1133400
# Python
import requests
r = requests.get("https://affinage-plasmodium.wi.mit.edu/api/mechanistic_narrative/PF3D7_1133400")
print(r.json()["mechanistic_narrative"])
Claude.ai web MCP · custom connector
In a personal Claude.ai workspace, open Settings → Connectors → Add custom connector and paste the MCP endpoint. The Affinage tools appear in the conversation toolset.
https://affinage-plasmodium.wi.mit.edu/mcp
Many enterprise workspaces (Whitehead, most universities) disable custom connectors at the policy level — "Add custom connector" will be greyed out. Use the Claude Desktop recipe below instead; it routes around the policy.
Claude Desktop MCP · config file
In Claude Desktop, open Settings → Developer → Edit
Config — this opens claude_desktop_config.json
in your editor. Merge the snippet below into the file (if
mcpServers already exists, just add the
"affinage-plasmodium" entry inside it). Save, then fully
quit Claude Desktop (⌘Q on macOS — closing the window isn't
enough) and reopen.
{
"mcpServers": {
"affinage-plasmodium": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://affinage-plasmodium.wi.mit.edu/mcp"]
}
}
}
Requires Node.js — check with node --version in a
terminal; install the LTS release from
nodejs.org
if missing. First launch is slower than usual while
npx downloads mcp-remote. This recipe
works through enterprise policies that block the web UI's
custom-connector picker, because Desktop reads the local
config file rather than going through workspace policy.
Claude Code (CLI) MCP · one-liner
If you use the Claude Code terminal CLI, register Affinage with a single command. The tools become available in your next session.
claude mcp add affinage-plasmodium --transport http https://affinage-plasmodium.wi.mit.edu/mcp
Cursor / other MCP clients MCP · streamable HTTP
Any client that speaks the streamable-HTTP MCP transport
works the same way — point it at the endpoint. Cursor's MCP
config lives at ~/.cursor/mcp.json; Continue,
Windsurf, and other clients use their own locations, but the
JSON shape is the same.
{
"mcpServers": {
"affinage-plasmodium": {
"url": "https://affinage-plasmodium.wi.mit.edu/mcp"
}
}
}