Skip to main content
Glama

workflows-mcp

๐Ÿค– Co-authored with Claude Code - Building workflows so LLMs can finally follow a recipe without burning the kitchen! ๐Ÿ”ฅ

A powerful Model Context Protocol (MCP) implementation that enables LLMs to execute complex, multi-step workflows with cognitive actions and tool integrations.

๐ŸŒŸ Overview

workflows-mcp transforms how AI assistants handle complex tasks by providing structured, reusable workflows that combine tool usage with cognitive reasoning. Instead of ad-hoc task execution, workflows provide deterministic, reproducible paths through multi-step processes.

Related MCP server: Pure Agentic MCP Server

๐Ÿš€ Key Features

  • ๐Ÿ“‹ Structured Workflows: Define clear, step-by-step instructions for LLMs

  • ๐Ÿง  Cognitive Actions: Beyond tool calls - analyze, consider, validate, and reason

  • ๐Ÿ”€ Advanced Control Flow: Branching, loops, parallel execution

  • ๐Ÿ’พ State Management: Track variables and results across workflow steps

  • ๐Ÿ” Comprehensive Validation: Ensure workflow integrity before execution

  • ๐Ÿ“Š Execution Tracking: Monitor success rates and performance metrics

  • ๐Ÿ›ก๏ธ Type-Safe: Full TypeScript support with Zod validation

  • ๐ŸŽฏ Dependency Management: Control variable visibility to reduce token usage

  • โšก Performance Optimized: Differential updates and progressive step loading

๐Ÿ“ฆ Installation

npx @fiveohhwon/workflows-mcp

From npm

npm install -g @fiveohhwon/workflows-mcp

From Source

git clone https://github.com/FiveOhhWon/workflows-mcp.git
cd workflows-mcp
npm install
npm run build

๐Ÿƒ Configuration

Claude Desktop

Add this configuration to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "workflows": {
      "command": "npx",
      "args": ["-y", "@fiveohhwon/workflows-mcp"]
    }
  }
}

Using global install:

{
  "mcpServers": {
    "workflows": {
      "command": "workflows-mcp"
    }
  }
}

Using local build:

{
  "mcpServers": {
    "workflows": {
      "command": "node",
      "args": ["/absolute/path/to/workflows-mcp/dist/index.js"]
    }
  }
}

Development Mode

For development with hot reload:

npm run dev

๐Ÿ“– Workflow Structure

Workflows are JSON documents that define a series of steps for an LLM to execute:

{
  "name": "Code Review Workflow",
  "description": "Automated code review with actionable feedback",
  "goal": "Perform comprehensive code review",
  "version": "1.0.0",
  "inputs": {
    "file_path": {
      "type": "string",
      "description": "Path to code file",
      "required": true
    }
  },
  "steps": [
    {
      "id": 1,
      "action": "tool_call",
      "tool_name": "read_file",
      "parameters": {"path": "{{file_path}}"},
      "save_result_as": "code_content"
    },
    {
      "id": 2,
      "action": "analyze",
      "description": "Analyze code quality",
      "input_from": ["code_content"],
      "save_result_as": "analysis"
    }
  ]
}

๐ŸŽฏ Action Types

Tool Actions

  • tool_call: Execute a specific tool with parameters

Cognitive Actions

  • analyze: Examine data and identify patterns

  • consider: Evaluate options before deciding

  • research: Gather information from sources

  • validate: Check conditions or data integrity

  • summarize: Condense information to key points

  • decide: Make choices based on criteria

  • extract: Pull specific information from content

  • compose: Generate new content

Control Flow

  • branch: Conditional execution paths

  • loop: Iterate over items or conditions

  • parallel: Execute multiple steps simultaneously

  • wait_for_input: Pause for user input

Utility Actions

  • transform: Convert data formats

  • checkpoint: Save workflow state

  • notify: Send updates

  • assert: Ensure conditions are met

  • retry: Attempt previous step again

๐Ÿ› ๏ธ Available Tools

