Inspiration

Emergency chest-pain triage is rarely a clean, complete-data problem. Clinicians often need to make fast handoff decisions while troponin is pending, ECG interpretation is evolving, and important context is buried in fragmented notes. In Latin American and migrant-care settings, Chagas-compatible cardiomyopathy can also be overlooked when country-of-origin context, conduction disease, low-voltage QRS, and missing serology are not assembled into one workflow.

CardioTriage was inspired by that gap: not a model demo in isolation, but a practical MCP superpower that any Prompt Opinion clinician agent can call during a realistic emergency workflow. The product wedge is intentionally narrow: phenotype-aware emergency cardiovascular triage where structured, bilingual, auditable outputs surface overlooked cardiovascular differentials for confirmatory workup without claiming autonomous diagnosis.

What it does

CardioTriage (Path A: MCP Server submission) exposes six MCP tools for a Prompt Opinion BYO Agent. The agent first lists available synthetic cases, retrieves a FHIR R5-style bundle, checks missing critical data, runs phenotype-aware ECG inference, summarizes cardiovascular risk signals, and generates an SBAR-style handoff note in English, Spanish, or Portuguese.

For Case B (the demo), the agent identifies missing troponin, BNP/NT-proBNP, echocardiography, and Chagas serology; invokes interpret_12_lead_ecg; then composes a structured handoff that explains uncertainty and next workup. Tool #6 returns stemi_demo_score, afib_demo_score, and chagas_suspect_demo_score with calibration_status="uncalibrated_demo", plus evidence fields and a "NOT for clinical use" disclaimer. The agent surfaces a Chagas-compatible cardiomyopathy pattern warranting serology workup; it does not diagnose Chagas.

The deliverable is dual-listed on the public Prompt Opinion Marketplace:

How I built it

The server is a Python FastMCP application exposed through Streamable HTTP and deployed on Modal. It uses synthetic FHIR metadata plus public de-identified ECG samples from CODE-15 and SaMi-Trop, with provenance tracked in DATA_PROVENANCE.md. FHIR R5 bundles are validated through fhir.resources>=8.0.0 and include Patient, Encounter, Observation, Condition, and DiagnosticReport resources with LOINC and SNOMED-coded entries.

The MCP handshake declares optional ai.promptopinion/fhir-context scopes so the architecture is ready for SHARP-style context propagation. For ECG inference, ECGFounder embeddings (MIT-licensed, NEJM AI 2025) provide cross-cohort bridge phenotype detection (AUROC ≥0.99 on CODE-15 + SaMi-Trop for AF, RBBB, LBBB, 1dAVb, SB, ST). Heuristic signal features (low_voltage, qrs_duration_ms, st_elevation_mv) ground the Chagas-compatible cardiomyopathy pattern when latent embedding is insufficient. A sigmoid combination of latent + heuristic paths produces uncalibrated demo scores; clinical interpretation is routed through a Spanish-bilingual structured handoff.

Source code is open and MIT-licensed at: https://github.com/claudiomedina17/cardiotriage-mcp

Challenges I ran into

The main challenge was making the project strong enough for the hackathon without overstating clinical validity. A pure rules demo would be easy to explain but weak on AI Factor; a raw model claim would be risky without calibration. I solved this by using ECGFounder as a real foundation-model backbone, but labeling all scores as uncalibrated demo scores and avoiding any claim of clinical probability.

A secondary challenge was the Prompt Opinion publisher onboarding flow. At the time of initial Gate 0 verification, the listing was workspace-only because the publisher profile had not yet been completed. After completing the Marketplace Studio publisher profile and enabling A2A on the agent, both the MCP Server and the A2A Agent were successfully published to the public Marketplace. The product proof now includes a live MCP endpoint, a public Prompt Opinion Marketplace listing (dual), a public GitHub repository, and a six-tool agent trace demonstrated in the video.

Accomplishments I'm proud of

CardioTriage is not just a static healthcare chatbot. It is a composed MCP capability layer: FHIR retrieval, missing-data review, phenotype-aware ECG inference, risk signal summarization, and structured handoff generation — all happen as explicit tool calls with visible rationale.

The most important accomplishment is the safety posture. The system keeps clinical guardrails in the tool contract: calibration_status="uncalibrated_demo", no claim of validated clinical probability, escalation language when key data are missing, and the rule that a reassuring rule-based score must not override a dangerous ECG, unstable vital signs, rising troponin, or missing serial data.

