Inspiration

A close friend of mine studies medicine and practices with case studies regularly. I noticed the cases are usually static, just text on a page, and I found that boring: not immersive, not engaging. There are existing simulation tools, but most of them are resource-heavy and complex to set up. I wanted something simple, animated, and genuinely engaging instead.

What it does

MedSim is a web-based clinical case simulator for medical students. Students explore an interactive environment and perform actions on the entities within it: the patient, equipment like the defibrillator, and tools they can equip. Each action returns a specific result based on what they interacted with. Once a student has gathered their findings, they submit their answer and synthesis against the case's goal. An AI grader, using GPT-5.6 Terra, scores the submission against a structured rubric and provides a written medical synthesis as a review, so the feedback is explainable rather than a single opaque score. Students can also create their own custom cases two ways: directly on the web, by providing a map, case title, and optional preferences, or through an MCP connection from ChatGPT. Both paths are handled by the CaseGenerator agent.

How we built it

MedSim was built end to end with Codex, powered by GPT-5.6 Terra. It follows a monolithic architecture: React on the frontend, FastAPI on the backend, and FastMCP as the MCP server. We gave Codex a detailed description of the problem, then had it plan and scope the build to fit a 4-day window. For the frontend, we provided rough sketches of the simulation environment, along with the animation style we wanted for equipment and tools. We had Codex skills for each entity type so the app would stay visually consistent if we expand to new maps later. For the backend, we planned the API endpoints and their parameters before writing any implementation. For reliable, reproducible setup across machines, we containerized the whole service with Docker.

Challenges we ran into

Designing the simulation environment was the first real challenge. My early attempts weren't immersive or engaging enough. I sketched a rough layout and interaction flow in Figma, kept it deliberately minimal, and Codex was able to interpret that and turn it into something much more fluid than my sketch. The AI grader and case generator initially produced unreliable structured output. The root cause was calling OpenRouter directly with no schema enforcement, so responses varied in shape from call to call. Switching to the LangChain framework for structured output solved this by enforcing a consistent schema on every response. Connecting the app to ChatGPT was the hardest part of the whole build. With research done alongside Codex, I worked through setting up the tunnel and the required API keys to get a local MCP server reachable from ChatGPT.

Accomplishments that we're proud of

  • Building a working prototype of MedSim was genuinely satisfying. What would normally take months of research and development came together in days.
  • This was my first time setting up and connecting an MCP server to ChatGPT, from tunnel configuration through to a working custom connector.

What we learned

Structured output from an LLM is not reliable by default. Calling a model directly and hoping for consistent JSON back is fragile; enforcing a schema through a framework like LangChain is what actually makes AI-generated content usable in a real application.

I also learned how MCP and tunneling fit together conceptually: ChatGPT cannot reach a local server directly, so a tunnel client carries requests from ChatGPT to a local MCP server over an outbound connection. Understanding that architecture was the key that unlocked the whole integration. Beyond the technical side, I learned how much a well-scoped plan matters under a hard deadline. Early on I designed a much larger version of this project, and scoping it down to a single environment class with a shared equipment set was what actually made it finishable. Ambition is easy; finishing is the harder skill, and it's the one this hackathon forced me to practice.

What's next for MedSim

I plan to research different types of medical cases alongside medical students and expand the equipment, tools, and environments based on that research. I also want to improve environment interaction: instead of highlighting a specific portion of an entity on hover, I'd like to highlight the entity's full outline for clearer feedback. Longer term, I want to expand horizontally. Other fields also use case-study-based learning: law, chemistry, and even subsets within medicine itself. By improving the core simulation engine to stay domain-agnostic, MedSim could support case studies well beyond its original scope.

Built With

Share this project:

Updates