mcp-code-execution/
├── 📄 Core Plugin Files
│ ├── plugin.json # Plugin manifest (Claude Code compatible)
│ ├── README.md # Getting started & usage guide
│ ├── CLAUDE.md # Developer guidelines & patterns
│ ├── CHANGELOG.md # Version history
│ ├── LICENSE # MIT License
│ └── STRUCTURE.md # This file
│
├── 🔌 Plugin Implementation (plugin/)
│ ├── commands/ # Slash commands
│ │ ├── setupMCP.ts # Initialize workspace
│ │ ├── generateWrappers.ts # Generate MCP wrappers
│ │ ├── listSkills.ts # List registered skills
│ │ ├── createSkill.ts # Create new skill
│ │ └── validateConfig.ts # Validate MCP config
│ │
│ ├── agents/ # Autonomous agents
│ │ └── taskExecutor.ts # Execute token-efficient tasks
│ │
│ ├── hooks/ # Lifecycle hooks
│ │ ├── onTaskStart.ts # Before task execution
│ │ ├── onTaskComplete.ts # After task execution
│ │ └── onError.ts # Error handling
│ │
│ └── config/
│ └── default-config.json # Default plugin configuration
│
├── 🔧 Client Libraries (client/)
│ ├── python.py # Python MCP client
│ ├── typescript.ts # TypeScript MCP client
│ ├── retry.py # Retry logic with exponential backoff
│ ├── security.py # Security policies & validation
│ └── monitoring.py # Performance metrics & logging
│
├── 🎯 Reusable Skills (skills/)
│ ├── python/
│ │ ├── __init__.py
│ │ ├── extract_action_items.py # Extract ACTION:/TODO: items
│ │ └── example_data_filter.py # Filter large datasets
│ │
│ └── typescript/
│ └── exampleDataFilter.ts # Data filtering (TypeScript)
│
├── 📦 Auto-Generated Server Wrappers (servers/)
│ ├── python/
│ │ ├── {server_name}/
│ │ │ ├── __init__.py
│ │ │ └── {tool_name}.py # Wrapper for each tool
│ │ └── ...
│ │
│ └── typescript/
│ ├── {serverName}/
│ │ ├── index.ts
│ │ └── {toolName}.ts # Wrapper for each tool
│ └── ...
│
├── 📂 Runtime Directory (workspace/)
│ └── ... # Code execution sandbox
│
└── ⚙️ Configuration & Setup
├── mcp_config.json # MCP server configuration
├── pyproject.toml # Python project (uv)
├── package.json # TypeScript project (bun)
├── tsconfig.json # TypeScript compiler config
├── setup_mcp.py # Python setup script
└── setup.ts # TypeScript setup script
Single source of truth for plugin manifest. Defines:
- Commands:
/setup-mcp,/generate-wrappers,/list-skills,/create-skill,/validate-config - Agents: MCP task executor for automated execution
- Hooks: Lifecycle management (task start, complete, error)
- Skills: Registered reusable patterns
- Configuration: Plugin settings with defaults
- Capabilities: Code execution, file system, monitoring
MCP server configuration (not plugin config):
{
"mcpServers": {
"google-drive": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-gdrive"],
"env": { "GDRIVE_CLIENT_ID": "..." }
}
}
}Plugin configuration defaults (can be overridden by users):
workspaceDirectory: Sandbox directory for executionmaxRetries: Retry policy for failed tool callsrequestTimeoutMs: Request timeoutenableMetrics: Performance monitoringenableSecurityPolicies: Security enforcementrateLimitCallsPerMinute: Rate limiting per serverautoSkillDiscovery: Auto-register new skills
- Creates workspace directory
- Initializes mcp_config.json
- Sets up default configuration
- Edits mcp_config.json
- Adds servers and credentials
- Runs
/validate-configto test
- Reads MCP server definitions
- Generates Python modules in
servers/python/{server_name}/ - Generates TypeScript modules in
servers/typescript/{serverName}/ - Creates
__init__.py/index.tswith exports
# Python task
from servers.python.google_drive import get_document
from skills.python.extract_action_items import extract_action_items
doc = await get_document(document_id='xyz')
items = extract_action_items(doc['content'])- Data processed in-environment
- Only summary returned to Claude
- Token efficiency: 95-99% reduction
- After successful task, run
/create-skill - Claude registers pattern for reuse
- Future tasks use proven implementations
- Communicates with MCP servers via stdio
- Async/await support
- Type hints for IDE support
- Integrates with retry.py, security.py, monitoring.py
- MCP SDK integration
- Type-safe tool calls
- Connection pooling
- Streaming support
- Workspace Isolation: File access limited to
workspace/directory - Network Restriction: Only configured MCP servers
- Rate Limiting: Configurable per-server limits
- Input Validation: Security policies in
client/security.py - Monitoring: Performance metrics and error tracking
- Create
plugin/commands/myCommand.ts - Add to
plugin.jsoncommands array - Implement command handler
- Solve a task successfully
- Run
/create-skillto register pattern - Or manually create in
skills/python/orskills/typescript/
- Install server:
npm install @modelcontextprotocol/server-name - Add to
mcp_config.json - Run
/generate-wrappersto create wrappers
- Progressive Loading: Import only needed tools
- Local Processing: Filter/aggregate data in-environment
- Summarize Results: Return only summary to context
- Build Skills: Save proven patterns as reusable skills
- Monitor Metrics: Check token usage and performance
See CLAUDE.md for detailed development guidelines.