SuperAPI AI Directory

mcp-orchestration

Agents & models

View repository

Updated 10-15 22:13

About this skill

MCP Tool Orchestration Skill

Instructions

When users need to execute complex development tasks or need multiple tools to collaborate, automatically perform MCP tool orchestration:

Trigger Conditions

  • Complex development workflows requiring multiple steps
  • Involving multiple technology stacks or toolchains
  • Requiring combined operations such as performance analysis, code review, and documentation queries
  • Comprehensive tasks such as project setup, deployment, and optimization

MCP Tool Usage Instructions

This skill mainly uses the following MCP tools:

  • Chrome DevTools MCP - Web development and debugging tool, used for performance analysis and network monitoring
  • Sequential Thinking MCP - Step-by-step reasoning and problem decomposition tool, used for logical analysis and step planning
  • Context7 MCP - Automated document research and information retrieval tool, used to obtain technical documentation and best practices
  • Godot MCP - Godot engine integration tool, used for scene editing and script generation
  • Skill MCP - Skill invocation and management tool, used to coordinate the execution of other skills

MCP Invocation Methods

# 并行调用多个MCP工具
const [performance, docs, thinking] = await Promise.all([
  chromeDevToolsMCP.analyze_performance(),
  context7MCP.search('best practices'),
  sequentialThinkingMCP.analyze_problem()
]);

# 串行调用MCP工具
const version = await godotMCP.detect_godot_version();
const analysis = await godotMCP.check_compatibility(code);
const fixes = await godotMCP.fix_issues(analysis.issues);

# 技能内调用其他技能
await useSkill('context7-auto-research', { query: 'user query' });
await useSkill('godot-compatibility-checker', { action: 'check_version' });

Supported MCP Tools

Configured Tools

  1. Chrome DevTools MCP - Web development and debugging tool
  2. Sequential Thinking MCP - Step-by-step reasoning and problem decomposition
  3. Context7 MCP - Automated document research and information retrieval
  4. Godot MCP - Godot engine integration tool

Orchestration Modes

1. Serial Mode - Step-by-step execution

Suitable for tasks that require a strict sequence of steps, ensuring each step is completed before proceeding to the next.

Example: Godot Project Upgrade Workflow

async function godotProjectUpgrade() {
  // 步骤1: 版本检测
  const version = await useSkill('godot-compatibility-checker', {
    action: 'detect_version'
  });

  // 步骤2: 兼容性分析
  const analysis = await useSkill('godot-compatibility-checker', {
    action: 'analyze_compatibility',
    targetVersion: '4.x'
  });

  // 步骤3: 自动修复
  const fixes = await useSkill('godot-compatibility-checker', {
    action: 'fix_issues',
    issues: analysis.criticalIssues
  });

  // 步骤4: 验证结果
  const validation = await useSkill('godot-compatibility-checker', {
    action: 'validate_fixes'
  });

  return validation;
}

2. Parallel Mode - Simultaneous execution

Suitable for independent tasks that can be executed simultaneously, improving execution efficiency.

Example: Comprehensive Project Analysis

async function comprehensiveProjectAnalysis() {
  const [performance, security, documentation] = await Promise.all([
    useSkill('chrome-devtools', { action: 'analyze_performance' }),
    useSkill('context7-auto-research', {
      query: 'security best practices for web applications'
    }),
    useSkill('sequential-thinking', {
      task: 'analyze project architecture and suggest improvements'
    })
  ]);

  return {
    performance: performance.metrics,
    security: security.recommendations,
    architecture: documentation.suggestions
  };
}

3. Conditional Mode - Intelligent branching

Determines subsequent execution paths based on intermediate results, enabling intelligent decision-making.

Example: Intelligent Problem Diagnosis

async function intelligentProblemDiagnosis(userIssue) {
  // 步骤1: 问题分类
  const classification = await useSkill('sequential-thinking', {
    task: 'classify_problem',
    description: userIssue
  });

  // 步骤2: 根据分类选择解决方案
  switch (classification.category) {
    case 'compatibility':
      return await handleCompatibilityIssue(userIssue);
    case 'performance':
      return await handlePerformanceIssue(userIssue);
    case 'documentation':
      return await useSkill('context7-auto-research', {
        query: userIssue.description
      });
    case 'architecture':
      return await handleArchitectureIssue(userIssue);
    default:
      return await handleGenericIssue(userIssue);
  }
}

4. Loop Mode - Iterative optimization

Suitable for scenarios that require gradual improvement and optimization.

Example: Progressive Code Optimization

async function iterativeCodeOptimization(code, targetQuality) {
  let currentCode = code;
  let currentQuality = await measureCodeQuality(currentCode);
  let iteration = 0;
  const maxIterations = 5;

  while (currentQuality < targetQuality && iteration < maxIterations) {
    iteration++;

    // 分析当前问题
    const analysis = await useSkill('sequential-thinking', {
      task: 'analyze_code_improvements',
      code: currentCode
    });

    // 查找最佳实践
    const bestPractices = await useSkill('context7-auto-research', {
      query: `${analysis.improvement_areas} best practices optimization`
    });

    // 应用改进
    const improvedCode = await applyCodeImprovements(currentCode, bestPractices);

    // 验证改进效果
    const newQuality = await measureCodeQuality(improvedCode);

    if (newQuality > currentQuality) {
      currentCode = improvedCode;
      currentQuality = newQuality;
      console.log(`迭代 ${iteration}: 质量提升 ${((newQuality - currentQuality) / currentQuality * 100).toFixed(2)}%`);
    } else {
      console.log(`迭代 ${iteration}: 无明显改进,停止优化`);
      break;
    }
  }

  return {
    optimizedCode: currentCode,
    finalQuality: currentQuality,
    iterations: iteration
  };
}

