Skip to content

v0.2.1 — stdio environment inheritance fix

Latest

Choose a tag to compare

@StanleyChanH StanleyChanH released this 20 Jul 04:57

Patch release — fixes a stdio environment-inheritance bug that silently dropped app-specific variables from spawned MCP servers.

Fixed

  • stdio transport now always inherits the full parent environment (os.environ) for spawned MCP servers.

    Previously, when a server had no env block, env=None was passed to the SDK's StdioServerParameters. The SDK does not inherit os.environ in that case — it substitutes a small whitelist default (DEFAULT_INHERITED_ENV_VARS: PATH, HOME, …), silently dropping every other variable the parent process had set. App-specific vars like BABY_*, API keys, config paths, etc. never reached the child MCP server.

    The if server.env guard is removed; os.environ is now always passed, with any server-specific env overrides layered on top. If you worked around this with a _INHERIT_PARENT_ENV-style marker in your own project, you can drop it after upgrading.

Upgrade

uv add "mcp2xiaozhi>=0.2.1"
# or
pip install -U mcp2xiaozhi

Full Changelog: v0.2.0...v0.2.1