hospital-ai-secure-assistant
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hospital-ai-secure-assistantWhat are your visiting hours?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Hospital AI System
A simulated enterprise healthcare backend and UI for testing role-based AI assistants, hospital workflows, secure document approvals, prompt-injection defenses, and MCP-style tool access.
The project includes:
FastAPI backend
SQLite demo database
Role-based JWT authentication
Patient, staff, and management chat surfaces
Public patient FAQ mode before login
Secure Document Vault for approved confidential supervisor documents
MCP-style tool listing and invocation endpoints
Mock AI mode for local demos without external AI keys
1. Quick Setup
Run this from the project root on Windows PowerShell:
.\setup.ps1The script will:
create
.venvif it does not existinstall Python dependencies
create
.envif missinggenerate
hospital.dbif missingcreate
secure_vault/if missing
To recreate demo data from scratch:
.\setup.ps1 -ResetDbTo setup and start the server immediately:
.\setup.ps1 -StartServerIf PowerShell blocks script execution, run:
Set-ExecutionPolicy -Scope CurrentUser RemoteSignedThen rerun:
.\setup.ps12. Manual Setup
If you do not want to use the setup script:
python -m venv .venv
.\.venv\Scripts\activate
python -m pip install --upgrade pip
pip install -r requirements.txt
python generate_hospital_data.pyCreate .env:
HOSPITAL_AI_PROVIDER=mock
JWT_SECRET=hospital-dev-secret
REPORT_GENERATION_DELAY_SECONDS=03. Run Locally
Start the app:
.\.venv\Scripts\python.exe -m uvicorn app:app --host 127.0.0.1 --port 8000Open:
Main dashboard:
http://127.0.0.1:8000/Patient chat:
http://127.0.0.1:8000/patientStaff chat:
http://127.0.0.1:8000/staffManagement chat:
http://127.0.0.1:8000/managementSecure Document Vault:
http://127.0.0.1:8000/vaultSwagger API docs:
http://127.0.0.1:8000/docsHealth/status:
http://127.0.0.1:8000/api/status
4. Run With Ngrok
Install ngrok, then start your local server first:
.\.venv\Scripts\python.exe -m uvicorn app:app --host 127.0.0.1 --port 8000In another terminal:
ngrok http 8000Ngrok will print a public URL like:
https://example-name.ngrok-free.devShare these with testers:
https://example-name.ngrok-free.dev/patienthttps://example-name.ngrok-free.dev/staffhttps://example-name.ngrok-free.dev/managementhttps://example-name.ngrok-free.dev/vaulthttps://example-name.ngrok-free.dev/docs
If you use a fixed ngrok domain, point it to the same local port your FastAPI app is running on.
To inspect active ngrok tunnels locally:
Invoke-RestMethod http://127.0.0.1:4040/api/tunnels5. Demo Accounts
Username | Password | Role |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6. Chat Surfaces
Patient Chat
URL:
/patientAPI:
POST /chat/patientBehavior:
Without login: public hospital FAQ mode
With
PATIENTlogin: private patient mode
Public mode can answer general questions about:
services
appointment process
lab services
billing support
emergency guidance
medical-record request process
Public mode cannot reveal:
patient profile
medical records
lab reports
billing records
prescriptions
insurance claims
appointment status
Staff Chat
URL:
/staffAPI:
POST /chat/staffRequires one of:
DOCTORNURSELAB_TECHRECEPTIONISTBILLING_INSURANCE
Each staff role only sees tools allowed for that role.
Management Chat
URL:
/managementAPI:
POST /chat/managementRequires:
SUPER_ADMINHOSPITAL_SUPERVISOR
Management role split:
Supervisor creates secure document requests and checks own request status.
Admin approves/rejects document requests and views pending queue.
Admin does not create supervisor document requests.
Supervisor does not approve requests.
7. Secure Document Vault
URL:
/vaultAPIs:
GET /vault/docs
GET /vault/docs/{request_id}Allowed roles:
SUPER_ADMINHOSPITAL_SUPERVISOR
Denied roles:
PATIENTDOCTORNURSELAB_TECHRECEPTIONISTBILLING_INSURANCE
Vault behavior:
Supervisor creates confidential document requests from management chat.
The generated document content is stored in
secure_vault/.Chat never displays confidential document content.
Request stays
PENDING_ADMIN_APPROVAL.Admin approves/rejects.
After approval, supervisor signs into
/vaultagain to view their own approved docs.Admin signs into
/vaultto view all approved docs.
8. API Endpoints
Method | Endpoint | Auth | Description |
|
| No | Main UI |
|
| No | Patient UI |
|
| No page auth, chat requires JWT | Staff UI |
|
| No page auth, chat requires JWT | Management UI |
|
| No page auth, vault APIs require JWT | Secure Document Vault UI |
|
| No | Swagger/OpenAPI docs |
|
| No | Service status |
|
| No | Login and receive JWT |
|
| Optional | Public patient FAQ or signed-in patient chat |
|
| Yes | Staff chat |
|
| Yes | Management chat |
|
| No | MCP health |
|
| Yes | List tools available to signed-in role |
|
| Yes | Invoke a tool directly |
|
| Yes/token query | MCP SSE stream |
|
| Yes/token query | MCP SSE message endpoint |
|
| Yes | List approved vault docs |
|
| Yes | Read approved vault doc |
9. Database
Main SQLite database:
hospital.dbGenerated by:
python generate_hospital_data.pyImportant tables include:
usershospital_staffdoctorspatientsappointmentsmedical_recordsprescriptionslab_reportsbillinginsurancehospital_documentsaudit_logsmanagement_report_requests
management_report_requests stores metadata for secure document requests. The confidential document body is stored in secure_vault/.
10. Security Model
JWT authentication
Role-based access control
Patient self-access isolation
Staff tools limited by role
Supervisor creates confidential document requests
Admin approves/rejects confidential document requests
Vault requires separate sign-in
Vault content is not served from
/staticChat does not display confidential vault document bodies
Prompt filtering blocks obvious prompt-injection attempts
Audit logs record tool execution attempts
11. Recommended Demo Flow
Open
/patient.Ask public question without login:
What services does the hospital provide?Sign in as
patient1.Ask:
Show my lab reportsOpen
/management.Sign in as
supervisor1.Ask:
Create lab reports document for patient 1Sign out/refresh or login as
admin.Ask:
Show pending document requests Approve document request 1Open
/vault.Sign in as
supervisor1to see own approved docs.Sign in as
adminto see all approved docs.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Rohit-ds26/hospital-ai-secure-assistant'
If you have feedback or need assistance with the MCP directory API, please join our Discord server