diff --git a/docs.json b/docs.json index 1171a11a..ab9c7203 100644 --- a/docs.json +++ b/docs.json @@ -923,6 +923,27 @@ } ] }, + { + "tab": "Eka MCP", + "groups": [ + { + "group": "Get Started", + "icon": "rocket", + "pages": [ + "mcp/introduction", + "mcp/supported-tools", + "mcp/authentication" + ] + }, + { + "group": "Integrations", + "icon": "plug", + "pages": [ + "mcp/integrations/custom-client" + ] + } + ] + }, { "tab": "CookBook", "groups": [ diff --git a/images/OIDC.png b/images/OIDC.png new file mode 100644 index 00000000..67d72fcf Binary files /dev/null and b/images/OIDC.png differ diff --git a/images/claude-prompt.png b/images/claude-prompt.png new file mode 100644 index 00000000..e7c1e14e Binary files /dev/null and b/images/claude-prompt.png differ diff --git a/images/eka-remote-mcp.png b/images/eka-remote-mcp.png new file mode 100644 index 00000000..3fd7236f Binary files /dev/null and b/images/eka-remote-mcp.png differ diff --git a/mcp/authentication.mdx b/mcp/authentication.mdx new file mode 100644 index 00000000..11795a13 --- /dev/null +++ b/mcp/authentication.mdx @@ -0,0 +1,195 @@ +--- +title: Authentication +description: Securely connect your AI assistant to Eka.care +--- + +## Overview + +Eka.care MCP supports two authentication methods to fit different integration needs: + + + + **Best for:** Healthcare providers and clinics + + Auto-authenticate with your Eka.care account. No manual credential management needed. + + + **Best for:** Third-party integrations + + Use API credentials (Client ID, Secret, API Key) for programmatic access. + + + +--- + +## Method 1: OIDC Flow (Auto-Authentication) + +This is the **easiest and most secure** method. Your AI assistant authenticates using your Eka.care login, just like logging into the dashboard. + +### How It Works + + + + Claude Desktop or any MCP-compatible client + + + Opens a secure browser window + + + Use your existing Eka.care credentials + + + Your AI assistant now has secure access + + + + + OIDC Authentication Flow + {/* Screenshot placeholder: Diagram showing OIDC flow steps */} + + +## Method 2: Client Credentials + +Use this method if you have API credentials (Client ID, Client Secret, API Key) from the Eka.care team. + +### How It Works + +Your MCP server authenticates directly with Eka.care APIs using: +- **Client ID**: Your application identifier +- **Client Secret**: Secret key for authentication +- **API Key**: Additional security layer (optional but recommended) + +### Setup Client Credentials + +**1. Get your credentials:** + +Contact **ekaconnect@eka.care** and request: +- Client ID +- Client Secret +- API Key + +**2. Configure your `.env` file:** + +```bash .env +# API Configuration +EKA_API_BASE_URL=https://api.eka.care + +# Client Credentials +EKA_CLIENT_ID=your_client_id_here +EKA_CLIENT_SECRET=your_client_secret_here +EKA_API_KEY=your_api_key_here + +# Server Settings (optional) +EKA_MCP_SERVER_HOST=localhost +EKA_MCP_SERVER_PORT=8000 +EKA_LOG_LEVEL=INFO +``` + + +**Security Best Practices:** +- Never commit credentials to version control +- Use `.gitignore` to exclude `.env` file +- Rotate credentials periodically +- Use different credentials for development and production + + +**3. Update Claude Desktop config:** + +```json claude_desktop_config.json +{ + "mcpServers": { + "eka-care": { + "command": "/full/path/to/.venv/bin/python", + "args": ["-m", "eka_mcp_sdk.server"], + "env": { + "EKA_CLIENT_ID": "your_client_id_here", + "EKA_CLIENT_SECRET": "your_client_secret_here", + "EKA_API_KEY": "your_api_key_here", + "EKA_API_BASE_URL": "https://api.eka.care" + } + } + } +} +``` + +**4. Test your connection:** + +```bash +# Start the MCP server +eka-mcp-server +``` + +You should see: +``` +INFO: Authentication successful +INFO: MCP Server running on http://localhost:8000 +``` + +### Credential Management Tips + + + + **Quick test with curl:** + ```bash + curl -X POST https://api.eka.care/api/v1/auth/token \ + -H "Content-Type: application/json" \ + -H "X-API-KEY: your_api_key" \ + -d '{ + "client_id": "your_client_id", + "client_secret": "your_client_secret", + "grant_type": "client_credentials" + }' + ``` + + Should return an access token if credentials are valid. + + + + **Automatic refresh:** The MCP server automatically refreshes tokens before they expire. + + **Default expiration:** Tokens typically last 1 hour and are refreshed automatically. + + **No action needed:** You don't need to manually manage token lifecycle. + + + + **Development:** + ```bash .env.development + EKA_CLIENT_ID=dev_client_id + EKA_CLIENT_SECRET=dev_client_secret + EKA_API_KEY=dev_api_key + EKA_API_BASE_URL=https://api-dev.eka.care + ``` + + **Production:** + ```bash .env.production + EKA_CLIENT_ID=prod_client_id + EKA_CLIENT_SECRET=prod_client_secret + EKA_API_KEY=prod_api_key + EKA_API_BASE_URL=https://api.eka.care + ``` + + + + **When to rotate:** + - Every 90 days (recommended) + - If credentials may be compromised + - When team members leave + + **How to rotate:** + 1. Contact ekaconnect@eka.care for new credentials + 2. Update your `.env` file + 3. Restart the MCP server + 4. Update Claude Desktop config if needed + + + +--- + + +**Need Credentials?** Contact **ekaconnect@eka.care** with: +- Your organization name +- Integration type (OIDC or Client Credentials) +- Use case description +- Expected API usage volume + diff --git a/mcp/integrations/custom-client.mdx b/mcp/integrations/custom-client.mdx new file mode 100644 index 00000000..ded20322 --- /dev/null +++ b/mcp/integrations/custom-client.mdx @@ -0,0 +1,245 @@ +--- +title: Custom MCP Client +description: Integrate Eka.care MCP into your own application +--- + +## Overview + +Want to build your own AI-powered healthcare application? You can integrate Eka.care MCP into any application that supports the Model Context Protocol standard. + + + + Create custom healthcare assistants + + + Automate clinic workflows + + + Custom admin dashboards + + + API-powered AI services + + + +--- + +## Quick Integration + +### Using the MCP SDK + +The easiest way is to use the official MCP SDK in your preferred language: + + + + ```python + from mcp import ClientSession, StdioServerParameters + from mcp.client.stdio import stdio_client + + # Create MCP client connection + server_params = StdioServerParameters( + command="/path/to/.venv/bin/python", + args=["-m", "eka_mcp_sdk.server"], + env={ + "EKA_CLIENT_ID": "your_client_id", + "EKA_CLIENT_SECRET": "your_client_secret", + "EKA_API_KEY": "your_api_key" + } + ) + + async with stdio_client(server_params) as (read, write): + async with ClientSession(read, write) as session: + # Initialize connection + await session.initialize() + + # List available tools + tools = await session.list_tools() + print(f"Available tools: {[t.name for t in tools]}") + + # Call a tool + result = await session.call_tool( + "search_patients", + arguments={"prefix": "Kumar"} + ) + print(result) + ``` + + + + ```typescript + import { Client } from "@modelcontextprotocol/sdk/client/index.js"; + import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js"; + + const transport = new StdioClientTransport({ + command: "/path/to/.venv/bin/python", + args: ["-m", "eka_mcp_sdk.server"], + env: { + EKA_CLIENT_ID: "your_client_id", + EKA_CLIENT_SECRET: "your_client_secret", + EKA_API_KEY: "your_api_key" + } + }); + + const client = new Client({ + name: "my-healthcare-app", + version: "1.0.0" + }, { + capabilities: {} + }); + + await client.connect(transport); + + // List available tools + const tools = await client.listTools(); + console.log("Available tools:", tools.tools.map(t => t.name)); + + // Call a tool + const result = await client.callTool({ + name: "search_patients", + arguments: { prefix: "Kumar" } + }); + console.log(result); + ``` + + + + ```go + package main + + import ( + "context" + "fmt" + "github.com/modelcontextprotocol/sdk-go/client" + ) + + func main() { + // Create MCP client + c := client.NewStdioClient( + "/path/to/.venv/bin/python", + []string{"-m", "eka_mcp_sdk.server"}, + map[string]string{ + "EKA_CLIENT_ID": "your_client_id", + "EKA_CLIENT_SECRET": "your_client_secret", + "EKA_API_KEY": "your_api_key", + }, + ) + + // Connect + ctx := context.Background() + if err := c.Connect(ctx); err != nil { + panic(err) + } + defer c.Close() + + // List tools + tools, err := c.ListTools(ctx) + if err != nil { + panic(err) + } + fmt.Printf("Available tools: %+v\n", tools) + + // Call a tool + result, err := c.CallTool(ctx, "search_patients", map[string]interface{}{ + "prefix": "Kumar", + }) + if err != nil { + panic(err) + } + fmt.Printf("Result: %+v\n", result) + } + ``` + + + +--- + +## HTTP Integration + +Prefer REST APIs? Deploy the MCP server with HTTP transport: + +### Setup HTTP Server + +```python server.py +from fastmcp import FastMCP +from eka_mcp_sdk.tools.patient_tools import register_patient_tools +from eka_mcp_sdk.tools.appointment_tools import register_appointment_tools + +# Create FastMCP instance +mcp = FastMCP("Eka.care MCP") + +# Register tools +register_patient_tools(mcp) +register_appointment_tools(mcp) + +# Run with HTTP transport +if __name__ == "__main__": + import uvicorn + uvicorn.run(mcp.get_asgi_app(), host="0.0.0.0", port=8000) +``` + +### Call via HTTP + +```bash +# List available tools +curl http://localhost:8000/tools + +# Call a tool +curl -X POST http://localhost:8000/call_tool \ + -H "Content-Type: application/json" \ + -d '{ + "name": "search_patients", + "arguments": {"prefix": "Kumar"} + }' +``` + +--- + +## Docker Deployment + +Deploy as a containerized service: + +```dockerfile Dockerfile +FROM python:3.11-slim + +WORKDIR /app + +# Install dependencies +COPY requirements.txt . +RUN pip install -r requirements.txt + +# Copy MCP server code +COPY . . + +# Install package +RUN pip install -e . + +# Expose port +EXPOSE 8000 + +# Run server +CMD ["python", "-m", "eka_mcp_sdk.server"] +``` + +```yaml docker-compose.yml +version: '3.8' + +services: + eka-mcp: + build: . + ports: + - "8000:8000" + environment: + - EKA_CLIENT_ID=${EKA_CLIENT_ID} + - EKA_CLIENT_SECRET=${EKA_CLIENT_SECRET} + - EKA_API_KEY=${EKA_API_KEY} + - EKA_API_BASE_URL=https://api.eka.care + restart: unless-stopped +``` + +--- + + +**Building Something Cool?** We'd love to hear about it! +- Email us: ekaconnect@eka.care +- Get featured in our showcase! + diff --git a/mcp/introduction.mdx b/mcp/introduction.mdx new file mode 100644 index 00000000..20f853b4 --- /dev/null +++ b/mcp/introduction.mdx @@ -0,0 +1,382 @@ +--- +title: Eka MCP Server +description: Connect your AI assistant to Eka.care's healthcare platform +--- + + + MCP Overview + {/* Screenshot placeholder: Show diagram of AI Assistant <-> MCP <-> Eka.care APIs */} + + +**Model Context Protocol (MCP)** is an open standard that lets AI assistants like Claude connect directly to your applications and data securely. Think of it as a universal adapter that helps AI understand and work with your healthcare systems. + +Eka's MCP server follows the authenticated remote [MCP spec](https://modelcontextprotocol.io/specification/2025-03-26), so the server is centrally hosted and managed. Instead of copying and pasting patient data or manually creating appointments, your AI assistant can handle appointment booking, prescription creation, and patient lookups automatically with built in Authentication and HIPAA-compliant data handling. + + +## Setup Instructions + +### General + +Eka's MCP server is currently supporting Streamable HTTP transport. It uses OAuth 2.0 with OpenID Connect (OIDC) flow for dynamic client registration for authentication at the following address: + +- HTTP : `https://mcp.eka.care/mcp` + +For setup instructions on specific clients, continue reading .. + + + + + +**Requirements:** VS Code 1.95+ with GitHub Copilot + +1. Press `Cmd + Shift + P` +2. Type and select **MCP: Add Server** +3. Choose **HTTP** *(HTTP or Server-Sent Events)* +4. Enter URL: `https://mcp.eka.care/mcp` +5. Enter server name: `eka-care-mcp` +6. Authenticate with your Eka.care email + +Done! Test by asking Copilot: *"Search for patient Raj Kumar"* + + + + + +**Requirements:** VS Code 1.95+ with GitHub Copilot + +1. Press `Ctrl + Shift + P` +2. Type and select **MCP: Add Server** +3. Choose **HTTP** *(HTTP or Server-Sent Events)* +4. Enter URL: `https://mcp.eka.care/mcp` +5. Enter server name: `eka-care-mcp` +6. Authenticate with your Eka.care email + +Configuration saved to: `%APPDATA%\Code\User\globalStorage\github.copilot-chat\mcp.json` + + + + + +**Requirements:** Claude Paid subscription + +1. Open Claude Desktop +2. Click **Settings** → **Connectors** → **Add custom connector** +3. Type the name as **Eka-Care-mcp** +4. Type the URL as **https://mcp.eka.care/mcp** +5. Tap **Add** +6. Authenticate with Eka.care +7. Save and restart + +Pro users get higher rate limits and priority access. + +Config(macOS): `~/Library/Application Support/Claude/claude_desktop_config.json` +Config(Windows): `%APPDATA%\Claude\claude_desktop_config.json` + + + + + +**Requirements:** Claude Desktop app (Free tier) + +1. Open Claude Desktop +2. Click **Settings** (bottom-left gear icon) +3. Navigate to **Developer** → **Edit Config** +4. Add this configuration: + +```json +{ + "mcpServers": { + "eka-care": { + "command": "npx", + "args": ["-y", "mcp-remote", "https://mcp.eka.care/mcp"] + } + } +} +``` + +5. Save and restart Claude Desktop +6. Authenticate when prompted + +Config location: `~/Library/Application Support/Claude/claude_desktop_config.json` + + + + + +**Requirements:** Claude Desktop app (Free tier) + +1. Open Claude Desktop +2. Click **Settings** (gear icon) +3. Go to **Developer** → **Edit Config** +4. Add: + +```json +{ + "mcpServers": { + "eka-care": { + "command": "npx", + "args": ["-y", "mcp-remote", "https://mcp.eka.care/mcp"] + } + } +} +``` + +5. Save and restart Claude +6. Authenticate when prompted + +Config location: `%APPDATA%\Claude\claude_desktop_config.json` + + + + +**Requirements:** Free chatgpt does not provide the remote mcp connectors currently, You should have >Go model. + +1. Open https://chatgpt.com/ +2. Go to profile (Left bottom) +3. Click **Settings** +4. Navigate to **Apps and Connectors** +5. Scroll down and inside the Developer mode, switch it on +6. Inside Apps and Connectors, tap **Create app** +7. Enter the name **eka-care-mcp** +8. Enter the URL **https://mcp.eka.care/mcp** and tap **Create** +9. Authenticate when prompted + + + + +**Requirements:** Cursor IDE + +1. Open Cursor +2. Press `Cmd + Shift + P` +3. Type **Cursor settings** +4. Select **Tools & MCP** +5. Tap on **New MCP Server** +6. Add server configuration: + +```json +{ + "mcpServers": { + "eka-care": { + "url": "https://mcp.eka.care/mcp", + "transport": { + "type": "http" + } + } + } +} +``` + +7. Tap on Connect to Authenticate with Eka.care +8. Restart Cursor + +Config location: `~/Library/Application Support/Cursor/User/globalStorage/mcp.json` + + + + + +**Requirements:** Cursor IDE + +1. Open Cursor +2. Press `Ctrl + Shift + P` +3. Type **Cursor settings** +4. Select **Tools & MCP** +5. Tap on **New MCP Server** +6. Add server configuration: + +```json +{ + "mcpServers": { + "eka-care": { + "url": "https://mcp.eka.care/mcp", + "transport": { + "type": "http" + } + } + } +} +``` + +7. Restart Cursor +8. Complete authentication + +Config: `%APPDATA%\Cursor\User\globalStorage\mcp.json` + + + + + + +**Requirements:** Zed Editor with AI features enabled + +1. Open Zed +2. Go to **Zed** → **Settings** → **Language Models** +3. Scroll to **MCP Servers** +4. Click **Add Server** +5. Enter: + - Name: `eka-care` + - URL: `https://mcp.eka.care/mcp` + - Transport: `HTTP` + +6. Save and restart Zed +7. Authenticate when prompted + +Config location: `~/.config/zed/settings.json` + + + + + +**Requirements:** Zed Editor with AI features + +1. Open Zed +2. Settings → Language Models +3. MCP Servers → Add Server +4. Configure: + - Name: `eka-care` + - URL: `https://mcp.eka.care/mcp` + - Transport: `HTTP` + +5. Save and restart +6. Complete authentication + +Config: `%APPDATA%\Zed\settings.json` + + + Zed Windows Setup + + + + + + +**Requirements:** Windsurf IDE + +1. Open Windsurf +2. Press `Cmd + ,` for Settings +3. Navigate to **Extensions** → **MCP** +4. Add server: + +```json +{ + "mcpServers": { + "eka-care": { + "url": "https://mcp.eka.care/mcp", + "transport": { + "type": "http" + } + } + } +} +``` + +5. Restart Windsurf +6. Authenticate with Eka.care + + + Windsurf macOS Setup + + + + + + +**Requirements:** Windsurf IDE + +1. Open Windsurf +2. Press `Ctrl + ,` for Settings +3. Extensions → MCP +4. Add configuration: + +```json +{ + "mcpServers": { + "eka-care": { + "url": "https://mcp.eka.care/mcp", + "transport": { + "type": "http" + } + } + } +} +``` + +5. Restart Windsurf +6. Complete authentication + + + Windsurf Windows Setup + + + + + + +You simply tell your AI assistant: + + +```text Natural Language +"Book an appointment for patient Raj Kumar with Dr. Singh tomorrow at 10 AM, +and create a prescription for Amoxicillin 500mg, 3 times daily for 7 days" +``` + + +And it's done! ✨ + + + Example Conversation + {/* Screenshot placeholder: Show actual Claude Desktop conversation doing this task */} + + +## Who Should Use This? + + + + Doctors, clinics, and hospitals using Eka.care for patient management + + + Platforms building healthcare workflows and automation + + + Staff managing appointments, records, and prescriptions + + + Engineers building AI-powered healthcare applications + + + +## What Can You Do? + + + + - Search and retrieve patient records + - Add new patients + - Update patient information + - View complete medical history + + + + - Check available slots + - Book appointments + - Reschedule or cancel + - View appointment history + + + + - Generate digital prescriptions + - View prescription history + - Access medication details + + + + - Retrieve doctor profiles + - Access clinic information + - View available services + + + +For more details on supported tools visit - https://developer.eka.care/mcp/supported-tools + + +**Need Help?** Email us at ekaconnect@eka.care + diff --git a/mcp/supported-tools.mdx b/mcp/supported-tools.mdx new file mode 100644 index 00000000..43aa637b --- /dev/null +++ b/mcp/supported-tools.mdx @@ -0,0 +1,127 @@ +--- +title: Supported Tools +description: Complete list of available MCP tools and their capabilities +--- + +# Supported Tools + +Eka MCP provides 20+ tools across patient management, appointments, prescriptions, and clinic operations. All tools support natural language queries through your AI assistant. + +## Patient Management + +| Tool Name | Description | Input Parameters | Returns | +|-----------|-------------|------------------|---------| +| `search_patients` | Search for patients by name, mobile, email, or patient ID | `query` (string), `limit` (optional) | List of matching patients with IDs, contact info, and basic details | +| `get_patient_details` | Retrieve complete patient information | `patient_id` (string) | Full patient profile including medical history, demographics, and appointments | +| `add_patient` | Register a new patient | `name`, `mobile`, `email` (optional), `dob` (optional), `gender` (optional) | New patient ID and confirmation | +| `update_patient` | Modify existing patient information | `patient_id`, fields to update | Updated patient details | + +## Appointment Management + +| Tool Name | Description | Input Parameters | Returns | +|-----------|-------------|------------------|---------| +| `get_available_slots` | Check doctor's availability | `doctor_id`, `date`, `clinic_id` (optional) | List of available time slots | +| `book_appointment` | Schedule a new appointment | `patient_id`, `doctor_id`, `slot_time`, `clinic_id` | Appointment ID and confirmation | +| `get_appointments` | List appointments by various filters | `patient_id` OR `doctor_id` OR `date`, `status` (optional) | List of appointments with details | +| `reschedule_appointment` | Change appointment timing | `appointment_id`, `new_slot_time` | Updated appointment details | +| `cancel_appointment` | Cancel scheduled appointment | `appointment_id`, `reason` (optional) | Cancellation confirmation | +| `get_appointment_details` | Retrieve specific appointment info | `appointment_id` | Complete appointment information | + +## Prescription Management + +| Tool Name | Description | Input Parameters | Returns | +|-----------|-------------|------------------|---------| +| `create_prescription` | Generate digital prescription | `patient_id`, `medications` (array), `doctor_id`, `advice` (optional) | Prescription ID and details | +| `get_prescriptions` | View prescription history | `patient_id`, `from_date` (optional), `to_date` (optional) | List of prescriptions | +| `get_prescription_details` | Retrieve specific prescription | `prescription_id` | Complete prescription with medications and advice | +| `update_prescription` | Modify existing prescription | `prescription_id`, fields to update | Updated prescription | + +## Doctor & Clinic Operations + +| Tool Name | Description | Input Parameters | Returns | +|-----------|-------------|------------------|---------| +| `get_doctor_profile` | Access doctor information | `doctor_id` | Doctor details, qualifications, specializations | +| `search_doctors` | Find doctors by name or specialization | `query`, `specialization` (optional) | List of matching doctors | +| `get_clinic_details` | Retrieve clinic information | `clinic_id` | Clinic address, services, contact info | +| `get_doctor_clinics` | List clinics associated with doctor | `doctor_id` | Array of clinic details | +| `get_clinic_services` | View services offered by clinic | `clinic_id` | List of available services | + +## Medication Database + +| Tool Name | Description | Input Parameters | Returns | +|-----------|-------------|------------------|---------| +| `search_medications` | Look up medicine information | `query` (drug name) | Medicine details, dosage forms, manufacturers | +| `get_medication_details` | Get complete drug information | `medication_id` | Full drug profile with interactions and contraindications | + +## Tool Parameters + + +## Usage Examples + +### Simple Queries +```text +"Search for patient Raj Kumar" +→ Uses: search_patients + +"Show Dr. Singh's available slots tomorrow" +→ Uses: get_available_slots + +"Get prescription history for patient 12345" +→ Uses: get_prescriptions +``` + +### Complex Workflows +```text +"Book appointment for Raj Kumar with Dr. Singh tomorrow at 10 AM +and create prescription for Amoxicillin" +→ Uses: search_patients → book_appointment → create_prescription +``` + +## Rate Limits + +| Plan | Requests/Minute | Requests/Day | +|------|-----------------|--------------| +| Free | 10 | 1,000 | +| Pro | 60 | 10,000 | +| Enterprise | Unlimited | Unlimited | + +## Error Handling + +All tools return standardized error responses: + +```json +{ + "error": true, + "message": "Patient not found", + "code": "PATIENT_NOT_FOUND" +} +``` + +### Common Error Codes + +- `PATIENT_NOT_FOUND` - Patient ID doesn't exist +- `SLOT_UNAVAILABLE` - Appointment slot already booked +- `INVALID_PARAMETERS` - Missing or incorrect parameters +- `UNAUTHORIZED` - Authentication required +- `RATE_LIMIT_EXCEEDED` - Too many requests + +## Need More Details? + + + + Get started in 5 minutes + + + See real-world workflows + + + Complete API documentation + + + Common issues and fixes + + + +--- + +**Questions?** Email ekaconnect@eka.care \ No newline at end of file