[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6C5BKASW5CZNK0S8K3B5ATC":3,"skill-same:01M6C5BKASW5CZNK0S8K3B5ATC":102},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":53,"linkOnly":54,"markdownContent":55,"markdownBody":56,"frontMatter":57,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":65,"repositoryHtmlUrl":66,"repositoryHomepageUrl":6,"ownerHtmlUrl":67,"ownerBlogUrl":6,"ownerDescription":68,"updatedAt":69,"install":70,"resources":83},"01M6C5BKASW5CZNK0S8K3B5ATC","mcp-code-execution",null,"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.","laurigates\u002Fclaude-plugins","laurigates","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F13014001?v=4","01M6C59YHWS9C7KMXKSRX1YXNP","Lauri Gates","01M6C59YP2APG9YAM4DWYQYGFJ",60,"MIT","https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fagent-patterns-plugin\u002Fskills\u002Fmcp-code-execution\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],"code","execution","code execution","mcp code execution","MCP","edit","2026","when","for","you","loops","false","pattern","use","context","write","read","grep","Bash","pii","Tools","data","mcp tools","scaffold","2026-11-10 10:12:30",false,"---\nname: mcp-code-execution\ndescription: 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.\nuser-invocable: false\nallowed-tools: Bash, Read, Write, Edit, Grep, Glob, TodoWrite\ncreated: 2026-02-08\nmodified: 2026-07-28\nreviewed: 2026-06-14\n---\n\n# MCP Code Execution Pattern\n\nExpert knowledge for designing agent systems that generate and execute code to interact with MCP servers, instead of calling tools directly.\n\nFor the typed-wrapper code, the six key-pattern examples, and the project\nscaffolding steps, see [REFERENCE.md](REFERENCE.md).\n\n## When to Use This Skill\n\n| Use code execution when... | Use direct tool calls \u002F `mcp-management` when... |\n|----------------------------|--------------------------------------------------|\n| Designing agents that fan out across 10+ MCP servers or 50+ tools | Installing or configuring one or two servers in `.mcp.json` |\n| Intermediate results are large (>10K tokens) and would blow context | Results are small and all needed by the model |\n| Workflows need loops, retries, or conditionals across tool calls | Linear sequences of 2–3 tool calls |\n| PII must not reach the model context | Tool responses contain no sensitive data |\n| Tasks benefit from state persistence across runs | Stateless, one-shot operations |\n| You want agents to accumulate reusable skills | Fixed, predefined workflows |\n\n## Core Architecture\n\n### How It Works\n\nInstead of loading all MCP tool definitions into context upfront, the agent:\n\n1. **Discovers** available tools by navigating a typed file tree\n2. **Generates** TypeScript\u002FPython code that imports and calls typed wrapper functions\n3. **Executes** the code in a sandboxed environment\n4. **Returns** only filtered\u002Fsummarized results to the model\n\nThis reduces token usage from O(all_tool_definitions) to O(only_relevant_imports).\n\n### File Tree Structure\n\n```\nproject\u002F\n├── servers\u002F\n│   ├── google-drive\u002F\n│   │   ├── getDocument.ts\n│   │   ├── getSheet.ts\n│   │   └── index.ts          # Re-exports all tools\n│   ├── salesforce\u002F\n│   │   └── index.ts\n│   └── slack\u002F\n│       └── index.ts\n├── skills\u002F                    # Agent-accumulated reusable functions\n├── workspace\u002F                 # Persistent state between executions\n├── client.ts                  # MCP client that routes calls to servers\n└── sandbox.config.ts          # Execution environment configuration\n```\n\nEach MCP tool gets a **typed wrapper** function the agent imports\n(`callMCPTool\u003CT>(\"server__tool\", input)`); the agent writes ordinary code\nagainst those wrappers. See\n[REFERENCE.md → Typed wrapper pattern](REFERENCE.md#typed-wrapper-pattern).\n\n## Key Patterns\n\nSix patterns make this efficient — each with a worked code example in\n[REFERENCE.md → Key patterns](REFERENCE.md#key-patterns):\n\n| Pattern | What it buys |\n|---------|--------------|\n| **Progressive tool discovery** | Navigate `servers\u002F` on demand — ~150K tokens → ~2K (98.7% reduction) |\n| **Context-efficient filtering** | Filter large datasets in the sandbox; only a summary reaches the model |\n| **Native control flow** | Loops\u002Fretries\u002Fconditionals run in the sandbox, not as chained tool calls |\n| **PII tokenization** | The client tokenizes sensitive fields so PII never enters model context |\n| **State persistence** | Save intermediate results to `workspace\u002F` for cross-execution continuity |\n| **Skill accumulation** | Persist reusable functions to `skills\u002F` for future executions |\n\n## Scaffolding a New Project\n\nThe five-step scaffold — identify servers → generate typed wrappers → create the\nrouting client → configure the sandbox → wire the agent loop — is detailed with\ncode in [REFERENCE.md → Scaffolding a new project](REFERENCE.md#scaffolding-a-new-project).\nThe agent loop becomes: explore `servers\u002F` → generate code → execute in sandbox\n→ filtered output returns → decide done or iterate.\n\n## Security Checklist\n\n| Item | Status |\n|------|--------|\n| Sandboxed execution environment | Required |\n| Resource limits (CPU, memory, disk) | Required |\n| Network isolation (MCP servers only) | Required |\n| Execution timeout | Required |\n| PII tokenization in MCP client | Recommended for sensitive data |\n| Audit logging of all executions | Recommended |\n| Read-only access to `servers\u002F` | Recommended |\n| Scoped write access to `workspace\u002F` only | Recommended |\n\n## Quick Reference\n\n### Token Impact\n\n| Approach | Tool definitions | Intermediate data | Total |\n|----------|-----------------|-------------------|-------|\n| Direct tool calls | All loaded upfront | Passes through context | High |\n| Code execution | On-demand discovery | Stays in sandbox | Low |\n\n### When NOT to Use This Pattern\n\n- Simple integrations with 1–3 MCP servers\n- All tool responses are small and needed by the model\n- No sensitive data in tool responses\n- Infrastructure complexity isn't justified (sandbox setup, monitoring)\n- Prototype or proof-of-concept stage\n\n## Reference\n\n- [REFERENCE.md](REFERENCE.md) — typed-wrapper code, key-pattern examples, scaffolding steps\n- [Anthropic Engineering: Code Execution with MCP](https:\u002F\u002Fwww.anthropic.com\u002Fengineering\u002Fcode-execution-with-mcp)\n- [Cloudflare \"Code Mode\"](https:\u002F\u002Fblog.cloudflare.com\u002F) — independent validation of the same pattern\n","# MCP Code Execution Pattern\n\nExpert knowledge for designing agent systems that generate and execute code to interact with MCP servers, instead of calling tools directly.\n\nFor the typed-wrapper code, the six key-pattern examples, and the project\nscaffolding steps, see [REFERENCE.md](REFERENCE.md).\n\n## When to Use This Skill\n\n| Use code execution when... | Use direct tool calls \u002F `mcp-management` when... |\n|----------------------------|--------------------------------------------------|\n| Designing agents that fan out across 10+ MCP servers or 50+ tools | Installing or configuring one or two servers in `.mcp.json` |\n| Intermediate results are large (>10K tokens) and would blow context | Results are small and all needed by the model |\n| Workflows need loops, retries, or conditionals across tool calls | Linear sequences of 2–3 tool calls |\n| PII must not reach the model context | Tool responses contain no sensitive data |\n| Tasks benefit from state persistence across runs | Stateless, one-shot operations |\n| You want agents to accumulate reusable skills | Fixed, predefined workflows |\n\n## Core Architecture\n\n### How It Works\n\nInstead of loading all MCP tool definitions into context upfront, the agent:\n\n1. **Discovers** available tools by navigating a typed file tree\n2. **Generates** TypeScript\u002FPython code that imports and calls typed wrapper functions\n3. **Executes** the code in a sandboxed environment\n4. **Returns** only filtered\u002Fsummarized results to the model\n\nThis reduces token usage from O(all_tool_definitions) to O(only_relevant_imports).\n\n### File Tree Structure\n\n```\nproject\u002F\n├── servers\u002F\n│   ├── google-drive\u002F\n│   │   ├── getDocument.ts\n│   │   ├── getSheet.ts\n│   │   └── index.ts          # Re-exports all tools\n│   ├── salesforce\u002F\n│   │   └── index.ts\n│   └── slack\u002F\n│       └── index.ts\n├── skills\u002F                    # Agent-accumulated reusable functions\n├── workspace\u002F                 # Persistent state between executions\n├── client.ts                  # MCP client that routes calls to servers\n└── sandbox.config.ts          # Execution environment configuration\n```\n\nEach MCP tool gets a **typed wrapper** function the agent imports\n(`callMCPTool\u003CT>(\"server__tool\", input)`); the agent writes ordinary code\nagainst those wrappers. See\n[REFERENCE.md → Typed wrapper pattern](REFERENCE.md#typed-wrapper-pattern).\n\n## Key Patterns\n\nSix patterns make this efficient — each with a worked code example in\n[REFERENCE.md → Key patterns](REFERENCE.md#key-patterns):\n\n| Pattern | What it buys |\n|---------|--------------|\n| **Progressive tool discovery** | Navigate `servers\u002F` on demand — ~150K tokens → ~2K (98.7% reduction) |\n| **Context-efficient filtering** | Filter large datasets in the sandbox; only a summary reaches the model |\n| **Native control flow** | Loops\u002Fretries\u002Fconditionals run in the sandbox, not as chained tool calls |\n| **PII tokenization** | The client tokenizes sensitive fields so PII never enters model context |\n| **State persistence** | Save intermediate results to `workspace\u002F` for cross-execution continuity |\n| **Skill accumulation** | Persist reusable functions to `skills\u002F` for future executions |\n\n## Scaffolding a New Project\n\nThe five-step scaffold — identify servers → generate typed wrappers → create the\nrouting client → configure the sandbox → wire the agent loop — is detailed with\ncode in [REFERENCE.md → Scaffolding a new project](REFERENCE.md#scaffolding-a-new-project).\nThe agent loop becomes: explore `servers\u002F` → generate code → execute in sandbox\n→ filtered output returns → decide done or iterate.\n\n## Security Checklist\n\n| Item | Status |\n|------|--------|\n| Sandboxed execution environment | Required |\n| Resource limits (CPU, memory, disk) | Required |\n| Network isolation (MCP servers only) | Required |\n| Execution timeout | Required |\n| PII tokenization in MCP client | Recommended for sensitive data |\n| Audit logging of all executions | Recommended |\n| Read-only access to `servers\u002F` | Recommended |\n| Scoped write access to `workspace\u002F` only | Recommended |\n\n## Quick Reference\n\n### Token Impact\n\n| Approach | Tool definitions | Intermediate data | Total |\n|----------|-----------------|-------------------|-------|\n| Direct tool calls | All loaded upfront | Passes through context | High |\n| Code execution | On-demand discovery | Stays in sandbox | Low |\n\n### When NOT to Use This Pattern\n\n- Simple integrations with 1–3 MCP servers\n- All tool responses are small and needed by the model\n- No sensitive data in tool responses\n- Infrastructure complexity isn't justified (sandbox setup, monitoring)\n- Prototype or proof-of-concept stage\n\n## Reference\n\n- [REFERENCE.md](REFERENCE.md) — typed-wrapper code, key-pattern examples, scaffolding steps\n- [Anthropic Engineering: Code Execution with MCP](https:\u002F\u002Fwww.anthropic.com\u002Fengineering\u002Fcode-execution-with-mcp)\n- [Cloudflare \"Code Mode\"](https:\u002F\u002Fblog.cloudflare.com\u002F) — independent validation of the same pattern\n",{"name":5,"created":58,"modified":59,"reviewed":60,"description":7,"allowed-tools":61,"user-invocable":54},1770508800000,1785196800000,1781395200000,"Bash, Read, Write, Edit, Grep, Glob, TodoWrite","main","bdd0582f1a2ba53d21061835bfd72d45f2f954f4","agent-patterns-plugin\u002Fskills\u002Fmcp-code-execution",6,"https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins","https:\u002F\u002Fgithub.com\u002Flaurigates","Linux enthusiast, cloud engineer, neovim addict, electronics hobbyist.","2026-11-15 03:36:11",{"source":8,"skillName":5,"commands":71,"prompt":81,"zipAvailable":82},[72,75,78],{"tool":73,"command":74},"npx","npx skills add laurigates\u002Fclaude-plugins --skill mcp-code-execution",{"tool":76,"command":77},"bunx","bunx skills add laurigates\u002Fclaude-plugins --skill mcp-code-execution",{"tool":79,"command":80},"pnpm","pnpm dlx skills add laurigates\u002Fclaude-plugins --skill mcp-code-execution","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fagent-patterns-plugin\u002Fskills\u002Fmcp-code-execution\u002FSKILL.md",true,[84,90,94,98],{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"REFERENCE.md","REFERENCE","参考文档",6134,"https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fagent-patterns-plugin\u002Fskills\u002Fmcp-code-execution\u002FREFERENCE.md",{"path":91,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fagents.md",1958,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Fagents-llamaindex\u002Freferences\u002Fagents.md",{"path":95,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fdata_connectors.md",2307,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Fagents-llamaindex\u002Freferences\u002Fdata_connectors.md",{"path":99,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fquery_engines.md",9905,"https:\u002F\u002Fgithub.com\u002FDicklesworthstone\u002Fpi_agent_rust\u002Fblob\u002Fmain\u002Ftests\u002Fext_conformance\u002Fartifacts\u002Ftemplates-davila7\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Fagents-llamaindex\u002Freferences\u002Fquery_engines.md",[103,111,136,154,170,193],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":110},"01M7DS1CAJ1ESDX08PENF01J0S","session-workflow-capture","Workflow-tool scripts and workflow friction from this session, filed as issues here or in the plugins repo. Use when a session ran Workflow scripts.","https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fsession-plugin\u002Fskills\u002Fsession-workflow-capture\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":120,"publishedAt":53},"01M70PFHMH9ADY0CRE6047Y4B2","kitty-show-image","Show the user an image with a note on what to judge, via a file send or a labelled kitty tab. Use when the user must see an image, or icat fails with no \u002Fdev\u002Ftty.","https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fkitty-plugin\u002Fskills\u002Fkitty-show-image\u002FSKILL.md",[117],{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000016","图像与多媒体",[121,122,123,124,125,126,127,128,129,130,42,36,47,131,132,133,134,135,35,45],"show","kitty show image","image","kitty","show image","ls","get","send","open","dev","file","text","with","xdg","via",{"skillNo":137,"name":138,"nameZh":6,"description":139,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":140,"categories":141,"keywords":142,"publishedAt":53},"01M70PFEN18HKQ4RCQ1VPGMPTB","kitty-session-persistence","Snapshot and restore kitty terminal sessions on macOS. Use when surviving WindowServer hangs without losing tabs, configuring snapshots, or restoring after a force-reboot.","https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fkitty-plugin\u002Fskills\u002Fkitty-session-persistence\u002FSKILL.md",[],[124,143,144,145,40,146,36,47,147,148,149,35,45,44,34,150,151,152,153,42],"kitty session persistence","session","persistence","snapshots","uname","reboot","terminal","snapshot","macos","sessions","restore",{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":160,"publishedAt":53},"01M70PFC77XGXCVQ1543VGZHYR","kitty-remote-control","Safe kitty remote control from an agent — read panes with kitty @ ls\u002Fget-text, notify, and never mutate the live terminal unasked. Use when running inside kitty.","https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fkitty-plugin\u002Fskills\u002Fkitty-remote-control\u002FSKILL.md",[],[161,162,124,163,164,126,165,166,127,167,168,42,36,169,47,132,133,149,35,45],"kitty remote control","remote","control","remote control","running","never","panes","notify","query",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":176,"publishedAt":53},"01M70P6WVMCT5JG4SACTM69AF9","docs-reference-check","Dangling doc-reference gate: flag markdown naming repo paths or relative links that no longer exist. Use when docs cite moved\u002Fdeleted files, or wiring a doc-drift lint.","https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fdocumentation-plugin\u002Fskills\u002Fdocs-reference-check\u002FSKILL.md",[],[177,178,179,180,181,182,183,184,185,186,42,36,47,187,131,188,189,190,191,192],"docs reference check","check","reference check","reference","docs","links","python3","repo","files","auto","drift","lint","wiring","chezmoi","references","cp",{"skillNo":194,"name":195,"nameZh":6,"description":196,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":197,"categories":198,"keywords":204,"publishedAt":53},"01M6C6NDE7DAQGNWSF22J5CJ0Z","youtube-upload","Upload a video to YouTube via the Data API v3 and edit its title, description, tags or thumbnail afterwards. Use when publishing or retitling a YouTube video.","https:\u002F\u002Fgithub.com\u002Flaurigates\u002Fclaude-plugins\u002Fblob\u002Fmain\u002Fyoutube-plugin\u002Fskills\u002Fyoutube-upload\u002FSKILL.md",[199,202,203],{"categoryNo":200,"categoryName":201,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[205,206,207,208,183,209,45,210,34,211,50,212,42,47,131,213,214,36,215,216,217,135,35],"youtube upload","upload","youtube","Video","run","uv run","publishing","uv","api","v3","tags","id","title"]