shyamvaidhyanathan/PatientAppointmentMCP
If you are the rightful owner of PatientAppointmentMCP 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 Model Context Protocol (MCP) server is designed to expose APIs as callable tools, facilitating seamless integration with various agents and systems.
π₯ Patient Health Classification Agent
This project demonstrates how to use FastAPI, Model Context Protocol (MCP), and CrewAI to classify a patientβs health status based on their number of appointments in the past year. The system includes:
- A REST API for patient classification
- An MCP server exposing the API as a callable tool. The tools available in this MCP Server can be listed.
- An CrewAI Agent that invokes the tool given to it using the MCP Server to classify a patient.
π Project Structure
patient_classifier_agent_project/
βββ agent/
β βββ crewai_agent.py # ADK Agent using CrewAI
βββ api/
β βββ patient_classifier_api.py # FastAPI classification endpoint
βββ mcp/
β βββ mcp_server.py # MCP server wrapping the API
βββ tools/
β βββ classify_tool.py # Tool wrapper to interface API with agent
βββ data/
β βββ appointment_db.py # Dummy appointment data
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ .env
βοΈ Setup Instructions
git clone https://github.com/shyamvaidhyanathan/patient-health-agent.git cd patient-health-agent
Create a python virtual environment
python -m venv env source env/bin/activate # On Windows: env\Scripts\activate
Install Dependencies
pip install -r requirements.txt
βοΈ Execution Instructions
Running the Patient Classifier API found inside api directory
python api/main.py
Running the MCP Server
uvicorn mcp.mcp_server:app --reload --port 8001
Running the Agent
python agent/crewai_agent.py
π§ Health Classification Logic
The patient is classified based on the number of appointments in the past year:
CHRONIC: More than 10 appointments
MODERATE: 5 to 10 appointments
HEALTHY: Less than 5 appointments
π οΈ Tech Stack
FastAPI β for building REST API
CrewAI β for autonomous agent management
LangChain β for tool abstraction
Model Context Protocol (MCP) β for wrapping APIs as tools
Uvicorn β for serving ASGI apps
π License
MIT License
πββοΈ Maintainer
Shyam Vaidhyanathan