A Model Context Protocol (MCP) server that provides intelligent medical guidance using Google's Gemini AI. This server offers comprehensive medical assistance including symptom analysis, OTC medicine suggestions, home remedies, and nearby pharmacy locations.
- 🤖 AI-Powered Medical Guidance - Uses Google Gemini for intelligent medical responses
- 💊 OTC Medicine Suggestions - Safe over-the-counter medication recommendations
- 🏠 Home Remedies - Natural treatment options with rationales
- 📍 Nearby Chemists - Location-based pharmacy finder using OpenStreetMap
- 📹 Educational Videos - Curated YouTube links for medical education
- 🚨 Red Flag Detection - Identifies symptoms requiring immediate attention
- 🔐 MCP Protocol - Full Model Context Protocol compliance for AI assistants
- 🌐 Web Interface - Beautiful chat interface for direct interaction
-
Clone the repository:
git clone https://github.com/vyagh/puch-ai-mcp-js-main.git cd puch-ai-mcp-js-main -
Install dependencies:
npm install
-
Set up environment variables:
cp env.example .env # Edit .env and add your Gemini API key -
Get a Gemini API key:
- Visit Google AI Studio
- Create a new API key
- Add it to your
.envfile asGEMINI_API_KEY
npm startThe server will be available at http://localhost:5173
Visit http://localhost:5173 to use the chat interface for medical queries.
GET /health- Health checkGET /api/tools- List available MCP toolsPOST /api/medical- Medical assistance endpointPOST /mcp- MCP protocol endpoint
- validate - Validates bearer tokens for Puch AI authentication
- medical_assist - Provides comprehensive medical guidance
Test the MCP protocol:
# List available tools
curl -X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
http://localhost:5173/mcp
# Test medical assistance
curl -X POST -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"medical_assist","arguments":{"query":"I have a fever"}}}' \
http://localhost:5173/mcpThis server is designed to work with platforms that support long-running Node.js applications:
- Railway (Recommended)
- Render
- Heroku
- Connect your GitHub repository to Railway
- Set environment variables in Railway dashboard
- Deploy automatically
- Framework: Express.js
- AI Model: Google Gemini 1.5 Flash
- Location Services: OpenStreetMap Overpass API
- Protocol: Model Context Protocol (MCP)
- Language: JavaScript (ES Modules)
ISC