Bug: envs block in stdio extension config not passed to subprocess
Description
Environment variables defined in the envs block of a stdio extension config are not being
passed to the spawned subprocess. The subprocess falls back to its own defaults instead.
Steps to Reproduce
- Configure a stdio extension in
~/.config/goose/config.yaml with an envs block:
extensions:
my-extension:
enabled: true
type: stdio
cmd: /path/to/binary
args:
- serve
envs:
MY_ENV_VAR: some-value
- Launch goose and use the extension
- The subprocess does not receive
MY_ENV_VAR — it uses its default value instead
Workarounds Attempted
- Setting vars via
~/.zshrc — doesn't work (goose launched as app doesn't inherit shell env)
- Setting vars via
launchctl setenv — doesn't work
- Using
cmd: env with vars as args — still not working
Expected Behavior
Environment variables in the envs block should be forwarded to the stdio subprocess on launch.
Actual Behavior
Subprocess receives no env vars and falls back to defaults (e.g. localhost:3000 instead of
the configured URL).
Environment
- goose version: (run
goose --version)
- OS: macOS
- Extension: mcp-grafana (but reproducible with any stdio extension)
Impact
Makes it impossible to configure stdio extensions that require env vars (e.g. API keys, URLs)
without workarounds. This affects any MCP server that reads configuration from environment
variables, which is the standard pattern.
Bug:
envsblock in stdio extension config not passed to subprocessDescription
Environment variables defined in the
envsblock of a stdio extension config are not beingpassed to the spawned subprocess. The subprocess falls back to its own defaults instead.
Steps to Reproduce
~/.config/goose/config.yamlwith anenvsblock:MY_ENV_VAR— it uses its default value insteadWorkarounds Attempted
~/.zshrc— doesn't work (goose launched as app doesn't inherit shell env)launchctl setenv— doesn't workcmd: envwith vars as args — still not workingExpected Behavior
Environment variables in the
envsblock should be forwarded to the stdio subprocess on launch.Actual Behavior
Subprocess receives no env vars and falls back to defaults (e.g.
localhost:3000instead ofthe configured URL).
Environment
goose --version)Impact
Makes it impossible to configure stdio extensions that require env vars (e.g. API keys, URLs)
without workarounds. This affects any MCP server that reads configuration from environment
variables, which is the standard pattern.