The dual marketplace listing (MCP Server + A2A Agent) gives other Prompt Opinion users two integration paths into the same underlying tools — they can either add the MCP server to their workspace directly, or compose the A2A agent into a multi-agent workflow.

What I learned

The best hackathon story for clinical AI is not "the model makes a decision." It is "the agent composes auditable tools and makes uncertainty visible." The Prompt Opinion MCP interface made that lesson concrete: each tool call can expose why it was needed, what data it used, and which safety disclaimer applies.

I also learned that platform feasibility matters as much as model novelty. Modal autoscaling makes the endpoint cheap to keep available at $0 idle, the lite inference path keeps demos low-latency, and the GPU path remains available for real ECGFounder forward passes. Finally, the Marketplace publisher profile workflow taught me that "public publishing" is not gated by subscription — it is gated by completing the publisher metadata and (for agents) enabling A2A with at least one defined skill.

What's next

  • Conformal prediction over phenotype-aware scores when a representative calibration cohort with verified labels becomes available
  • Apparent-normal ECG hidden phenotype layer (cf. Lima-Ribeiro NatComm 2021 ECG-age) for sub-clinical risk stratification
  • Symptom-specific variants for syncope, palpitations, and dyspnea-with-cardiac-focus presentations
  • FHIR sandbox integration (HAPI FHIR R5 / Logica Sandbox SMART-on-FHIR OAuth2) for full hospital-simulation interoperability
  • Latam Cardiovascular Triage Pack: extension to HF, AF, post-MI follow-up with bilingual ES/EN/PT defaults

AI Factor

CardioTriage uses Generative AI in three composable layers:

  1. Foundation model embeddings (ECGFounder, MIT-licensed, NEJM AI 2025) provide cross-cohort bridge phenotype detection — AUROC ≥0.99 for arrhythmia and conduction phenotypes
  2. Contextual composition: when endemic exposure converges with suggestive bridge patterns (LBBB + low-voltage QRS in a Bolivian patient with rural origin), the agent composes evidence from latent embeddings + explicit signal features + missing critical data + clinical context to surface a Chagas-compatible cardiomyopathy differential — not to diagnose
  3. LLM agent (GPT-4o Mini) integrates the six tools with visible tool-call trace and concise clinical rationale, generating context-specific bilingual handoff notes (ES/EN/PT)

Potential Impact

In Latin American endemic regions, Chagas cardiomyopathy is an under-recognized differential when chest pain or heart failure presentation prompts ED triage. CardioTriage surfaces this differential automatically when country-of-origin, ECG findings (bridge phenotypes), and missing serology converge — reducing the chance of overlooking a WHO-priority neglected tropical disease in handoffs and structured documentation.

We do not propose AI-ECG as a replacement for serology; we propose it as a low-cost triage layer for resource-constrained endemic regions where serology access is limited or delayed.

Feasibility

Cross-cohort phenotype detection is empirically strong: bridge phenotypes (AF, RBBB, LBBB, 1dAVb, SB, ST) reach AUROC ≥0.99 across CODE-15 (n=80,001 records) and SaMi-Trop (n=1,631 cohort) on both ECGFounder and ECG-FM frozen embeddings. The MCP server uses Streamable HTTP transport, runs on Modal (autoscaling, $0 idle cost), validates all I/O with Pydantic-backed FHIR R5 schemas, declares SHARP-on-MCP scopes, and processes only public de-identified ECG samples (CODE-15 CC-BY 4.0, SaMi-Trop PhysioNet open access).

All scores are uncalibrated demo scores, transparently labeled as such. Disclaimers are mandatory at six surfaces. The architecture supports drift-aware re-calibration for production deployment.

Disclaimer: Synthetic demo data only. NOT for clinical use. The full six-tool agent trace is demonstrated in the demo video: https://youtu.be/AA-xYFDPw9g

Built With

  • docker
  • ecg-fm
  • ecgfounder
  • elevenlabs
  • fastmcp
  • fhir-r5
  • mcp
  • modal
  • openai-gpt-4o-mini
  • prompt-opinion
  • pydantic
  • python
  • streamable-http
Share this project:

Updates