Workflow Management

  1. create_workflow - Create a new workflow

    {
      "workflow": {
        "name": "My Workflow",
        "description": "What it does",
        "goal": "Desired outcome",
        "steps": [...]
      }
    }
  2. list_workflows - List all workflows with filtering

    {
      "filter": {
        "tags": ["automation"],
        "name_contains": "review"
      },
      "sort": {
        "field": "created_at",
        "order": "desc"
      }
    }
  3. get_workflow - Retrieve a specific workflow

    {
      "id": "workflow-uuid"
    }
  4. update_workflow - Modify existing workflow

    {
      "id": "workflow-uuid",
      "updates": {
        "description": "Updated description"
      },
      "increment_version": true
    }
  5. delete_workflow - Soft delete (recoverable)

    {
      "id": "workflow-uuid"
    }
  6. start_workflow - Start a workflow execution session

    {
      "id": "workflow-uuid",
      "inputs": {
        "param1": "value1"
      }
    }

    Returns execution instructions for the first step and an execution_id.

  7. run_workflow_step - Execute the next step in the workflow

    {
      "execution_id": "execution-uuid",
      "step_result": "result from previous step",
      "next_step_needed": true
    }

    Call this after completing each step to proceed through the workflow.

  8. get_workflow_versions - List all available versions of a workflow

    {
      "workflow_id": "workflow-uuid"
    }

    Returns list of all saved versions for version history tracking.

  9. rollback_workflow - Rollback a workflow to a previous version

    {
      "workflow_id": "workflow-uuid",
      "target_version": "1.0.0",
      "reason": "Reverting breaking changes"
    }

    Restores a previous version as the active workflow.

๐Ÿ”„ Step-by-Step Execution

The workflow system supports interactive, step-by-step execution similar to the sequential thinking tool:

  1. Start a workflow with start_workflow - returns the first step instructions

  2. Execute the step following the provided instructions

  3. Continue to next step with run_workflow_step, passing:

    • The execution_id from start_workflow

    • Any step_result from the current step

    • next_step_needed: true to continue (or false to end early)

  4. Repeat until the workflow completes

Each step provides:

  • Clear instructions for what to do

  • Current variable state

  • Expected output format

  • Next step guidance

Template Variables

The workflow system supports template variable substitution using {{variable}} syntax:

  • In parameters: "path": "output_{{format}}.txt" โ†’ "path": "output_csv.txt"

  • In descriptions: "Processing {{count}} records" โ†’ "Processing 100 records"

  • In prompts: "Enter value for {{field}}" โ†’ "Enter value for email"

  • In transformations: Variables are automatically substituted

Template variables are resolved from the current workflow session variables, including:

  • Initial inputs provided to start_workflow

  • Results saved from previous steps via save_result_as

  • Any variables set during workflow execution

๐ŸŽฏ Dependency Management & Performance Optimization

The workflow system includes advanced features to minimize token usage and improve performance for complex workflows:

Dependency-Based Variable Filtering

Control which variables are visible to each step to dramatically reduce context size:

{
  "name": "Optimized Workflow",
  "strict_dependencies": true,  // Enable strict mode
  "steps": [
    {
      "id": 1,
      "action": "tool_call",
      "tool_name": "read_large_file",
      "save_result_as": "large_data"
    },
    {
      "id": 2,
      "action": "analyze",
      "input_from": ["large_data"],
      "save_result_as": "summary",
      "dependencies": []  // In strict mode, sees NO previous variables
    },
    {
      "id": 3,
      "action": "compose",
      "dependencies": [2],  // Only sees 'summary' from step 2
      "save_result_as": "report"
    },
    {
      "id": 4,
      "action": "validate",
      "show_all_variables": true,  // Override to see everything
      "save_result_as": "validation"
    }
  ]
}

Workflow-Level Settings

  • strict_dependencies (boolean, default: false)

    • false: Steps without dependencies see all variables (backward compatible)

    • true: Steps without dependencies see NO variables (must explicitly declare)

Step-Level Settings

  • dependencies (array of step IDs)

    • Lists which previous steps' outputs this step needs

    • Step only sees outputs from listed steps plus workflow inputs

    • Empty array in strict mode means NO variables visible

  • show_all_variables (boolean)

    • Override for specific steps that need full visibility

    • Useful for validation or debugging steps