Practical Application Scenarios

Scenario 1: Complete Godot Web Game Development

async function developGodotWebGame(gameSpecification) {
  // 阶段1: 项目设置 (串行)
  await useSkill('godot-compatibility-checker', {
    action: 'setup_project',
    spec: gameSpecification
  });

  await useSkill('chrome-devtools', {
    action: 'setup_dev_server',
    port: 8080
  });

  // 阶段2: 功能开发 (并行 + 串行混合)
  const developmentResults = await Promise.all([
    // 核心功能开发
    developCoreFeatures(gameSpecification.coreFeatures),
    // 资源准备
    prepareAssets(gameSpecification.assets),
    // 文档准备
    prepareDocumentation(gameSpecification.documentation)
  ]);

  // 阶段3: 集成测试 (串行)
  await runIntegrationTests(developmentResults);

  // 阶段4: 性能优化 (循环)
  const optimizationResult = await optimizeForWeb(developmentResults);

  return {
    gamePath: gameSpecification.outputPath,
    performanceMetrics: optimizationResult.metrics,
    buildStatus: 'success'
  };
}

Scenario 2: Intelligent Code Review Workflow

async function intelligentCodeReview(pullRequestContent) {
  // 步骤1: 并行分析
  const [staticAnalysis, securityCheck, bestPractices] = await Promise.all([
    useSkill('godot-compatibility-checker', {
      action: 'static_code_analysis',
      code: pullRequestContent.changes
    }),
    useSkill('context7-auto-research', {
      query: 'security vulnerabilities in Godot games web development'
    }),
    useSkill('context7-auto-research', {
      query: 'GDScript best practices code style 2024'
    })
  ]);

  // 步骤2: 逻辑分析
  const logicAnalysis = await useSkill('sequential-thinking', {
    task: 'analyze_code_logic_and_architecture',
    code: pullRequestContent.changes,
    context: staticAnalysis
  });

  // 步骤3: 生成审查报告
  const reviewReport = generateComprehensiveReview({
    static: staticAnalysis,
    security: securityCheck,
    practices: bestPractices,
    logic: logicAnalysis
  });

  return reviewReport;
}

Error Handling and Recovery

Error Classification Strategy

const errorRecoveryStrategies = {
  'network_error': {
    retry: true,
    maxRetries: 3,
    fallback: 'use_cached_result'
  },
  'api_limit_exceeded': {
    retry: false,
    fallback: 'use_alternative_tool'
  },
  'invalid_input': {
    retry: false,
    fallback: 'request_user_correction'
  },
  'tool_unavailable': {
    retry: true,
    fallback: 'manual_intervention'
  }
};

Resume Execution

async function handleWorkflowError(error, workflowContext) {
  const strategy = errorRecoveryStrategies[error.type];

  switch (strategy.fallback) {
    case 'use_cached_result':
      return await getCachedResult(workflowContext);
    case 'use_alternative_tool':
      return await tryAlternativeTool(workflowContext);
    case 'request_user_correction':
      return await requestUserInput(error, workflowContext);
    case 'manual_intervention':
      return await escalateToHuman(error, workflowContext);
  }
}

Configuration and Optimization

Workflow Configuration Example

# workflow-config.yaml
workflows:
  godot-development:
    mode: serial
    steps:
      - tool: godot-compatibility-checker
        action: detect_version
      - tool: context7-auto-research
        query: "Godot 4.x development best practices"
      - tool: godot-compatibility-checker
        action: implement_features

  web-optimization:
    mode: parallel
    steps:
      - tool: chrome-devtools
        action: analyze_performance
      - tool: context7-auto-research
        query: "web performance optimization techniques"
      - tool: sequential-thinking
        task: "analyze performance bottlenecks"

performance:
  default_timeout: 60000
  max_parallel_tasks: 3
  cache_enabled: true
  cache_ttl: 3600000

Output Format

  1. Workflow Overview - Explains the execution mode and steps
  2. Execution Results - Detailed results of each step
  3. Performance Metrics - Execution time and resource usage
  4. Problem Diagnosis - Problems encountered and solutions
  5. Improvement Suggestions - Suggestions for optimizing the workflow

Precautions

  • Select the most appropriate execution mode based on task characteristics
  • Set reasonable timeout durations to avoid a single step blocking the entire workflow
  • Implement a comprehensive error recovery mechanism to improve system robustness
  • Monitor tool performance to identify bottlenecks and optimize them
  • Use caching appropriately to reduce repeated network calls
  • Pay attention to resource contention and dependencies during parallel execution