Inspiration Three hundred million people worldwide live with a rare disease. A child waits an average of 5.6 years and sees 7 different doctors before diagnosis — and 30% of these children don't survive past age 5. DeepRare (Nature, Feb 2026) proved an LLM-powered multi-agent system can outperform experienced physicians at this task — but it's research-only, not FHIR-integrated, and produces nothing a family can read. ARPA-H launched the RAPID program in Dec 2024 to attack this exact problem. TinyDx brings rare-disease AI into the interoperable MCP ecosystem so it can run inside any clinic that adopts Prompt Opinion's platform.

What it does (bulleted)

  • Pulls scattered conditions, observations, encounters, and family history from FHIR R4 and assembles a unified chronological timeline across all providers
  • Maps clinical findings to standardized HPO terms, validated against the live HPO API
  • Generates a ranked rare-disease differential with a self-reflection loop (DeepRare-inspired, bounded to 3 iterations), cross-referenced against Orphanet
  • Recommends specific next steps — which genetic test, which specialist, what to monitor
  • Produces a compassionate, plain-language Navigator Report for the family
  • Analyzes hereditary patterns from FHIR FamilyMemberHistory
  • Exports the whole case as a GA4GH Phenopacket v2.0 for global interoperability

How we built it

  • TypeScript + Node 20, Express, Streamable HTTP transport per Prompt Opinion's reference
  • @modelcontextprotocol/sdk 1.25.1 with stateless per-request McpServer pattern
  • Claude Sonnet 4 for phenotype extraction, differential reasoning, and Navigator Report generation
  • HPO (NLM Clinical Tables), Orphanet (orphadata.com), and OMIM APIs as the knowledge layer
  • HAPI FHIR public test server for synthetic patient data (no real PHI)
  • SHARP context propagation via HTTP headers (x-fhir-server-url, x-fhir-access-token, x-patient-id)
  • FHIR extension declared (ai.promptopinion/fhir-context) with 5 patient scopes for marketplace discovery
  • Deployed on Railway, published to Prompt Opinion Marketplace, wired into a BYO agent (Gemini Flash for tool-chaining speed)
  • Power of 15 compliance: bounded loops, ≤60-line functions, ≥2 assertions per tool, no recursion, no PHI in logs, exact pinned versions

Challenges we ran into

  • MCP SDK 1.25.1 strips unknown keys from ServerCapabilities during serialization — had to patch the low-level Server._capabilities directly to land the FHIR extension
  • Prompt Opinion's SHARP x-fhir-server-url redirects to the platform's FHIR server, but our synthetic patients live on HAPI — solved by ignoring the platform redirect for the FHIR base URL
  • TypeScript TS2589 deep-instantiation issues with single-field and enum Zod schemas through the MCP SDK — pragmatic @ts-expect-error
  • HAPI FHIR is periodically wiped — wrote a re-loader script for both synthetic bundles
  • Gemini Pro looped on tool chaining; switching the BYO agent to Gemini Flash fixed it

Accomplishments we're proud of

  • First MCP server for rare-disease diagnostics, built end-to-end in under four weeks
  • Two synthetic patients tested in-platform: Lily Chen → Marfan Syndrome (#1 HIGH, 100% phenotype overlap) and Noah Williams → Tay-Sachs (#1 HIGH) — completely different disease classes, both correctly diagnosed
  • True interoperability: FHIR in, Phenopacket out, HPO + Orphanet in the middle
  • Family Navigator Report — the emotional payload no other tool produces

What we learned

  • Self-reflection loops dramatically reduce hallucination when bounded (3 iterations was the sweet spot)
  • The clinical-phenotype pathway (pre-genetic-testing) is where the upstream bottleneck actually lives — Exomiser and friends solve a downstream problem
  • MCP makes specialty tooling deployable into any host that speaks the protocol — that is exactly what rare-disease care needs

What's next

  • OMIM clinical-synopsis enrichment for top candidates
  • Connect to a real FHIR-enabled pediatric subspecialty clinic for a pilot (CHOP-style setting)
  • Add a triage tool that flags red-flag findings (e.g. aortic root Z-score) for urgent escalation
  • Submit to the MCP Connectors Directory once the hackathon clears

Built With

Share this project:

Updates