hospitalverse-mcp

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.

Category
Visit Server

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:

  1. Visible conflict resolution. coordinator.ts doesn'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 what ActionStep.conflict carries through to the Explainer prompt and the dashboard.
  2. A queryable audit trail. audit.resources.ts exposes audit://trail/{agent} and audit://trail/by-event/{eventId} as MCP Resources, not just a database table. Every tool call already writes to the log via withAudit() in state/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":

  1. nitrostack-cli init hospitalverse-mcp --template typescript-starter
  2. Copy this src/ tree into the scaffolded project, replacing the starter's calculator example.
  3. In src/lib/define-tool.ts, swap the plain defineTool/ defineResource functions for whatever @nitrostack/core exports — every module here only imports from that one file.
  4. npm run dev, then Studio → Add Server → Nitro Project → pick the folder (handbook §4). The Tools/Resources pages will list everything in app.module.ts automatically.
  5. For the "no user typed a question" wow-moment: deploy, then connect to ChatGPT (handbook, "How to connect to ChatGPT") and call sim.inject_event from 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured