API & MCP
Two ways to call Affinage programmatically: a REST API for any HTTP client, and an MCP server for Claude Desktop and other agentic LLM clients.
REST API
| Endpoint | Returns |
|---|---|
GET /api/gene/{symbol} | Full GeneRecord JSON |
GET /api/mechanistic_narrative/{symbol} | Mechanistic narrative paragraph |
GET /api/discoveries/{symbol} | Reading-pass per-paper findings |
GET /api/teleology/{symbol} | Synthesis-pass mechanistic history |
GET /api/mechanism_profile/{symbol} | Controlled-vocab terms |
GET /api/uniprot/{symbol} | UniProt prefetch slice |
GET /api/corpus/{symbol} | Source papers (citation-ranked) |
GET /api/paper/{pmid} | Paper lookup by PMID |
GET /api/search?q={term} | Search across narratives |
GET /api/neighborhood/{symbol}?hops=N | Graph neighborhood (cytoscape JSON) |
Example
curl https://affinage-production.up.railway.app/api/mechanistic_narrative/HJURP
MCP server
For Claude Desktop, Cursor, and other MCP-aware clients, ten read-only tools mirror the REST endpoints above. The tools accept typed arguments (gene symbol, hop count, etc.) and return structured JSON strings. No tokens, accounts, or rate limits beyond Railway's edge.
Claude Desktop
- Open Settings → Developer → Edit Config (this opens
claude_desktop_config.jsonin your editor). - Merge the snippet below into the file. If
mcpServersalready exists, just add the"affinage"entry inside it. - Save and fully quit Claude Desktop, then reopen. The Affinage tools appear in the tool picker (the slider/wrench icon in the composer).
- Try a query like “use Affinage to get the mechanistic narrative for HJURP”.
{
"mcpServers": {
"affinage": {
"url": "https://affinage-production.up.railway.app/mcp",
"transport": "streamable_http"
}
}
}
Cursor / Continue / other MCP clients
Any client that speaks MCP's streamable-HTTP transport works the same
way: point it at https://affinage-production.up.railway.app/mcp.
Cursor's MCP config lives at ~/.cursor/mcp.json; Continue
reads its own config.json. Use the same JSON shape as above.
Tool list
get_geneget_mechanistic_narrativeget_discoveriesget_teleologyget_mechanism_profileget_uniprotget_corpusget_papersearch_genes