Mcp Code Execution logo

Mcp Code Execution

Community
athola
mcp-code-execution

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

Overview

Publisherathola
Repositoryclaude-night-market
Skill namemcp-code-execution
Stars
343
Forks
37
Bundled files
4
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by athola on GitHub. Read the source before you install it.

Installation

Install the Mcp Code Execution AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/athola/claude-night-market/tree/master/plugins/conserve/skills/mcp-code-execution
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/athola/claude-night-market.git /tmp/claude-night-market
mkdir -p .claude/skills
cp -r /tmp/claude-night-market/plugins/conserve/skills/mcp-code-execution .claude/skills/mcp-code-execution
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Mcp Code Execution in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Mcp Code Execution on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Mcp Code Execution is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

python
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:

python
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

python
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

python
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

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

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Mcp Code Execution AI skill do?

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

Why use Mcp Code Execution on TypingMind?

Because you install it once and use it with any model. Mcp Code Execution is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Mcp Code Execution in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/athola/claude-night-market/tree/master/plugins/conserve/skills/mcp-code-execution. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Mcp Code Execution?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Mcp Code Execution?

As many as you like. As long as a model supports skills, you can use Mcp Code Execution with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Mcp Code Execution AI skill free?

Yes. It is published on GitHub by athola under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