caelum0x 9b91a4a968 feat: connect PaperTrail to Claude Science (MCP connectors, skills) + Google auth
Make PaperTrail plug into Anthropic's Claude Science workbench four ways:
- Remote URL connector: hosted Streamable-HTTP MCP at /api/mcp (45 public tools)
- Local command connector: standalone stdio MCP package under mcp/ (47 tools,
  incl. 2 API-key tools) — @modelcontextprotocol/sdk, calls the live API
- Skills: 8 Claude Science Agent Skills under skills/ (import from GitHub / upload)
- Network: docs to allow-list the API domain for the curl path
- Public /connect page showcasing all four methods (judges can see it, no login)

Also:
- Google OAuth sign-in ("Continue with Google") on login + register, wired to
  GOOGLE_CLIENT_ID/SECRET; users.password_hash now nullable + auth_provider/
  google_sub (migration 0061); password login guards Google-only accounts
- Landing design: center + enlarge the claim input; bigger textarea

tsc clean; app build compiles 362 pages; local MCP smoke-tested end-to-end.
2026-07-10 17:06:04 +03:00

2.7 KiB
Raw Permalink Blame History

name, description
name description
papertrail-safety-signal Compute a pharmacovigilance disproportionality signal (PRR and ROR with CIs) for a drug-event pair from FDA FAERS. Use when a scientist asks whether a drug is associated with an adverse event, or wants to reproduce/quantify a safety signal from a published 2x2 table.

PaperTrail: Safety Signal (Pharmacovigilance)

Compute disproportionality statistics — PRR (Proportional Reporting Ratio) and ROR (Reporting Odds Ratio) with confidence intervals — for a drug-adverse-event pair, from the FDA FAERS spontaneous-reporting database.

Hard guarantees (state these to the user)

  • Deterministic recompute — PRR, ROR, and their CIs are computed by a fixed statistical engine from the 2x2 contingency table. Same counts, same signal.
  • Grounded in real reports — the 2x2 is fetched from openFDA/FAERS (or supplied directly), so the signal traces back to actual report counts, not a model's guess.
  • Honest absence — if the drug-event pair has no retrievable reports, the result says found: false rather than manufacturing a signal.
  • Disproportionality ≠ causation. Always state that a signal flags a reporting association for review, not a proven causal effect.

Step 1 — Call the tool (two input modes)

Preferred: the bio_safety_signal MCP tool.

Mode A — by name (fetches the 2x2 from FAERS):

  • drug (string, required, 1–200 chars)
  • event (string, required, 1–200 chars) — the adverse event term

Mode B — from a pre-assembled 2x2 (deterministic, no network; reproduce a published table):

  • a, b, c, d (non-negative integers) — the contingency counts.

Step 2 — Read the result

Report PRR and ROR each with their 95% CI, the underlying counts, and whether the lower CI bound clears the usual signal threshold. Add the causation caveat.

curl fallback (no MCP connector installed)

Base URL: https://papertrail-topaz-phi.vercel.app. No API key required.

By name:

curl -sS -X POST https://papertrail-topaz-phi.vercel.app/api/bio/safety-signal \
  -H 'Content-Type: application/json' \
  -d '{ "drug": "rosiglitazone", "event": "myocardial infarction" }'

From a published 2x2:

curl -sS -X POST https://papertrail-topaz-phi.vercel.app/api/bio/safety-signal \
  -H 'Content-Type: application/json' \
  -d '{ "a": 120, "b": 880, "c": 4300, "d": 210000 }'

Returns the standard { success, data, error } envelope.

Notes

  • Use exact MedDRA-style event terms where possible for a cleaner FAERS pull.
  • FAERS is spontaneous reporting: subject to reporting bias, confounding by indication, and no denominator of exposed patients. State these limits.