SamuraiBuddha/claude-code-docker-mcp
If you are the rightful owner of claude-code-docker-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Model Context Protocol (MCP) server is designed to facilitate distributed AI agent architectures, enabling significant amplification of AI capabilities through systematic infrastructure.
Claude Code Docker MCP
š Distributed AI Agent Architecture for 10000x Amplification
A containerized Claude Code environment with MCP (Model Context Protocol) server integration. This project enables systematic infrastructure for distributed AI agents working in parallel coordination.
šÆ Philosophy
"Careful architecture beats rushed implementation" - Jordan Ehrig
This project embodies systematic infrastructure development, preventing technical debt while enabling genuine productivity amplification through specialized AI coordination.
šļø Architecture Overview
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā CLAUDE (MELCHIOR) ā
ā āāāāāāāāāāāāāāāāāāā ā
ā ā MCP Tools ā ā
ā ā Ecosystem ā ā
ā āāāāāāāāāāā¬āāāāāāāā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā
āāāāāāāāāāā“āāāāāāāāāāāā
ā Claude Code MCP ā
ā (This Project) ā
āāāāāāāāāāā¬āāāāāāāāāāāā
ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā DOCKER CONTAINER ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā MCP SERVER ā ā ā
ā ā ā¼ ā ā
ā ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā
ā ā ā CLAUDE CODE ENGINE ā ā ā
ā ā ā ā ā ā
ā ā ā ⢠Project Analysis ā ā ā
ā ā ā ⢠Multi-file Implementation ā ā ā
ā ā ā ⢠Recursive Debugging ā ā ā
ā ā ā ⢠Comprehensive Refactoring ā ā ā
ā ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā ā
ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā ā
ā Mounted Volumes: /workspace -> Host Project Directories ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā” Amplification Architecture
Current Workflow Evolution
L1 (10x): Memory ā Sequential ā Store
L2 (100x): Memory ā Sequential ā Sandbox ā Store
L3 (1000x): Memory ā Sequential ā (Parallel: Sandbox + LocalLLM) ā Store
L4 (10000x): Memory ā Sequential ā (Parallel: Sandbox + LocalLLM + ClaudeCode) ā Store
Agent Specialization
- MELCHIOR (Claude): Conductor & Architect - Planning, coordination, high-level decisions
- CLAUDE CODE: Coding Specialist - Project-wide context, recursive resolution, comprehensive implementation
- LOCAL LLM: Research Sidekick - Domain knowledge, parallel analysis, validation
- SANDBOXES: Computation Engine - Heavy processing, testing, data analysis
š Quick Start
Prerequisites
- Docker & Docker Compose
- Anthropic API key
- Windows with Docker Desktop (Claude Code requires Linux container)
Installation
-
Clone the repository
git clone https://github.com/SamuraiBuddha/claude-code-docker-mcp.git cd claude-code-docker-mcp
-
Configure environment
cp .env.template .env # Edit .env and add your ANTHROPIC_API_KEY
-
Create project directories
mkdir -p projects logs
-
Build and start
docker-compose build docker-compose up -d
-
Verify installation
curl http://localhost:3001/health
š API Endpoints
Health Check
GET /health
# Returns: server status, uptime, active tasks
Project Analysis
POST /claude-code/analyze
{
"project_path": "my-project",
"analysis_type": "structure|health|dependencies|issues"
}
Task Execution
POST /claude-code/execute
{
"task_description": "Add error handling to main file",
"project_path": "my-project",
"context": "Express.js application with TypeScript",
"priority": "medium"
}
Status Check
GET /claude-code/status
# Returns: Claude Code version, task summary, system health
Task Monitoring
GET /claude-code/task/:taskId
# Returns: detailed task status and results
š”ļø Security Features
- Container Security: Non-root user, limited capabilities, resource limits
- API Security: Rate limiting, input validation, CORS policies, security headers
- Secret Management: Environment-based configuration, no secrets in images
- Network Security: Localhost binding, isolated container networking
š Project Structure
claude-code-docker-mcp/
āāā .env.template # Environment configuration template
āāā .gitignore # Comprehensive exclusions (secrets, logs, etc.)
āāā secrets.md # Secret management protocols
āāā SECURITY.md # Security policy and incident response
āāā Dockerfile # Multi-stage container build
āāā docker-compose.yml # Service orchestration with security
āāā src/
ā āāā mcp-server.js # Main MCP server implementation
ā āāā health-check.js # Container health monitoring
ā āāā package.json # Node.js dependencies
āāā projects/ # Mount point for project access
āāā logs/ # Container logs
āāā README.md # This file
š§ Configuration
Environment Variables
Variable | Default | Description |
---|---|---|
ANTHROPIC_API_KEY | required | Your Anthropic API key |
MCP_PORT | 3001 | MCP server port |
MCP_HOST | 127.0.0.1 | Bind address (localhost only) |
CLAUDE_CODE_LOG_LEVEL | info | Logging verbosity |
CLAUDE_CODE_TIMEOUT | 300000 | Task timeout in milliseconds |
CONTAINER_MEMORY_LIMIT | 2g | Docker memory limit |
CONTAINER_CPU_LIMIT | 1.0 | Docker CPU limit |
Volume Mounts
./projects:/workspace/projects:rw
- Project file access./logs:/workspace/logs:rw
- Container logs
š Usage Examples
Analyze Project Structure
curl -X POST http://localhost:3001/claude-code/analyze \
-H "Content-Type: application/json" \
-d '{
"project_path": "my-webapp",
"analysis_type": "structure"
}'
Implement Feature
curl -X POST http://localhost:3001/claude-code/execute \
-H "Content-Type: application/json" \
-d '{
"task_description": "Add user authentication with JWT tokens",
"project_path": "my-webapp",
"context": "Express.js REST API with MongoDB",
"priority": "high"
}'
Debug Issues
curl -X POST http://localhost:3001/claude-code/execute \
-H "Content-Type: application/json" \
-d '{
"task_description": "Fix memory leak in user session management",
"project_path": "my-webapp",
"context": "Memory usage increases over time, suspect session storage",
"priority": "critical"
}'
š Monitoring
Health Checks
- Docker health check every 30 seconds
- HTTP endpoint monitoring
- Claude Code binary verification
- Resource usage tracking
Logging
- Structured JSON logging
- Request/response tracking
- Claude Code execution logs
- Error handling and reporting
š Development Phases
ā Phase 1: Proof of Concept
- Basic Dockerfile with Claude Code installation
- Container startup and health verification
- Simple command execution test
- Volume mounting validation
ā Phase 2: Basic MCP Server
- MCP server framework implementation
- Health check and status endpoints
- Basic error handling and logging
- Container networking configuration
ā Phase 3: Core Functionality
-
claude_code_analyze
function implementation -
claude_code_execute
function implementation - Request validation and sanitization
- Comprehensive error handling
šÆ Phase 4: Integration Testing
- Integration with existing MCP ecosystem
- Real project testing scenarios
- Performance benchmarking
- Tool chain validation
šÆ Phase 5: Production Hardening
- Security audit and hardening
- Resource optimization
- Monitoring and alerting
- Documentation and runbooks
š¤ Contributing
Contributions are welcome! Please read our security policy and follow the systematic development approach:
- Fork the repository
- Create a feature branch
- Test thoroughly in isolation
- Submit pull request with detailed description
š License
MIT License - see LICENSE file for details.
š Support
- Issues: GitHub Issues
- Security: See SECURITY.md for vulnerability reporting
- Documentation: Check the
/docs
directory for detailed guides
š Related Projects
- CORTEX-AI-Orchestrator-v2 - n8n-based AI orchestration
- tool-combo-chains - Memory Ć Sequential Ć Sandbox architecture
šÆ Ready to unlock 10000x amplification through distributed AI coordination! š
Built with systematic infrastructure principles by Jordan Ehrig for the MAGI distributed AI architecture.