hospitalverse-mcp
Enables management of hospital operations through MCP tools for bed allocation, staff assignment, equipment tracking, and event simulation, with conflict resolution and live audit trail.
README
hospitalverse-mcp
Rule-based Layer 2 agent logic + Layer 1 tool surface for HospitalVerse AI,
matching the architecture in HospitalVerse_Architecture.md. This is
build-order step 2 ("deterministic agents producing the same JSON
shape a real agent would") — swap in LangGraph + an LLM per module
(step 3) without touching the tool contracts, then MCP-ify (step 4).
What's here vs. what's new
Everything in src/ implements the tool surface from architecture §4.
Two things go beyond the original doc, from the review pass:
- Visible conflict resolution.
coordinator.tsdoesn't just chain agent outputs — when the Bed Agent's top pick lands in an understaffed ward, or a doctor is over capacity, the Coordinator picks between two real options and records both: what it rejected, what it chose, and why. That's whatActionStep.conflictcarries through to the Explainer prompt and the dashboard. - A queryable audit trail.
audit.resources.tsexposesaudit://trail/{agent}andaudit://trail/by-event/{eventId}as MCP Resources, not just a database table. Every tool call already writes to the log viawithAudit()instate/dts.ts— these resources are what let a judge (or a real compliance reviewer) query it live.
Run it standalone (no MCP, no Studio)
npm install
npm run dev
src/index.ts runs a CLI demo: injects an ambulance surge, runs the
Coordinator, and prints the resulting action chain — including the
conflict-resolution step — plus the audit log size. Good for verifying
agent logic works before wiring up Studio.
Wire it into NitroStack Studio
The folder layout here matches what nitrostack-cli init scaffolds
(src/index.ts, app.module.ts, modules/*.tools.ts), but doesn't
depend on @nitrostack/core yet — src/lib/define-tool.ts is a thin
stand-in. To go from "runs standalone" to "connects in Studio":
nitrostack-cli init hospitalverse-mcp --template typescript-starter- Copy this
src/tree into the scaffolded project, replacing the starter's calculator example. - In
src/lib/define-tool.ts, swap the plaindefineTool/defineResourcefunctions for whatever@nitrostack/coreexports — every module here only imports from that one file. npm run dev, then Studio → Add Server → Nitro Project → pick the folder (handbook §4). The Tools/Resources pages will list everything inapp.module.tsautomatically.- For the "no user typed a question" wow-moment: deploy, then connect
to ChatGPT (handbook, "How to connect to ChatGPT") and call
sim.inject_eventfrom a ChatGPT chat instead of a dashboard button — proves the MCP surface is a real interop layer, not just internal plumbing for your own UI.
Files
src/
├── index.ts # standalone CLI demo / bootstrap
├── app.module.ts # registers every tool + resource
├── lib/define-tool.ts # @nitrostack/core stand-in — swap here
├── state/
│ ├── dts.ts # Digital Twin State + event bus + audit hook
│ └── state.tools.ts # state.get_snapshot, get_historical_trend
├── predict/predict.tools.ts # predict.occupancy (Forecaster Agent)
├── beds/beds.tools.ts # beds.*, patients.list_dischargeable
├── staff/staff.tools.ts # staff.* (Staffing Agent)
├── equipment/equipment.tools.ts # equipment.* (Equipment Agent)
├── sim/sim.tools.ts # sim.inject_event — demo trigger
├── audit/audit.resources.ts # audit://trail/* — the new compliance surface
├── coordinator/
│ ├── coordinator.ts # conflict-resolution logic, two cascades
│ └── explainer.prompts.ts # Explainer Agent prompt + fallback
└── health/health.ts # health check for Studio's Health page
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.