Skip to main content
Glama

workflow-mcp

workflow-templates 저장소의 AI 워크플로 템플릿을 MCP 호출 가능 도구로 만듭니다. 모든 MCP 클라이언트(WorkBuddy, Claude Desktop, Cursor 등)가 템플릿을 직접 나열하고, 계약을 조회하며, 템플릿을 실행해 구조화된 결과를 얻을 수 있습니다.

디지털 파이프라인의 설계자 · 네 번째 블록: 모든 파이프라인을 "플러그 앤 플레이"로

할 수 있는 일

도구

설명

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가 자동으로 로드합니다.

엔드투엔드 테스트(재무 분석 템플릿을 실제로 한 번 실행함):

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_mpc가 도구로 래핑mcp

workflow-mcp

템플릿 실행기(본 서비스)

지식 노동 파이프라인 MCP

digital-twin-mcp

장치 데이터 MCP

장치 데이터 파이프라인 MCP

factory-twin-viz

시각화 프런트엔드

임의 MCP 데이터 소비

로드맵

  • v0.1: list / get / run 세 가지 도구 + --auto-review(현재)

  • v0.2: 템플릿 출력 DB 저장(결과 추적 가능), 동시 실행 큐, 실행 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