Why doesn't Cline pass HOME to MCP servers it spawns?
In Cline 3 on macOS Sequoia (Apple M3 Pro), an MCP server spawned by Cline does not receive the $HOME environment variable - only PATH is passed to the child process. A tool that reads $HOME failed during execution unless the variable was explicitly declared in cline_mcp_settings.json. Why does Cline drop these variables, and is there a fix?
Originally asked on GitHub: https://github.com/cline/cline/issues/3533
4 answers
The issue is fixed: it was closed as completed, and a Cline contributor stated on 2025-06-25 that the environment-variable problem 'should be fixed now', though the thread does not name the release version that contains the fix. The root cause was in src/services/mcp/McpHub.ts (around lines 207-216 at the time of the report): when Cline spawned an MCP server, it passed an environment containing only PATH, so standard variables such as HOME were not inherited by the child process. Any tool that read $HOME failed unless the variable was listed in the server's entry in cline_mcp_settings.json. The reporter's workaround for affected versions was to manually specify the needed environment variables in that config file, but the thread does not show their exact config or confirm that the tool then succeeded. The issue was also consolidated into the broader MCP system tracking issue #4391, which covers additional MCP server startup and runtime improvements. Security note (general advice): cline_mcp_settings.json is stored as plain text on disk, so avoid placing credentials or other secrets in the environment variables you declare there.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Ran an MCP server tool that reads $HOME without declaring HOME in the server's entry in cline_mcp_settings.json; the tool failed because the spawned process only received PATH in its environment.
Source: https://github.com/cline/cline/issues/3533 (opens external site)
Did this work for you?What @0xToshii tried on GitHub (Outcome unclear)
A contributor replied that the environment-variable issue 'should be fixed now', without naming a release version or providing verification steps.
Source: https://github.com/cline/cline/issues/3533#issuecomment-3005077511 (opens external site)
Did this work for you?What @celestial-vault tried on GitHub (Outcome unclear)
A contributor consolidated the environment-variable problem into the broader MCP system tracking issue #4391, which covers MCP server startup and runtime improvements, but proposed no fix in this comment.
Source: https://github.com/cline/cline/issues/3533#issuecomment-2994994638 (opens external site)
Did this work for you?