Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
athola avatar

Mcp Code Execution

  • 94 installs
  • 325 repo stars
  • Updated August 2, 2026
  • athola/claude-night-market

Mcp-code-execution is an agent skill that defines MCP subagent pipeline and parallel coordination with MECW-aware context limits.

About

Mcp-code-execution documents coordination patterns for running MCP-focused subagents either in sequence or in parallel while watching model context window (MECW) usage. Solo builders assembling non-trivial agent pipelines can apply pipeline coordination when each step depends on the last, passing trimmed next_input payloads and persisting intermediate artifacts outside the chat so failures stay isolated and tokens do not balloon. The patterns include preemptive compaction when context crosses roughly eighty percent of the limit and hard caps per subagent so focused tasks do not inherit an entire repository transcript. Guidance calls out that parallel execution became materially more reliable in Claude Code 2.1.14+, which matters when you might otherwise run three or more concurrent agents. Treat this as procedural knowledge for structuring agentic workflows—not a hosted MCP server binary—when your product logic spans multiple tool-heavy passes.

  • Pipeline coordination: sequential subagents with shared minimal context and MECW monitoring
  • Emergency compaction when estimated context exceeds ~80% of MECW limit before each subagent
  • Per-subagent context caps near 40% of MECW limit for focused execution
  • External storage of intermediate results to limit token bleed across steps
  • Version note: parallel subagents more stable on Claude Code 2.1.14+ after memory fixes

Mcp Code Execution by the numbers

  • 94 all-time installs (skills.sh)
  • Ranked #4,644 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/athola/claude-night-market --skill mcp-code-execution

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs94
repo stars325
Security audit2 / 3 scanners passed
Last updatedAugust 2, 2026
Repositoryathola/claude-night-market

What it does

Coordinate MCP-backed subagents in pipeline or parallel patterns with context budgeting so long agent runs do not OOM.

Who is it for?

Best when you're chaining multiple MCP-backed subagents and need explicit context budgets and stable parallel execution on recent Claude Code builds.

Skip if: Single-shot tool calls with no subagent split, or environments where you cannot persist intermediate results outside the session.

When should I use this skill?

You are running multiple MCP-oriented subagents in sequence or parallel and need MECW monitoring, compaction, and intermediate result storage.

What you get

You implement pipeline or parallel subagent runs with monitored context, stored intermediate results, and bounded per-agent context for each focused task.

  • Pipeline or parallel subagent orchestration pattern with context limits
  • Documented handoff structure via next_input and stored intermediate results

By the numbers

  • Parallel subagents noted as more stable on Claude Code 2.1.14+
  • Pipeline pattern uses ~80% MECW threshold for compaction and ~40% per-subagent context cap

Files

SKILL.mdMarkdownGitHub ↗

Table of Contents

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

1. mcp-code-execution:assess-workflow 2. mcp-code-execution:route-to-modules 3. mcp-code-execution:coordinate-mecw 4. 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: 1. Delegates immediately to mcp-validation for risk assessment 2. Route to mcp-subagents for further decomposition 3. Apply compression through mcp-patterns 4. 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

Related skills

How it compares

Procedural orchestration patterns for MCP subagents—not a drop-in MCP server or a simple code-exec sandbox package.

FAQ

Who is mcp-code-execution for?

Developers designing multi-step agent workflows that delegate slices of work to subagents behind MCP tools.

When should I use mcp-code-execution?

During Build when implementing agent pipelines, at Ship when staging review or test subagents sequentially, or at Operate when breaking incident triage into isolated agent passes.

Is mcp-code-execution safe to install?

Use the Security Audits panel on this page; subagent patterns may invoke shell, network, or repo tools depending on your MCP setup—scope each subagent narrowly.

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.