ADR-037: External Plugin STDIO Launch with Command/Env OverridesΒΆ
- Status: Accepted
- Date: 2026-01-28
- Deciders: Platform Team
ContextΒΆ
External plugins can run over MCP using HTTP or STDIO. STDIO is the easiest way to run an external MCP server without additional infrastructure, but the previous configuration only allowed a script path (with a .py restriction). This made it hard to:
- Run non-Python MCP servers (Go, Rust, Node, etc.).
- Provide per-plugin environment variables (e.g.,
PLUGINS_CONFIG_PATH) without wrapper scripts. - Set a working directory for plugin servers started by the gateway.
These gaps limited deployment flexibility and made isolated plugin execution less ergonomic.
DecisionΒΆ
We extend external plugin MCP configuration with STDIO process options:
cmd: a command array (["command", "arg1", ...]) for starting an MCP server.env: environment variable overrides for the STDIO server process.cwd: working directory for the STDIO server process.
The gateway resolves STDIO launch as follows:
- If
cmdis provided, use it as the command + args. -
Otherwise, use
script: -
.pyruns viapython. .shruns viash.- Executables run directly.
Validation enforces transport-specific fields:
urlis only allowed for HTTP/SSE.script,cmd,env, andcwdare only allowed for STDIO.scriptandcmdare mutually exclusive.
This keeps STDIO isolation easy while preserving existing behavior for HTTP-based external plugins.
ConsequencesΒΆ
-
Pros:
-
Run any MCP server (any language) with STDIO, no wrapper scripts required.
- Per-plugin env and working directory are supported.
-
Backward compatible with existing
scriptusage. -
Cons:
-
Larger configuration surface area.
- More responsibility on operators to manage environment/cwd security and correctness.
Alternatives ConsideredΒΆ
- Require wrapper scripts for env/cwd: simpler code, but less ergonomic and more brittle.
- Add only
cmdwithoutenv/cwd: improves language support but still requires wrapper scripts for config. - Require HTTP transport for external plugins: increases operational complexity and infrastructure burden.