← 返回
效率工具 中文

MCP Workflow

Workflow automation using MCP (Model Context Protocol) patterns inspired by Jason Zhou
基于Jason Zhou启发的MCP(模型上下文协议)模式实现工作流自动化
slemo54
效率工具 clawhub v1.0.0 1 版本 99802.9 Key: 无需
★ 1
Stars
📥 1,499
下载
💾 25
安装
1
版本
#latest

概述

MCP Workflow Skill

Quick Reference

# Start MCP Server
node scripts/mcp-server.js

# Run a workflow
./scripts/workflow-engine.sh run <workflow-name> [--input <json>]

# List available workflows
./scripts/workflow-engine.sh list

# Create new workflow from template
./scripts/workflow-engine.sh create <name> --from <template>

# Validate workflow
./scripts/workflow-engine.sh validate <workflow-file>

Overview

This skill implements workflow automation using the Model Context Protocol (MCP), enabling:

  • Prompt Chains: Multi-step prompt sequences
  • Dynamic Workflows: Context-aware adaptation
  • Resource Integration: File/data embedding
  • Cross-Server Coordination: Multi-MCP orchestration

Workflow Patterns

1. Prompt Chain Pattern

plan → generate → execute → validate

2. Dynamic Prompt Pattern

context → adapt → generate → output

3. Resource Embedding Pattern

resource://{type}/{id} → load → embed → process

4. External Trigger Pattern

trigger → validate → dispatch → execute

Built-in Templates

TemplateDescriptionUse Case
---------------------------------
meal-plannerWeekly meal planningNutrition, shopping lists
code-reviewAutomated code reviewPR analysis, quality checks
weekly-reportStatus report generationTeam updates, metrics
documentation-generatorDoc generationAPI docs, changelogs

MCP Server Features

Resources

  • file://{path} - File system access
  • memory://{key} - Memory storage
  • config://{section} - Configuration values

Tools

  • workflow.run - Execute workflow
  • workflow.list - List workflows
  • workflow.validate - Validate workflow JSON
  • prompt.render - Render prompt template

Prompts

  • chain:plan - Planning prompt
  • chain:generate - Generation prompt
  • chain:review - Review prompt

Example Usage

Meal Planner Workflow

./scripts/workflow-engine.sh run meal-planner \
  --input '{"diet":"vegetarian","days":7,"budget":50}'

Code Review Workflow

./scripts/workflow-engine.sh run code-review \
  --input '{"repo":"myapp","pr":123}'

Weekly Report

./scripts/workflow-engine.sh run weekly-report \
  --input '{"project":"dashboard","week":"2024-W01"}'

Best Practices

1. Workflow Design

  • Keep steps atomic and focused
  • Use clear input/output contracts
  • Implement error handling at each step
  • Version your workflows

2. Prompt Engineering

  • Use system prompts for context
  • Provide examples in few-shot prompts
  • Chain prompts for complex tasks
  • Validate outputs before next step

3. Resource Management

  • Use URI patterns consistently
  • Cache frequently accessed resources
  • Clean up temporary resources
  • Document resource schemas

4. Cross-Server Coordination

  • Define clear interfaces between servers
  • Use standardized message formats
  • Implement health checks
  • Handle timeouts gracefully

Configuration

Create ~/.openclaw/mcp-workflow.json:

{
  "servers": [
    {
      "name": "local",
      "command": "node scripts/mcp-server.js",
      "env": {}
    }
  ],
  "workflowsDir": "./workflows",
  "templatesDir": "./scripts/templates",
  "defaultTimeout": 30000
}

Integration with OpenClaw

Use in your OpenClaw session:

# Load the skill
openclaw skill load mcp-workflow

# Run workflow
openclaw workflow run meal-planner --input '{"days":5}'

References

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 08:05 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Weather

steipete
获取当前天气和预报(无需API密钥)
★ 444 📥 226,103
data-analysis

AI Labs Builder

slemo54
{"answer":"AI Labs Builder —— 创建现代网站、AI应用、仪表盘及自动化工作流。使用 Ne 构建生产级项目的统一系统。"}
★ 1 📥 1,420
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 437 📥 147,170