Performance Features

  1. Differential State Updates: Only shows variables that changed

    • + variable_name: Newly added variables

    • ~ variable_name: Modified variables

    • Unchanged variables are not displayed

  2. Progressive Step Loading: Only shows next 3 upcoming steps

    • Reduces context for long workflows

    • Shows "... and X more steps" for remaining

  3. Selective Variable Display: Based on dependencies

    • Dramatically reduces tokens for workflows with verbose outputs

    • Maintains full state internally for branching/retry

Best Practices for Token Optimization

  1. Use strict_dependencies: true for workflows with large intermediate outputs

  2. Explicitly declare dependencies to minimize variable visibility

  3. Place verbose outputs early in the workflow and filter them out in later steps

  4. Use meaningful variable names to make dependencies clear

  5. Group related steps to minimize cross-dependencies

Example: Data Processing with Filtering

{
  "name": "Large Data Processing",
  "strict_dependencies": true,
  "inputs": {
    "file_path": { "type": "string", "required": true }
  },
  "steps": [
    {
      "id": 1,
      "action": "tool_call",
      "tool_name": "read_csv",
      "parameters": { "path": "{{file_path}}" },
      "save_result_as": "raw_data"
    },
    {
      "id": 2,
      "action": "transform",
      "transformation": "Extract key metrics only",
      "dependencies": [1],  // Only sees raw_data
      "save_result_as": "metrics"
    },
    {
      "id": 3,
      "action": "analyze",
      "criteria": "Identify trends and anomalies",
      "dependencies": [2],  // Only sees metrics, not raw_data
      "save_result_as": "analysis"
    },
    {
      "id": 4,
      "action": "compose",
      "criteria": "Create executive summary",
      "dependencies": [2, 3],  // Sees metrics and analysis only
      "save_result_as": "report"
    }
  ]
}

In this example:

  • Step 2 processes large raw data but only outputs key metrics

  • Step 3 analyzes metrics without seeing the large raw data

  • Step 4 creates a report from metrics and analysis only

  • Token usage is minimized by filtering out verbose intermediate data

๐Ÿ“š Example Workflows

Code Review Workflow

Analyzes code quality, identifies issues, and provides improvement suggestions.

  • Sample data: /workflows/examples/sample-data/sample-code-for-review.js

Data Processing Pipeline

ETL workflow with validation, quality checks, and conditional branching.

  • Sample data: /workflows/examples/sample-data/sample-data.csv

Research Assistant

Gathers information, validates sources, and produces comprehensive reports.

Simple File Processor

Basic example showing file operations, branching, and transformations.

See the /workflows/examples directory for complete workflow definitions.

๐Ÿ“ Manual Workflow Import

You can manually add workflows by placing JSON files in the imports directory:

  1. Navigate to ~/.workflows-mcp/imports/

  2. Place your workflow JSON files there (any filename ending in .json)

  3. Start or restart the MCP server

  4. The workflows will be automatically imported with:

    • A new UUID assigned if missing or invalid

    • Metadata created if not present

    • Original files moved to imports/processed/ after successful import

Example workflow file structure:

{
  "name": "My Custom Workflow",
  "description": "A manually created workflow",
  "goal": "Accomplish something specific",
  "version": "1.0.0",
  "steps": [
    {
      "id": 1,
      "action": "tool_call",
      "description": "First step",
      "tool_name": "example_tool",
      "parameters": {}
    }
  ]
}

๐Ÿ—๏ธ Architecture

workflows-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ types/          # TypeScript interfaces and schemas
โ”‚   โ”œโ”€โ”€ services/       # Core services (storage, validation)
โ”‚   โ”œโ”€โ”€ utils/          # Utility functions
โ”‚   โ””โ”€โ”€ index.ts        # MCP server implementation
โ”œโ”€โ”€ workflows/
โ”‚   โ””โ”€โ”€ examples/       # Example workflows
โ”‚       โ””โ”€โ”€ sample-data/  # Sample data files for testing
โ””โ”€โ”€ tests/              # Test suite

๐Ÿงช Development

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build for production
npm run build

# Run tests
npm test

