mcpbeat Sign in

MCP Code Execution Skill for Claude

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

8k tokens
context cost
the whole folder, loaded on every use
5
files
instructions only
0
copies elsewhere
how many repositories repackaged it
324
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/athola/claude-night-market --skill mcp-code-execution

The instruction itself

24 sections, as written by the author

Table of Contents

  • Quick Start
  • When to Use
  • Core Hub Responsibilities
  • Required TodoWrite Items
  • Step 1 – Assess Workflow
  • Workflow Classification
  • MECW Risk Assessment
  • Step 2 – Route to Modules
  • Module Orchestration
  • Step 3 – Coordinate MECW
  • Cross-Module MECW Management
  • Step 4 – Synthesize Results
  • Result Integration
  • Module Integration
  • With Context Optimization Hub
  • Performance Skills Integration
  • Emergency Protocols
  • Hub-Level Emergency Response
  • Success Metrics

MCP Code Execution Hub

Quick Start

This skill is an orchestration hub, not a CLI. It activates

inside a Claude Code session when one of the trigger keywords

below appears, or when invoked explicitly:

Skill(conserve:mcp-code-execution)

The hub then routes to the relevant sub-skill modules

(mcp-subagents, mcp-patterns, mcp-validation) based on

the detected workflow shape. There is no separate install

step or CLI entry point.

When To Use

  • Automatic: Keywords: code execution, MCP, tool chain, data pipeline, MECW
  • Tool Chains: >3 tools chained sequentially
  • Data Processing: Large datasets (>10k rows) or files (>50KB)
  • Context Pressure: Current usage >25% of total window (proactive context management)

> MCP Tool Search (Claude Code 2.1.7+): When MCP tool

> descriptions exceed 10% of context, tools are automatically

> deferred and discovered via MCPSearch instead of being loaded

> upfront. This reduces token overhead by ~85% but means tools

> must be discovered on-demand. Haiku models do not support tool

> search. Configure threshold with ENABLE_TOOL_SEARCH=auto:N

> where N is the percentage.

> Subagent MCP Access Fix (Claude Code 2.1.30+): SDK-provided

> MCP tools are now properly synced to subagents. Prior to 2.1.30,

> subagents could not access SDK-provided MCP tools: workflows

> delegating MCP tool usage to subagents were silently broken. No

> workarounds needed on 2.1.30+.

> Claude.ai MCP Connectors (Claude Code 2.1.46+): Users logged

> into Claude Code with a claude.ai account may have additional

> MCP tools auto-loaded from claude.ai/settings/connectors. These

> tools contribute to the tool search threshold count. If

> workflows unexpectedly trigger tool search or context inflation,

> check /mcp for claude.ai-sourced connectors. Known reliability

