fix: set cwd to homedir when spawning chroma-mcp to prevent pydantic .env.local crash (#1297)
chroma-mcp uses pydantic-settings which auto-reads .env/.env.local from the CWD. When the project directory contains non-chroma variables (e.g. CELERY_TASK_ALWAYS_EAGER), pydantic rejects them with "Extra inputs are not permitted", crashing the subprocess and triggering a permanent backoff loop. Passing cwd: os.homedir() to StdioClientTransport ensures pydantic never reads project env files. Generated by Claude Code Vibe coded by ousamabenyounes Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -116,10 +116,16 @@ export class ChromaMcpManager {
|
||||
args: uvxSpawnArgs.join(' ')
|
||||
});
|
||||
|
||||
// Run chroma-mcp from the home directory so that pydantic-settings (used
|
||||
// by chroma-mcp internally) does not pick up .env / .env.local files from
|
||||
// the project directory. Those files often contain project-specific vars
|
||||
// that pydantic rejects with "Extra inputs are not permitted", crashing the
|
||||
// subprocess immediately. Fixes #1297.
|
||||
this.transport = new StdioClientTransport({
|
||||
command: uvxSpawnCommand,
|
||||
args: uvxSpawnArgs,
|
||||
env: spawnEnvironment,
|
||||
cwd: os.homedir(),
|
||||
stderr: 'pipe'
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user