# Type checking
npm run typecheck

๐Ÿ“ Changelog

v0.3.3 (Latest)

  • โšก Added dependency-based variable filtering for token optimization

  • โœจ Added strict_dependencies workflow flag for explicit variable control

  • โœจ Added dependencies array to steps for selective variable visibility

  • โœจ Added show_all_variables step override for full visibility when needed

  • ๐ŸŽฏ Implemented differential state updates (shows only changed variables)

  • ๐Ÿ“Š Added progressive step loading (shows only next 3 steps)

  • ๐Ÿ› Fixed UUID validation error in update_workflow tool

  • ๐Ÿ“ Added explicit instructions to prevent commentary during workflow execution

v0.3.0

  • โœจ Added workflow versioning with automatic version history

  • โœจ Added get_workflow_versions tool to list all versions

  • โœจ Added rollback_workflow tool to restore previous versions

  • ๐Ÿ“ Version history stored in ~/.workflows-mcp/versions/

v0.2.1

  • โœจ Added template variable resolution ({{variable}} syntax)

  • โœจ Fixed branching logic to properly handle conditional steps

  • โœจ Enhanced create_workflow tool with comprehensive embedded documentation

  • ๐Ÿ› Fixed ES module import issues

  • ๐Ÿ“ Improved file organization with sample-data folder

v0.2.0

  • โœจ Implemented step-by-step workflow execution

  • โœจ Added start_workflow and run_workflow_step tools

  • โœจ Session management for workflow state

  • ๐Ÿ”„ Replaced run_workflow with interactive execution

v0.1.0

  • ๐ŸŽ‰ Initial release

  • โœจ Core workflow engine

  • โœจ 16 action types

  • โœจ Import/export functionality

  • โœจ Example workflows

๐Ÿ”ฎ Roadmap

  • Core workflow engine

  • Basic action types

  • Workflow validation

  • Example workflows

  • Step-by-step execution

  • Variable interpolation

  • Branching logic

  • Import/export system

  • Advanced error handling and retry logic

  • Loop and parallel execution

  • Workflow marketplace

  • Visual workflow builder

  • Performance optimizations

  • Workflow versioning and rollback

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

Built on the Model Context Protocol specification by Anthropic.

Available Tools

9 tools
create_workflowA

Create a new workflow with specified steps and configuration.

WORKFLOW STRUCTURE:

  • name: Descriptive workflow name

  • description: What the workflow accomplishes

  • goal: The end result or outcome

  • version: Semantic version (default: "1.0.0")

  • tags: Array of categorization tags

  • inputs: Object defining input parameters with type, description, required, and optional default

  • outputs: Array of expected output variable names

  • required_tools: Array of MCP tools this workflow needs

  • steps: Array of workflow steps (see below)

  • strict_dependencies: Boolean to enable strict dependency mode (default: false)

    • false: Steps without dependencies see all variables (backward compatible)

    • true: Steps without dependencies see NO variables (must explicitly declare dependencies)

AVAILABLE ACTIONS:

  • tool_call: Execute an MCP tool (requires tool_name and parameters)

  • analyze: Analyze data and extract insights

  • consider: Evaluate options or possibilities

  • research: Gather information on a topic

  • validate: Check data quality or correctness

  • summarize: Create a summary of information

  • decide: Make a decision based on criteria

  • wait_for_input: Request user input (requires prompt)

  • transform: Transform data (requires transformation description)

  • extract: Extract specific information

  • compose: Create new content

  • branch: Conditional branching (requires conditions array)

  • checkpoint: Save progress checkpoint

  • notify: Send a notification (requires message)

  • assert: Verify a condition (requires condition)

  • retry: Retry a previous step (requires step_id)

