Affinage

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

Base URL
https://affinage-production.up.railway.app/api
Interactive docs
/docs (Swagger UI)
EndpointReturns
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=NGraph neighborhood (cytoscape JSON)

Example

curl https://affinage-production.up.railway.app/api/mechanistic_narrative/HJURP

MCP server

Endpoint
https://affinage-production.up.railway.app/mcp
Transport
Streamable HTTP (no auth)

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

  1. Open Settings → Developer → Edit Config (this opens claude_desktop_config.json in your editor).
  2. Merge the snippet below into the file. If mcpServers already exists, just add the "affinage" entry inside it.
  3. Save and fully quit Claude Desktop, then reopen. The Affinage tools appear in the tool picker (the slider/wrench icon in the composer).
  4. 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