Skip to main content
Glama

workflow-mcp

Turn the AI workflow templates in the workflow-templates repository into MCP-callable tools — any MCP client (WorkBuddy, Claude Desktop, Cursor, etc.) can directly list templates, inspect contracts, execute templates, and get structured results.

Architect of digital pipelines · Fourth building block: make all pipelines "plug-and-play"

What it can do

Tool

Description

list_templates

List all available templates in the repository (version / description / executable or not)

get_template_info

View the template's input/output JSON Schema and processing pipeline (DAG) overview

run_template

Execute a template synchronously: JSON in, structured data + report out

run_template_async

Async execution (recommended): returns task_id immediately, runs in the background

get_task_status

Poll async task status (running / done / error)

Example session:

1. list_templates                    → 发现 financial-report-analysis
2. get_template_info(模板id)          → 拿到输入契约(需要 company_name / report_path / report_type)
3. run_template_async(模板id, json)   → {task_id, status: running}
4. get_task_status(task_id)           → 轮询至 done,返回指标 + 风险信号 + 报告

Why the async version is needed: clients like WorkBuddy / Claude Desktop impose request timeout limits on individual tool calls, while real template execution (multiple LLM calls) usually takes 1-2 minutes, so synchronous calls time out. The async version avoids this limitation.

Related MCP server: MCP Boilerplate

Architecture

MCP 客户端(WorkBuddy / Claude Desktop / ...)
        │  stdio / streamable-http
┌───────▼───────────────┐
│  server.py (FastMCP)  │   list / get / run 三个工具
└───────┬───────────────┘
┌───────▼───────────────┐
│  templates_registry.py │  扫描 workflow-templates,读取契约元数据
│  runner.py             │  子进程执行模板 run.py(--auto-review 自动化复核)
└───────┬───────────────┘
        │
┌───────▼───────────────┐
│  workflow-templates    │  模板仓库:契约 + 提示词 + 脚本(数据权威)
└───────────────────────┘

Key design decisions:

  • The template repository remains the single source of truth: adding or modifying templates only requires changing workflow-templates; this service needs zero changes

  • Automated review: run.py adds an --auto-review flag; when MCP executes automatically, it skips human interaction, and the output is marked with review_note for the caller to verify key figures

  • Execution isolation: each run writes a temporary input file (deleted after use), and output is persisted to the template's output/

Quick start

pip install -e .
python -m workflow_mcp.server                 # stdio(默认)
python -m workflow_mcp.server --transport streamable-http

Prerequisites: the workflow-templates repository is on this machine at E:\NEMB\workflow-templates (can be overridden with the WORKFLOW_TEMPLATES_HOME environment variable); the template's own .env (e.g., OpenRouter API key) is loaded by run.py itself.

End-to-end test (will actually run the financial report analysis template once):

python examples/client_test.py    # stdio 协议方式
python examples/inproc_test.py    # 进程内客户端方式(CI / 沙箱环境更稳)

Integrating with WorkBuddy

Merge examples/workbuddy_mcp.json into mcpServers in C:\Users\33033\.workbuddy\mcp.json, then click "Trust" on workflow-mcp in the connector management page to enable it. After that, you can simply say "run the financial report analysis template for me" in a conversation.

Relationship with the trio

Repository

Role

Position in the MCP ecosystem

workflow-templates

Template repository (content authority)

Wrapped as tools by workflow-mcp

workflow-mcp

Template executor (this service)

Brainpower pipeline MCP

digital-twin-mcp

Device data MCP

Device data pipeline MCP

factory-twin-viz

Visualization frontend

Consumes any MCP data

Roadmap

  • v0.1: list / get / run three tools + --auto-review (current)

  • v0.2: persist template outputs to a database (traceable results), concurrent execution queue, n8n template import

  • v0.3: combine with digital-twin-mcp into a "device health report" template (data pipeline × brainpower pipeline)

License

MIT License

Available Tools

5 tools
get_task_statusGet Task StatusA

查询异步任务状态:running / done / error;done 时返回完整结果(同 run_template 返回结构)。

Inputs: task_id (required). Returns: object

get_template_infoGet Template InfoC

查看模板的契约:输入/输出 JSON Schema、处理流水线(DAG)概要。

Inputs: template_id (required). Returns: object

list_templatesList TemplatesA

列出 workflow-templates 仓库中所有可用的工作流模板(含版本、描述、是否可执行)。

Inputs: no named parameters. Returns: result

run_templateRun TemplateA

执行指定工作流模板。input_json 为符合该模板输入契约的 JSON 字符串(如财报分析模板需 company_name / report_path / report_type)。

返回:success、data(结构化输出,含 human_review_required 标记)、report(报告文本)、artifacts(落盘路径)。 注意:自动化执行会标记 review_note,请调用方核验关键数字。 长耗时模板(如含多次 LLM 调用)在带请求超时限制的客户端下请改用 run_template_async。

Inputs: input_json (required), template_id (required). Returns: object

run_template_asyncRun Template AsyncA

异步执行指定模板:立即返回 task_id,执行在后台进行,用 get_task_status 轮询结果。

适用场景:WorkBuddy / Claude Desktop 等客户端对单次工具调用有请求超时限制, 而模板真实执行(多次 LLM 调用)可能超过该限制。

Inputs: input_json (required), template_id (required). Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct operation: list_templates (enumerate), get_template_info (inspect contract), run_template (sync execute), run_template_async (async execute), get_task_status (poll). The sync/async pair is clearly differentiated by explicit timeout guidance in the descriptions, so no realistic misselection.

    Naming Consistency4/5

    All names follow a clean verb_noun snake_case pattern (list/get/run/get). Minor inconsistency: list_templates uses a plural noun while get_template_info uses singular, and 'info'/'status' suffixes differ slightly, but this is readable and predictable.

    Tool Count5/5

    Five tools is well-scoped for a template-consumer/executor server, with each tool earning its place (discovery, inspection, sync exec, async exec, polling). No redundant or filler tools.

    Completeness4/5

    Covers the full discover-inspect-execute-monitor lifecycle, including an async path for long-running templates. Minor gap: no cancel/abort operation for a running async task, which could strand agents waiting on a hung task.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers