MCP Server

The HMS4all MCP Server exposes 48 tools that AI agents can use to interact with the hospital management platform. It follows the Model Context Protocol specification.


Connecting

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "hms4all": {
      "url": "https://your-api.hms4all.com/sse",
      "headers": {
        "Authorization": "Bearer hms4all_sk_your_api_key"
      }
    }
  }
}

Cursor / Other MCP Clients

Transport: SSE
URL: https://your-api.hms4all.com/sse
Headers:
  Authorization: Bearer hms4all_sk_your_api_key

Custom MCP Client

import { Client } from '@modelcontextprotocol/sdk/client';
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse';

const transport = new SSEClientTransport(
  new URL('https://your-api.hms4all.com/sse'),
  { headers: { Authorization: 'Bearer hms4all_sk_...' } }
);
const client = new Client({ name: 'my-app', version: '1.0' });
await client.connect(transport);

const result = await client.callTool('search-patients', {
  query: 'John Doe'
});

Tool Reference

48 tools organized by category. Each tool requires appropriate API key scopes. Tools marked null scope are public (no scope check).

Billing (3 tools)

ToolDescriptionScope
billing-health-checkRun a billing and subscription health check across all tenants. Identifies payment issues and subscription anomalies.agents:billing:write
estimate-costEstimate the cost of a medical procedure based on service catalog and historical data. Considers comorbidities for cost adjustments.agents:billing:read
get-billing-summaryGet billing summary for the tenant — today's revenue, pending bills, and breakdown by type.agents:billing:read

Clinical (4 tools)

ToolDescriptionScope
analyze-lab-resultsAnalyze laboratory test results and provide clinical interpretation with reference ranges and flags.agents:clinical:read
check-radiology-reportQA-check a radiology report by analyzing findings and impression for consistency, completeness, and clinical accuracy.agents:clinical:read
clinical-decision-supportGet AI-powered clinical decision support based on symptoms, diagnosis, and current medications. Checks for contraindications and suggests next steps.agents:clinical:read
generate-soap-noteGenerate a structured SOAP (Subjective, Objective, Assessment, Plan) clinical note from a consultation transcript.agents:clinical:read

General (11 tools)

ToolDescriptionScope
analyze-patient-flowReal-time patient flow analysis — OPD wait times, lab TAT, pharmacy TAT, and bottleneck detection with severity levels.public
analyze-vitalsSimplified NEWS2-style early-warning score from vital signs (rule-based), for patients aged 18 years or more. Give patientId (a patient of your hospital) or ageDays (whole days of life), never both; without either the result is NOT_SCORED (age unknown). Omit any parameter that was not measured, never estimate one. The result has status COMPLETE (score + riskLevel), PARTIAL (partialScore is only a lower bound; missing parameters are named) or NOT_SCORED (reason NO_INPUTS, AGE_UNKNOWN or OUTSIDE_POPULATION).public
compliance-auditRun NABH compliance audit — checks credentials, quarantine, lab delays, ER response, stale admissions. Returns score 0-100.public
generate-discharge-summaryGenerate a discharge summary for an IPD admission. Aggregates diagnosis, medications, lab results, and follow-up plan into a structured document.public
get-training-guideGet role-specific training walkthrough for a hospital staff member. Returns step-by-step guide with routes and tips.public
import-dataMap CSV headers and import data for hospital migration. Supports patients, staff, medicines, and investigations.public
inventory-forecastPredict medicine stockout dates based on 30-day consumption rate. Returns CRITICAL/WARNING/LOW alerts with suggested order quantities.public
reconcile-billingPre-discharge billing reconciliation — checks for missing lab charges, room charges, and procedure charges.public
revenue-insightsDaily revenue insights — breakdown by category, OPD/IPD counts, week-over-week trend comparison.public
suggest-appointment-slotSuggest the optimal next appointment slot for a doctor-patient pair based on queue, availability, and follow-up history.public
verify-ot-protocolVerify a surgical safety checklist (WHO Safe Surgery) for a given phase (Sign In, Time Out, Sign Out).public

Hr (5 tools)

ToolDescriptionScope
generate-rosterAuto-generate a staff duty roster for a given date range. Creates shift assignments based on staff availability.agents:hr:write
get-burnout-summaryStaff burnout snapshot — latest burnout metric per staff member over the last 30 days, counts by risk level, and the HIGH/CRITICAL list. Read-only.agents:hr:read
get-credential-complianceCredential compliance snapshot — counts by status plus expired and soon-to-expire credentials for the authenticated tenant. Read-only.agents:hr:read
get-staff-availabilityEligible staff (active, valid credentials, not in CRITICAL burnout) grouped by role for the authenticated tenant. Read-only.agents:hr:read
get-staff-coverageStaffing coverage gaps (Roster vs shift requirements) over the next N days for the authenticated tenant. Read-only; proposing fills is a separate HITL action.agents:hr:read

