MCP Hospital Assistant

MCP Hospital Assistant

An intelligent hospital appointment management system that allows users to add doctors/patients, book appointments, and view medical schedules through both a manual UI and an LLM-powered assistant interface.

Category
Visit Server

README

🏥 MCP Hospital Assistant

A full-stack intelligent hospital appointment management system powered by React, Node.js, PostgreSQL, and Mistral LLM (via Ollama).

🔥 Preview

🎥 Demo Video

▶️ Click here to watch the demo

🏠 Dashboard

Dashboard

💬 LLM Chat Assistant

LLM Chat

💬 Mannual Booking

LLM Chat

🔁 Node.js + Express

🎨 React.js (frontend)

🧠 LLM (Ollama - Mistral)

💾 PostgreSQL

🛡️ Session-based login

📷 UI Preview

Login / Register Page

Dashboard with buttons to manage system manually

Book Appointment (manual)

LLM-powered auto assistant interface

📁 Project Structure

├── backend/ │ ├── server.js # Node.js + Express backend │ ├── config/config.js # PostgreSQL config │ ├── mcp/ # All business logic handlers │ ├── auth/ # Login, register, session routes ├── frontend/ │ └── mcp-ui/ # React frontend │ ├── components/ # AddDoctor, Chat, Login, Home etc. │ └── App.js # Main route controller

⚙️ Setup Instructions

  1. ✅ Install PostgreSQL and create DB

sudo apt install postgresql postgresql-contrib sudo -u postgres psql

Then run:

CREATE DATABASE mcp; CREATE USER mcpuser WITH PASSWORD 'mcppass'; GRANT ALL PRIVILEGES ON DATABASE mcp TO mcpuser;

  1. 📦 Create Schema

Connect:

psql -U mcpuser -d mcp -h localhost

CREATE TABLE doctors ( doctor_id SERIAL PRIMARY KEY, name TEXT, department TEXT, available_slots JSONB );

CREATE TABLE patients ( patient_id SERIAL PRIMARY KEY, name TEXT, age INTEGER, contact TEXT );

CREATE TABLE appointments ( appointment_id SERIAL PRIMARY KEY, doctor_id INTEGER REFERENCES doctors(doctor_id), patient_id INTEGER REFERENCES patients(patient_id), appointment_time TEXT );

CREATE TABLE users ( id SERIAL PRIMARY KEY, username TEXT UNIQUE, password TEXT );

GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO mcpuser; GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO mcpuser;

  1. 🧠 Install Ollama with Mistral

curl -fsSL https://ollama.com/install.sh | sh ollama run mistral

Make sure the local Ollama server is running and available on default port 11434. 4. 🚀 Backend Setup (Node.js)

cd backend/ npm install node server.js

This starts backend on: http://localhost:3007 5. 💻 Frontend Setup (React)

cd frontend/mcp-ui npm install npm start

This starts frontend at: http://localhost:3000 🧠 Key Functionalities ✨ Mode 1: Manual via UI

You can click on homepage icons to:

➕ Add Doctor

➕ Add Patient

📅 Book Appointment

📋 View Doctors

📋 View Appointments

These UI features directly use API endpoints (/api/execute, /api/book, etc.) 🔍 Mode 2: Smart Assistant (LLM-enabled)

From the "Ask Assistant" chat interface:

Type: Show all appointments

Or: Book appointment for patient John with doctor 2 at 10:00

✅ If MCP Tools is enabled (checkbox at top), the LLM will:

🔎 Understand user command

🔧 Choose correct tool from tools.json

🧠 Generate SQL

🔁 Automatically execute API calls behind the scenes

❌ If disabled, LLM simply gives plain answers (no system change). 🔐 Authentication

Only authenticated users can access core pages.

Register page stores hashed credentials securely in PostgreSQL.

Session stored using express-session.

📝 Example Prompts for LLM

Show all the doctors in doctor table Show appointments after 11:00 Book an appointment with Dr. Renu at 09:00 for John (age 30)

✅ Summary Feature Manual UI LLM Tools Add Doctor ✅ Yes ✅ via prompt Book Appointment ✅ Yes ✅ if slot available View Doctors/Appointments ✅ Yes ✅ via prompt Edit Slots ✅ Yes (via query) ✅ via prompt Security 🔐 Session Login 🔐 Session Protected

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