STEP STRUCTURE: { "id": 1, // Sequential number starting from 1 "action": "action_type", "description": "What this step does", "save_result_as": "variable_name", // Optional: save result "error_handling": "stop|continue|retry", // Default: "stop" "dependencies": [1, 3], // Optional: only show outputs from these step IDs "show_all_variables": true, // Optional: override to show all variables

// For tool_call: "tool_name": "mcp_tool_name", "parameters": { "param": "value" },

// For cognitive actions (analyze, consider, research, etc): "input_from": ["variable1", "variable2"], // Input variables "criteria": "Specific criteria or focus", // Optional

// For branch: "conditions": [ { "if": "variable.property > value", "goto_step": 5 } ],

// For wait_for_input: "prompt": "Question for the user", "input_type": "text|number|boolean|json",

// For transform: "transformation": "Description of transformation" }

TEMPLATE VARIABLES: Use {{variable_name}} in any string field to reference:

  • Input parameters from workflow inputs

  • Results saved from previous steps via save_result_as

  • Any variables in the workflow state

EXAMPLES:

  • "path": "output_{{format}}.txt"

  • "prompt": "Process {{count}} items?"

  • "description": "Analyzing {{filename}}"

DEPENDENCY MANAGEMENT:

  • Use "dependencies" array to specify which previous steps' outputs are needed

  • In strict_dependencies mode, steps without dependencies see NO variables

  • Steps with dependencies only see outputs from those specific steps + workflow inputs

  • Use "show_all_variables": true to override and see all variables for a specific step

PERFORMANCE FEATURES:

  • Only relevant variables are shown based on dependencies (reduces token usage)

  • Variable changes are highlighted (+ for new, ~ for modified)

  • Only next 3 steps are previewed (progressive loading)

BEST PRACTICES:

  1. Each step should have a single, clear responsibility

  2. Use descriptive variable names for save_result_as

  3. Consider error handling for each step (stop, continue, or retry)

  4. Branch conditions should cover all cases

  5. Order steps logically with proper dependencies

  6. Use strict_dependencies for workflows with large/verbose outputs

  7. Explicitly declare dependencies to minimize context and improve performance

Inputs: workflow (required).

delete_workflowA

Soft delete a workflow (can be recovered)

Inputs: id (required).

get_workflowC

Get a specific workflow by ID

Inputs: id (required).

get_workflow_versionsC

List all available versions of a workflow

Inputs: workflow_id (required).

list_workflowsC

List all workflows with optional filtering and sorting

Inputs: filter, sort.

rollback_workflowC

Rollback a workflow to a previous version

Inputs: workflow_id (required), target_version (required), reason.

run_workflow_stepA

Execute the next step in an active workflow session.

IMPORTANT: When executing workflow steps, follow these rules:

  1. DO NOT provide commentary between workflow steps unless explicitly requested

  2. Simply execute each step according to the workflow instructions

  3. Move immediately to the next step after completing the current one

  4. Only provide output when the workflow specifically requires it (e.g., notify actions, final results)

  5. Focus solely on executing the workflow actions as defined

The tool will provide step-by-step instructions that should be followed exactly.

Inputs: execution_id (required), next_step_needed (required), step_result.

start_workflowC

Start a workflow execution session with step-by-step control

Inputs: id (required), inputs.

update_workflowC

Update an existing workflow with optional version increment

Inputs: id (required), updates (required), increment_version.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A3.5/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a distinct purpose with no overlap: create_workflow, get_workflow, update_workflow, delete_workflow, list_workflows, get_workflow_versions, rollback_workflow, start_workflow, and run_workflow_step. The descriptions clearly differentiate between CRUD operations, version management, and execution control, making it easy for an agent to select the right tool.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case, such as create_workflow, delete_workflow, and list_workflows. This predictability enhances readability and usability, with no deviations or mixed conventions across the set.

    Tool Count5/5

    With 9 tools, the server is well-scoped for workflow management, covering creation, retrieval, updating, deletion, listing, version control, and execution. Each tool serves a clear and necessary function without redundancy or excessive complexity, fitting the domain appropriately.

    Completeness5/5

    The tool set provides complete coverage for workflow lifecycle management, including CRUD operations (create, get, update, delete), version handling (get_versions, rollback), listing, and execution control (start, run_step). There are no obvious gaps, ensuring agents can perform all essential tasks without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      D
      maintenance
      A Model Context Protocol implementation that enables large language models to call external tools (like weather forecasts and GitHub information) through a structured protocol, with visualization of the model's reasoning process.
      2
      2
      ISC