Labsco
pratapsfdc22-dev logo

Careflow-MCP

β˜… 1

from pratapsfdc22-dev

Production-ready healthcare workflow automation powered by n8n and the Model Context Protocol. Enables Claude and other AI assistants to trigger HIPAA-compliant patient task management workflows through natural language.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

CareFlow MCP πŸ₯

Production-ready healthcare workflow automation powered by n8n and the Model Context Protocol. Enables Claude and other AI assistants to trigger HIPAA-compliant patient task management workflows through natural language.

NPM Version TypeScript MCP SDK License: MIT mcp.so

πŸ₯ Healthcare-Ready: Includes comprehensive HIPAA compliance documentation and patient task management workflows.

Features

  • πŸš€ Trigger Workflows - Execute n8n workflows via webhook with custom payloads
  • πŸ“‹ List Workflows - Query all active workflows from your n8n instance
  • πŸ“Š Check Status - Monitor workflow execution status in real-time
  • πŸ₯ Healthcare-Ready - Built-in support for patient task workflows
  • πŸ”’ Type-Safe - Full TypeScript support with Zod validation
  • ⚑ Production-Ready - Comprehensive error handling and logging
  • πŸ› οΈ MCP Standard - Compatible with Claude Desktop and other MCP clients

πŸ“š Documentation & Examples

Quick Start with Examples

# 1. Import workflow to n8n
examples/healthcare-patient-task-workflow.json

# 2. Configure credentials in n8n

# 3. Ask Claude:
"Create a patient task for ID P12345 in the Patient Care workflow"

Tools Exposed

ToolDescriptionRequired Params
trigger_workflowTriggers an n8n workflow by name with JSON payloadworkflowName, payload
list_workflowsLists all active workflows from n8nNone
get_workflow_statusChecks execution status by IDexecutionId
create_patient_taskSends structured patient task to workflowworkflowName, patientId, taskType

Development

Build

npm run build

Watch Mode

npm run watch

Run Locally

npm run dev

Clean Build Artifacts

npm run clean

Project Structure

careflow-mcp/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ index.ts        # Main MCP server implementation
β”‚   └── types.ts        # TypeScript types and Zod schemas
β”œβ”€β”€ dist/               # Compiled JavaScript (generated)
β”œβ”€β”€ .env.example        # Environment variable template
β”œβ”€β”€ .gitignore          # Git ignore rules
β”œβ”€β”€ package.json        # NPM package configuration
β”œβ”€β”€ tsconfig.json       # TypeScript configuration
└── README.md           # This file

API Reference

trigger_workflow

Triggers an n8n workflow by name with optional JSON payload.

Input:

{
  workflowName: string;    // Name of the workflow
  payload?: object;        // Optional JSON data
}

Output:

{
  "success": true,
  "workflowId": "abc123",
  "workflowName": "Customer Onboarding",
  "response": { ... }
}

list_workflows

Lists all active workflows from n8n instance.

Input: None

Output:

{
  "success": true,
  "count": 5,
  "workflows": [
    {
      "id": "abc123",
      "name": "Customer Onboarding",
      "active": true,
      "createdAt": "2024-01-01T00:00:00.000Z",
      "updatedAt": "2024-01-15T12:00:00.000Z"
    }
  ]
}

get_workflow_status

Checks the execution status of a workflow run.

Input:

{
  executionId: string;    // Execution ID from trigger response
}

Output:

{
  "success": true,
  "execution": {
    "id": "exec123",
    "workflowId": "abc123",
    "finished": true,
    "status": "success",
    "startedAt": "2024-01-15T12:00:00.000Z",
    "stoppedAt": "2024-01-15T12:00:05.000Z"
  }
}

create_patient_task

Sends a structured patient task to an n8n workflow.

Input:

{
  workflowName: string;          // Target workflow
  patientId: string;             // Patient identifier
  taskType: string;              // Task type
  priority?: "low" | "medium" | "high" | "urgent";
  description?: string;
  dueDate?: string;              // ISO 8601 format
  assignedTo?: string;
  metadata?: object;
}

Output:

{
  "success": true,
  "workflowId": "abc123",
  "workflowName": "Patient Care",
  "task": { ... },
  "response": { ... }
}

Error Handling

The server implements comprehensive error handling with proper MCP error codes:

  • Invalid Parameters - ErrorCode.InvalidParams
  • Method Not Found - ErrorCode.MethodNotFound
  • Internal Error - ErrorCode.InternalError

All errors include descriptive messages for debugging.

Security Best Practices

  1. Never commit .env - Always use .env.example for templates
  2. Rotate API keys - Regularly update your n8n API keys
  3. Use webhook secrets - Add authentication to webhook triggers
  4. Restrict API access - Use n8n's API key permissions
  5. Monitor logs - Check server logs for suspicious activity

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE file for details.

Acknowledgments

Support


Built with the Model Context Protocol