Human-in-the-Loop (5 tools)

ToolDescriptionScope
propose-admissionPropose a patient admission for human review. Creates a pending action that must be approved before execution.agents:clinical:write
propose-dischargePropose a patient discharge for human review. Creates a pending action that must be approved before execution.agents:clinical:write
propose-lab-orderPropose lab test orders for human review. Creates a pending action that must be approved before execution.agents:clinical:write
propose-prescriptionPropose a prescription for human review. Creates a pending action that must be approved by a clinician before execution.agents:clinical:write
propose-radiology-orderPropose a radiology study order for human review. Creates a pending action that must be approved before execution.agents:clinical:write

Monitoring (1 tool)

ToolDescriptionScope
system-monitorRun a system monitoring cycle to detect anomalies such as brute-force attacks or unusual data exports.agents:monitoring:read

Onboarding (1 tool)

ToolDescriptionScope
onboarding-chatChat with the hospital onboarding assistant. Guides new tenants through hospital setup including department planning and ward configuration.agents:onboarding:read

Operations (2 tools)

ToolDescriptionScope
get-bed-availabilityGet real-time bed availability across wards, optionally filtered by ward type or department.agents:operations:read
get-queue-statusGet current OPD queue status — waiting, in-progress, and completed counts for today.agents:operations:read

Pharmacy (2 tools)

ToolDescriptionScope
get-pharmacy-stockCheck pharmacy stock levels. Search by medicine name or filter low-stock items.agents:pharmacy:read
pharmacy-expiry-scanScan pharmacy inventory for medicines nearing expiry within the authenticated tenant. No parameters required — tenant is resolved from auth context.agents:pharmacy:read

Planning (2 tools)

ToolDescriptionScope
design-hospitalGenerate a complete hospital design with departments, workflows, and architecture based on a natural language prompt.agents:planning:read
suggest-departmentsSuggest hospital departments based on hospital type, bed count, and context. Returns structured department recommendations.agents:planning:read

Reception (8 tools)

ToolDescriptionScope
book-appointmentBook an appointment for a patient with a doctor. Returns the created appointment with token number.agents:reception:write
cancel-appointmentCancel a scheduled appointment by ID. A structured reasonCode from the tenant cancel-reason master is REQUIRED (call with an invalid/missing code to be told the valid codes). PAID tokens are routed to the billing desk for a deliberate refund — money never moves automatically.agents:reception:write
check-doctor-availabilityCheck a doctor's available time slots for a given date. Returns booked slots and free windows.agents:reception:read
get-patientGet full patient details by patient ID, including demographics and allergies.agents:reception:read
list-appointmentsList appointments for a given date range, optionally filtered by doctor or patient. Returns up to 50 appointments.agents:reception:read
parse-registrationParse a natural language transcript (e.g., voice input) into structured patient registration data.agents:reception:read
register-patientRegister a new patient. Creates a User + Patient record. Returns the created patient with UHID.agents:reception:write
search-patientsSearch patients by name, phone, or UHID within the tenant. Returns up to 20 matching patients.agents:reception:read

Simulation (1 tool)

ToolDescriptionScope
generate-demo-dataGenerate simulated ER walk-in patients for testing and demo purposes. Creates patient records with realistic profiles.agents:simulation:write

Support (3 tools)

ToolDescriptionScope
get-fix-proposalRetrieve a pending CODE_FIX proposal by ticket ID or action ID. Returns the file, before/after code, and reasoning for the proposed fix. Use this from your IDE to pull fix proposals.agents:support:read
support-queryGet L1 support assistance. Answers questions about HMS4all features, troubleshoots common issues, and provides guidance.agents:support:read
triage-support-ticketAnalyze a support ticket and provide structured triage including module classification, root cause analysis, fix suggestion, and effort estimate.agents:support:write

Resources

The MCP server also provides read-only resources:

URIDescription
ihms://agentsList of all AI agents with MCP tool and A2A skill mappings
ihms://modulesAll functional modules organized by category
ihms://capabilitiesPlatform capabilities: HITL types, auth methods, rate limits, protocol stats

Human-in-the-Loop (HITL)

The propose-* tools create pending actions that must be approved by a human before execution. This is the safety mechanism for clinical AI actions.

Flow

  1. AI agent calls propose-prescription with patient/medication data
  2. An AgentAction record is created with status PENDING
  3. Admin/doctor reviews in the Agent Actions dashboard
  4. On Approve: status becomes APPROVED, execution event dispatched
  5. On Reject: status becomes REJECTED with reason
  6. After expiry (default 60 min): status auto-transitions to EXPIRED

Auto-Approval

Tenants can configure auto-approval per action type in Settings. CRITICAL priority actions are never auto-approved.

Interactive Tool Tester

MCP Tool Tester

Rate Limits

MCP endpoints are rate-limited to 10 requests/minute per client. If you hit the limit, you will receive a 429 response.