mcp-code-execution

Solid

Scaffold the code execution pattern for MCP-based agents. Use when agents call many MCP tools, intermediate data exceeds context, you need loops, or PII must stay out of context.

AI & Automation 48 stars 6 forks Updated today MIT

Install

View on GitHub

Quality Score: 80/100

Stars 20%
56
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# MCP Code Execution Pattern Expert knowledge for designing agent systems that generate and execute code to interact with MCP servers, instead of calling tools directly. For the typed-wrapper code, the six key-pattern examples, and the project scaffolding steps, see [REFERENCE.md](REFERENCE.md). ## When to Use This Skill | Use code execution when... | Use direct tool calls / `mcp-management` when... | |----------------------------|--------------------------------------------------| | Designing agents that fan out across 10+ MCP servers or 50+ tools | Installing or configuring one or two servers in `.mcp.json` | | Intermediate results are large (>10K tokens) and would blow context | Results are small and all needed by the model | | Workflows need loops, retries, or conditionals across tool calls | Linear sequences of 2–3 tool calls | | PII must not reach the model context | Tool responses contain no sensitive data | | Tasks benefit from state persistence across runs | Stateless, one-shot operations | | You want agents to accumulate reusable skills | Fixed, predefined workflows | ## Core Architecture ### How It Works Instead of loading all MCP tool definitions into context upfront, the agent: 1. **Discovers** available tools by navigating a typed file tree 2. **Generates** TypeScript/Python code that imports and calls typed wrapper functions 3. **Executes** the code in a sandboxed environment 4. **Returns** only filtered/summarized results to the model This reduces tok...

Details

Author
laurigates
Repository
laurigates/claude-plugins
Created
7 months ago
Last Updated
today
Language
Shell
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category