Add configurable stdio container runtime (Docker/Podman) with runtime command overrides - #10003
Conversation
There was a problem hiding this comment.
Pull request overview
Adds configurable Docker/Podman runtime support while preserving stdio transport.
Changes:
- Adds runtime selection, command overrides, and runtime arguments.
- Updates TOML validation and launcher classification.
- Adds tests, schema fields, and operator documentation.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents runtime environment override. |
internal/launcher/launcher.go |
Classifies container runtime launches. |
internal/launcher/launcher_runtime_test.go |
Tests runtime classification. |
internal/config/validation_test.go |
Tests Podman TOML validation. |
internal/config/validation_gateway.go |
Validates selected runtime commands. |
internal/config/schema/mcp-gateway-config.schema.json |
Defines JSON runtime settings. |
internal/config/container_runtime.go |
Resolves runtime configuration. |
internal/config/config_stdin.go |
Builds runtime-specific stdio commands. |
internal/config/config_stdin_test.go |
Tests runtime selection and overrides. |
internal/config/config_core.go |
Adds core runtime fields and defaults. |
docs/ENVIRONMENT_VARIABLES.md |
Documents the environment override. |
docs/CONFIGURATION.md |
Documents configuration and Podman prerequisites. |
config.example.toml |
Adds runtime configuration examples. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 13/13 changed files
- Comments generated: 4
- Review effort level: Medium
| func validateContainerRuntimeValue(value, fieldName string) error { | ||
| switch normalizeContainerRuntime(value) { | ||
| case "", containerRuntimeDocker, containerRuntimePodman: | ||
| return nil | ||
| default: | ||
| return fmt.Errorf("%s must be one of: docker, podman (got: %q)", fieldName, value) | ||
| } | ||
| } |
| if len(args) > 0 && strings.EqualFold(args[0], "run") { | ||
| return false |
| func validateTOMLStdioContainerization(servers map[string]*ServerConfig) error { | ||
| func validateTOMLStdioContainerization(servers map[string]*ServerConfig, gateway *GatewayConfig) error { | ||
| logValidation.Print("Validating TOML stdio server containerization requirement") | ||
| expectedCommand := effectiveContainerRuntimeCommand(gateway) |
| # Optional: Runtime-level args inserted before "run" for stdio container launches | ||
| # container_runtime_args = [] |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback and also make sure that podman is installed in the mcpg container image |
Addressed in this PR update (latest commit |
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS References: §30121486918
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Full ReportPart A — MCP Reads (ALLOWED ✅)
Part B — MCP Writes (BLOCKED ✅) Gateway exposes 22 read-only tools only. Write tools are filtered at the gateway level. All write attempts returned
Part C — CLI Reads (ALLOWED ✅)
Part D — CLI REST Writes (BLOCKED ✅) All REST write calls rejected — Part E — GraphQL Mutations (BLOCKED ✅) All GraphQL mutation attempts rejected — Result: References: §30121487008
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §30121486968
|
This change removes the hard Docker-daemon assumption for stdio MCP server launches by introducing runtime selection (
docker/podman) and runtime-command overrides, while preserving the existing stdio parent/child transport model. Default behavior remains Docker-compatible for existing deployments.Runtime selection for stdio container launches
gateway.containerRuntime(dockerdefault,podmansupported)gateway.containerRuntimeCommand(override binary/path, e.g.nerdctl,/usr/bin/podman)gateway.containerRuntimeArgs(prepended runtime-level args beforerun)MCP_GATEWAY_CONTAINER_RUNTIME(validated; invalid values are ignored in favor of configured/default runtime).JSON stdin conversion path (
containerservers)docker.<runtime> [runtimeArgs...] run --rm -i ... <image> ..., preserving stdio-only MCP transport and non-networked child process semantics.TOML stdio containerization validation
commandmatches the selected effective runtime command (instead of always requiring"docker").Launcher direct-command classification
docker/podman/nerdctl/usr/local/bin/podman)run.Documentation updates
{ "gateway": { "containerRuntime": "podman", "containerRuntimeCommand": "/usr/bin/podman", "containerRuntimeArgs": ["--events-backend=file"] }, "mcpServers": { "github": { "type": "stdio", "container": "ghcr.io/github/github-mcp-server:latest" } } }