Skip to content

fix: pass Windows APPDATA/LOCALAPPDATA into MCP stdio child env #598

Description

Description

Stdio MCP subprocesses spawned by OpenWiki receive a tightly allowlisted environment (buildChildEnv in src/connectors/mcp-client.ts). The list includes USERPROFILE / HOMEPATH / HOMEDRIVE but not APPDATA or LOCALAPPDATA.

Many Windows MCP servers and Node tools expect those variables to resolve config, cache, and native dependency paths under the user profile. Without them, local MCP connectors can fail to start or misbehave only on Windows even though PATH and home vars are present.

Expected Behavior

buildChildEnv forwards APPDATA and LOCALAPPDATA when set in the parent process (same treatment as USERPROFILE), without forwarding OpenWiki provider credentials.

Actual Behavior

Those two variables are dropped from the child environment.

Proposed fix

Add APPDATA and LOCALAPPDATA to CHILD_ENV_ALLOWLIST and cover them in test/mcp-client.test.ts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions