::: MCPStack.core.mcp_config_generator.mcp_config_generators.docker_mcp_config.DockerMCPConfigGenerator options: show_root_heading: true show_source: true
The DockerMCP Config Generator provides unified Docker containerization functionality for MCPStack pipelines. It can:
- Generate configuration files for running MCPStack tools inside Docker containers (Claude Desktop integration)
- Generate Dockerfiles from MCPStack pipeline configurations
- Build Docker images automatically during configuration generation
- Push images to Docker registries
- Support complex configuration including volumes, ports, networks, and build arguments
config = DockerMCPConfigGenerator.generate(
stack=mcp_stack,
image_name="mcpstack:myapp"
)config = DockerMCPConfigGenerator.generate(
stack=mcp_stack,
image_name="myapp:latest",
build_image="myapp:latest", # Build the image
generate_dockerfile=True, # Generate Dockerfile
docker_push=True, # Push to registry
docker_registry_url="docker.io/username/"
)The generator integrates with the unified MCPStack CLI through workflow profiles:
# Generate Docker config only (basic usage)
mcpstack build --config-type docker --presets my_preset
# Generate config, dockerfile, build and push (production pipeline)
mcpstack build --config-type docker --presets my_preset --profile build-and-push
# Generate config, dockerfile, and build locally (development)
mcpstack build --config-type docker --presets my_preset --profile build-onlystack: MCPStackCore instanceimage_name: Docker image name to use in configurationsserver_name: Name for the MCP server in Claude configvolumes: Volume mounts for Docker containerports: Port mappings for Docker containernetwork: Docker network name
build_image: Image name to build (triggers Docker build)generate_dockerfile: Generate Dockerfile when Truedockerfile_path: Custom path for generated Dockerfiledocker_push: Push built image to registrydocker_registry_url: Docker registry URLbuild_args: Dictionary of Docker build arguments
The DockerMCP Config Generator is automatically available through the MCP config generators registry:
from MCPStack.core.mcp_config_generator.registry import ALL_MCP_CONFIG_GENERATORS
# The DockerMCP generator is registered as 'docker'
generator = ALL_MCP_CONFIG_GENERATORS['docker']
config = generator.generate(stack, build_image="myimage:latest")