Skip to main content
Glama
README.md
# 🏥 MedFlow MCP

**MedFlow MCP** is an AI-powered Hospital Operations server built with [NitroStack](https://nitrostack.ai). It serves as the "brain" for modern healthcare management, allowing AI assistants (like Claude, Cursor, and Nitro Studio) to seamlessly interact with hospital databases, trigger automated alerts, schedule appointments, and manage maintenance via Jira.

Built for the **NitroStack MCP Hackathon**, this project demonstrates how the Model Context Protocol (MCP) can completely revolutionize complex operational workflows in a healthcare setting.

---

## ✨ Key Features

- **🎫 Automated Jira Integration**: AI can automatically detect malfunctioning hospital equipment (e.g., MRI machines, Defibrillators) from natural language and instantly generate a formatted Jira ticket for the maintenance team via the Atlassian API.
- **🎨 Glassmorphism UI Widgets**: Includes rich, beautifully styled Next.js frontend widgets that pop up natively inside the AI chat interface (Patient Profiles, Doctor Dashboards, and Surgery Readiness checklists).
- **🩺 Patient & Appointment Management**: Exposes AI tools for scheduling follow-ups, prioritizing critical patients, and viewing real-time doctor queues.
- **🚨 Emergency Alerting System**: Tools to broadcast critical CODE emergencies directly to ER teams via Webhook (Slack/Discord).
- **🧠 Diagnostic Vision AI (Mock)**: A tool designed to read X-rays and MRI scan notes to provide instant clinical AI impressions.

---

## 🛠️ Tech Stack

- **Framework**: [NitroStack](https://nitrostack.ai) (Official MCP Framework)
- **Backend**: Node.js, TypeScript
- **Frontend (Widgets)**: Next.js, React, Tailwind CSS, Framer Motion
- **Integrations**: Atlassian Jira API v3 (REST)

---

## 🚀 How to Run Locally

### 1. Clone the Repository
```bash
git clone https://github.com/tsjharsha/MedFlowMCP-AI-.git
cd MedFlowMCP-AI-
```

### 2. Install Dependencies
```bash
npm install
npm --prefix src/widgets install
```

### 3. Environment Variables
Create a `.env` file in the root directory and add your Jira API credentials:
```env
JIRA_DOMAIN=your-team.atlassian.net
JIRA_PROJECT_KEY=SCRUM
JIRA_EMAIL=your-email@domain.com
JIRA_API_TOKEN=your-jira-api-token
```

### 4. Start the Server
Start the development server with hot-reloading for both the backend MCP server and frontend widgets:
```bash
npm run dev
```

---

## 🔌 Connecting to an AI Client

Because this is an MCP Server, you don't interact with it directly through a browser. You connect an AI to it! 

1. **Nitro Studio**: Start your local server, open [Nitro Studio](https://nitrostack.ai/studio), and connect to `http://localhost:3000/mcp`.
2. **Cursor IDE**: Go to Settings -> Features -> MCP -> Add New. Select `SSE`, name it `MedFlow`, and set the URL to your deployed NitroCloud URL or `http://localhost:3000/mcp`. 

Once connected, simply talk to the AI (e.g., *"Show me the dashboard for Doctor Alice"* or *"Report that the X-Ray in the lab is broken"*) and watch it use the tools and render the widgets!

---

*Built with ❤️ for the NitroStack Hackathon.*

TDQS

B3.2/5.0

Scored across 10 tools

Disambiguation5/5

Each tool targets a distinct action or resource: patient registration, history retrieval, appointment scheduling, queue management, follow-up scheduling, queue prioritization, consultation recording, note generation, lab tests, and image analysis. No significant overlap.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (e.g., register_patient, schedule_appointment, analyze_medical_image). No mixing of conventions.

Tool Count5/5

10 tools cover the main workflows of a medical practice: patient management, appointments, queue, consultations, lab, and imaging. Not too few or too many.

Completeness4/5

Covers core clinical operations well, including patient history, appointments, queue, consultation notes, lab tests, and image analysis. Minor gaps like billing or discharge are absent but not critical for the apparent scope.

Maintenance

ActivityStale
ResponsivenessNo issues