> issue: connectors can silently disappear (GitHub #21817).

> MCP Prompt Cache Fix (Claude Code 2.1.70+): MCP servers with

> instructions connecting after the first turn no longer bust the

> prompt cache. Previously, a late-connecting MCP server would

> invalidate cached prompt prefixes, increasing token costs for

> the rest of the session. On 2.1.70+, prompt cache reuse is

> preserved regardless of when MCP servers connect.

> ToolSearch Reliability Fix (Claude Code 2.1.70+): Empty

> model responses after ToolSearch are fixed. The server was

> rendering tool schemas with system-prompt-style tags that could

> confuse models into stopping early. ToolSearch-heavy workflows

> (many deferred MCP tools) are now more reliable.

When NOT To Use

  • Simple tool calls that don't chain
  • Context pressure is low and tools are fast

Core Hub Responsibilities

  • Orchestrates MCP code execution workflow
  • Routes to appropriate specialized modules
  • Coordinates MECW compliance across submodules
  • Manages token budget allocation for submodules

Required TodoWrite Items

  • mcp-code-execution:assess-workflow
  • mcp-code-execution:route-to-modules
  • mcp-code-execution:coordinate-mecw
  • mcp-code-execution:synthesize-results

Step 1 – Assess Workflow (mcp-code-execution:assess-workflow)

Workflow Classification

def classify_workflow_for_mecw(workflow):
    """Determine appropriate MCP modules and MECW strategy"""

    if has_tool_chains(workflow) and workflow.complexity == 'high':
        return {
            'modules': ['mcp-subagents', 'mcp-patterns'],
            'mecw_strategy': 'aggressive',
            'token_budget': 600
        }
    elif workflow.data_size > '10k_rows':
        return {
            'modules': ['mcp-patterns', 'mcp-validation'],
            'mecw_strategy': 'moderate',
            'token_budget': 400
        }
    else:
        return {
            'modules': ['mcp-patterns'],
            'mecw_strategy': 'conservative',
            'token_budget': 200
        }

MECW Risk Assessment

Delegate to mcp-validation module for detailed risk analysis:

def delegate_mecw_assessment(workflow):
    return mcp_validation_assess_mecw_risk(
        workflow,
        hub_allocated_tokens=self.token_budget * 0.5
    )

Step 2 – Route to Modules (mcp-code-execution:route-to-modules)

Module Orchestration

class MCPExecutionHub:
    def __init__(self):
        self.modules = {
            'mcp-subagents': MCPSubagentsModule(),
            'mcp-patterns': MCPatternsModule(),
            'mcp-validation': MCPValidationModule()
        }

    def execute_workflow(self, workflow, classification):
        results = []

        # Execute modules in optimal order
        for module_name in classification['modules']:
            module = self.modules[module_name]
            result = module.execute(
                workflow,
                mecw_budget=classification['token_budget'] //
                len(classification['modules'])
            )
            results.append(result)

        return self.synthesize_results(results)

Step 3 – Coordinate MECW (mcp-code-execution:coordinate-mecw)

Cross-Module MECW Management

  • Monitor total context usage across all modules
  • Enforce 50% context rule globally
  • Coordinate external state management
  • Implement MECW emergency protocols

Step 4 – Synthesize Results (mcp-code-execution:synthesize-results)

Result Integration

def synthesize_module_results(module_results):
    """Combine module results into a single status dict."""

    return {
        'status': 'completed',
        'token_savings': calculate_savings(module_results),
        'mecw_compliance': verify_mecw_rules(module_results),
        'hallucination_risk': assess_hallucination_prevention(module_results),
        'results': consolidate_results(module_results)
    }

Module Integration

Available Modules

  • See modules/mcp-coordination.md for cross-module orchestration
  • See modules/mcp-patterns.md for common MCP execution patterns
  • See modules/mcp-subagents.md for subagent delegation strategies
  • See modules/mcp-validation.md for MECW compliance validation

With Context Optimization Hub

  • Receives high-level MECW strategy from context-optimization
  • Returns detailed execution metrics and compliance data
  • Coordinates token budget allocation

Performance Skills Integration

  • uses python-performance-optimization through mcp-patterns
  • Aligns with cpu-gpu-performance for resource-aware execution
  • validates optimizations maintain MECW compliance

Emergency Protocols

Hub-Level Emergency Response

When MECW limits exceeded:

  • Delegates immediately to mcp-validation for risk assessment
  • Route to mcp-subagents for further decomposition
  • Apply compression through mcp-patterns
  • Return minimal summary to preserve context

Success Metrics

  • Workflow Success Rate: >95% successful module coordination
  • MECW Compliance: 100% adherence to 50% context rule
  • Token Efficiency: Maintain >80% savings vs traditional methods
  • Module Coordination: <5% overhead for hub orchestration

Exit Criteria

  • [ ] Workflow classified into one of the three MECW strategies

(aggressive/moderate/conservative) with the correct module

roster (mcp-subagents, mcp-patterns, mcp-validation)

selected based on tool-chain length and data size

  • [ ] Context usage remains at or below 50% of the total window

throughout the workflow; any breach triggers the hub-level

emergency response (delegate to mcp-validation, route to

mcp-subagents, apply compression)

  • [ ] synthesize_module_results returns a dict with all four

keys: status, token_savings, mecw_compliance,

hallucination_risk

  • [ ] Token savings reported at the end of the workflow are

greater than 80% compared to running the same workflow via

direct Bash tool chaining

Other skills for the same job

different authors, same section of the catalogue
Skill Creator
by anthropics
vendor ×10

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

56k tokens scripts
Pufferlib
by ComeOnOliver
×3

This skill should be used when working with reinforcement learning tasks including high-performance RL training, custom environment development, vectorized parallel simulation, multi-agent systems, or integration with existing RL environments (Gymnasium, PettingZoo, Atari, Procgen, etc.). Use this skill for implementing PPO training, creating PufferEnv environments, optimizing RL performance, or developing policies with CNNs/LSTMs.

28k tokens scripts
Run Evals
by flutter
vendor ×2

Run evaluations for one, multiple, or all skills using the agent orchestration framework. Make sure to use this skill whenever the user asks to run evals, test a skill's performance, run benchmarks, or compare baseline versus with-skill execution.

2k tokens
LLM Application Dev Prompt Optimize
by ComeOnOliver
×2

You are an expert prompt engineer specializing in crafting effective prompts for LLMs through advanced techniques including constitutional AI, chain-of-thought reasoning, and model-specific optimizati

6k tokens
Nowait Reasoning Optimizer
by ComeOnOliver
×2

Implements the NOWAIT technique for efficient reasoning in R1-style LLMs. Use when optimizing inference of reasoning models (QwQ, DeepSeek-R1, Phi4-Reasoning, Qwen3, Kimi-VL, QvQ), reducing chain-of-thought token usage by 27-51% while preserving accuracy. Triggers on "optimize reasoning", "reduce thinking tokens", "efficient inference", "suppress reflection tokens", or when working with verbose CoT outputs.

8k tokens scripts
Evolving AI Agents
by Orchestra-Research
×1

Provides guidance for automatically evolving and optimizing AI agents across any domain using LLM-driven evolution algorithms. Use when building self-improving agents, optimizing agent prompts and skills against benchmarks, or implementing automated agent evaluation loops.

36k tokens
Context Manager
by lingxling
×1

Elite AI context engineering specialist mastering dynamic context management, vector databases, knowledge graphs, and intelligent memory systems.

2k tokens
Zach Seller Skill Creator
by zach22-1999
×1

亚马逊卖家专用的 skill 创建器(中文)。当用户想把一个亚马逊运营/自媒体/日常工作流程变成可复用的 skill 时使用。触发场景包括但不限于:用户说"我想做一个 skill""把这个流程变成 skill""帮我写个自动化""优化我已有的 skill""给这个工作流做个自动化",即使用户没用"skill"这个词,只要在描述"以后每次都这样做"的重复性工作时也应触发。本 skill 的核心差异:强制用户先回答 6 个业务问题(业务目标/过去做法/具体步骤/方法论/调用方式/期望输出)再进入创建流程,防止产出空洞 skill。Create new skills, improve existing skills, run evals and benchmarks — tailored for Amazon sellers with a Chinese-first workflow.

63k tokens scripts zh

How to use it

Copy the folder

Take athola/mcp-code-execution from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.