adrija26sg/mcp-server-for-doctoralliance
If you are the rightful owner of mcp-server-for-doctoralliance and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Healthcare-focused AI Agent Dashboard & MCP Server is designed to streamline AI-driven healthcare workflows, integrating various communication and AI technologies.
AgenticalDoctorAlliance
Healthcare-focused AI Agent Dashboard & MCP Server
This repository contains a Model-Context-Protocol (MCP) FastAPI server paired with a Streamlit dashboard, designed to orchestrate AI-driven healthcare workflows (appointment reminders, follow-up calls, billing updates). It integrates with:
- Gemini/CrewAI for AI response generation
- SendGrid (via Single Sender) for outbound email
- Twilio (Test or Live) for outbound SMS
- Gmail API for inbound email monitoring
- ** WebSocket** for real-time popup notifications
Flowchart
Sequence Diagram
Repository Structure
adrija-crewai-agent/
āāā .env.example # Template for environment variables
āāā requirements.txt # Python dependencies
āāā src/
āāā doctoralliance_agent/
āāā __init__.py
āāā server.py # FastAPI MCP endpoints
āāā streamlit_app.py # Streamlit UI
āāā crew.py # Optional CrewAI kickoff script
āāā persona_resolver.py
āāā data_fetcher.py
āāā summary_builder.py
āāā vault.py
āāā agents/
ā āāā __init__.py
ā āāā prompt_builder.py
ā āāā gemini_agent.py
āāā delivery/
ā āāā __init__.py
ā āāā channel_selector.py
ā āāā email.py
ā āāā sms_gateway.py
ā āāā popup.py
ā āāā logger.py
āāā escalation/
ā āāā __init__.py
ā āāā reminder_scheduler.py
ā āāā retry_agent.py
āāā gmail/
āāā __init__.py
āāā gmail_agent.py
āāā nlp_parser.py
āāā response_handler.py
Quickstart
1. Clone the repo
git clone https://github.com/your-org/adrija-crewai-agent.git
cd mcp-server-for-doctoralliance
2. Environment Variables
Copy .env.example
to .env
and fill in your credentials:
# Windows PowerShell
Copy-Item .env.example .env
# Linux/macOS
cp .env.example .env
Edit .env
:
FASTAPI_HOST=0.0.0.0
FASTAPI_PORT=8000
# Gemini/CrewAI
GEMINI_API_KEY=sk-...
GEMINI_MODEL=gemini-2.0-flash-001
# SendGrid (Single Sender)
SENDGRID_API_KEY=SG-...
FROM_EMAIL=your_verified@domain.com
# Twilio (for SMS testing)
TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...
TWILIO_FROM_NUMBER=+15005550006
# Gmail (optional)
GMAIL_CREDENTIALS_PATH=./credentials.json
# WebSocket (optional)
WS_URL=ws://localhost:6789
Place your credentials.json
(Gmail OAuth) next to .env
if using inbound email.
3. Install Dependencies
python -m venv venv
# Windows
venv\Scripts\Activate.ps1
# macOS/Linux
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
4. Run the MCP Server
uvicorn doctoralliance_agent.server:app \
--reload --host $FASTAPI_HOST --port $FASTAPI_PORT \
--app-dir src
5. Launch the Streamlit UI
streamlit run src/doctoralliance_agent/streamlit_app.py
Visit http://localhost:8501
in your browser.
MCP Endpoints
-
POST
/mcp/retrieve
- Body:
{ "event_type": "appointment_reminder" }
- Response:
{ "persona": "...", "context": { ... } }
- Body:
-
POST
/mcp/plan
- Body: output of
/retrieve
- Response:
{ "persona": "...", "summary": "..." }
- Body: output of
-
POST
/mcp/generate
- Body: output of
/plan
- Response:
{ "persona": "...", "response": "..." }
- Body: output of
-
POST
/mcp/respond
- Body:
{ "event_type":"...", "response":"...", "context":{...} }
- Response: delivery results JSON
- Body:
Customization
- Persona Resolver (
persona_resolver.py
): map events to personas - Vault (
vault.py
): stubbed EHR/Billing/HHA calls - Prompt Builder (
agents/prompt_builder.py
): persona-specific instructions - GeminiAgent (
agents/gemini_agent.py
): integrates with CrewAI/Gemini - Delivery Channels (
delivery/
): email, SMS, popup - Escalation (
escalation/
): retries and reminders - Gmail Listener (
gmail/
): parse inbound replies
Testing
- Use Invoke-RestMethod in PowerShell for quick API tests
- Use test_sms.py and test_email.py scripts for isolated channel testing