Skip to main content
Glama

workflow-mcp

workflow-templates リポジトリ内の AI ワークフローテンプレートを MCP 呼び出し可能ツール に変換します。あらゆる MCP クライアント(WorkBuddy、Claude Desktop、Cursor など)がテンプレートの一覧表示、契約の確認、テンプレートの実行、構造化された結果の取得を直接行えます。

デジタルパイプラインの建築家 · 第4の積み木:すべてのパイプラインを「プラグアンドプレイ」にする

できること

ツール

説明

list_templates

リポジトリ内の利用可能な全テンプレートを一覧表示(バージョン / 説明 / 実行可能かどうか)

get_template_info

テンプレートの入出力 JSON Schema と処理パイプライン(DAG)の概要を表示

run_template

テンプレートを同期実行:JSON 入力、構造化データ + レポート出力

run_template_async

非同期実行(推奨):即座に task_id を返し、バックグラウンドで実行

get_task_status

非同期タスクの状態をポーリング(running / done / error)

サンプルセッション:

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,返回指标 + 风险信号 + 报告

なぜ非同期版が必要か:WorkBuddy / Claude Desktop などのクライアントは単一のツール呼び出しにリクエストタイムアウト制限があり、テンプレートの実際の実行(複数回の LLM 呼び出し)には通常 1〜2 分かかるため、同期呼び出しはタイムアウトします。非同期版はこの制限を回避します。

Related MCP server: MCP Boilerplate

アーキテクチャ

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    │  模板仓库:契约 + 提示词 + 脚本(数据权威)
└───────────────────────┘

主要設計:

  • テンプレートリポジトリが単一の真実の情報源を維持:テンプレートの追加/変更は workflow-templates を変更するだけで、本サービスの変更は不要

  • 自動レビュー:run.py に --auto-review パラメータを追加。MCP が自動実行する際に人間の操作をスキップし、出力に review_note マークを付けて、呼び出し側が重要な数値を検証する

  • 実行の分離:実行のたびに一時入力ファイル(使用後削除)を書き込み、出力はテンプレートの output/ に保存

クイックスタート

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

前提依存:workflow-templates リポジトリがローカル E:\NEMB\workflow-templates にある(環境変数 WORKFLOW_TEMPLATES_HOME で上書き可能)。テンプレート付属の .env(例:OpenRouter キー)は run.py が自動的に読み込みます。

エンドツーエンドテスト(実際に財務分析テンプレートを1回実行します):

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

WorkBuddy への接続

examples/workbuddy_mcp.json を C:\Users\33033\.workbuddy\mcp.json の mcpServers にマージし、コネクタ管理ページで workflow-mcp を「信頼」して有効にします。その後、会話で「財務分析テンプレートを実行して」と直接言うことができます。

三つ組との関係

リポジトリ

役割

MCP エコシステムでの位置

workflow-templates

テンプレートリポジトリ(コンテンツの権威)

workflow-mcp によってツールとしてラップされる

workflow-mcp

テンプレート実行器(本サービス)

知的労働パイプライン MCP

digital-twin-mcp

デバイスデータ MCP

デバイスデータパイプライン MCP

factory-twin-viz

可視化フロントエンド

任意の MCP データを消費

ロードマップ

  • v0.1:list / get / run の3ツール + --auto-review(現在)

  • v0.2:テンプレート出力のデータベース保存(結果の追跡可能)、並行実行キュー、n8n 版テンプレートのインポート

  • v0.3:digital-twin-mcp と組み合わせて「デバイス健全性レポート」テンプレート(データパイプライン × 知的パイプライン)

ライセンス

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.

    Related MCP Connectors

    Related MCP Servers