fix(mcp): use wrapper scripts instead of venv symlinks #217
Reference in New Issue
Block a user
Delete Branch "fix/mcp-venv-wrapper-scripts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
.mcp.jsonwithrun.shwrapper scripts~/.cache/claude-mcp-venvs/) or local.venvProblem
.venvsymlinks are gitignored (**/.venvin.gitignore), causing them to be deleted on every git operation (pull, update, reset). The SessionStart hook should recreate them but this was unreliable, leading to repeated MCP server failures.Solution
run.shwrapper scripts that:~/.cache/claude-mcp-venvs/leo-claude-mktplace/{server}/.venv.venvif existsThe scripts are tracked in git and will always be present after clone/pull/update.
Test plan
run.sh🤖 Generated with Claude Code
Replace direct python path in .mcp.json with run.sh wrapper scripts that automatically locate the venv in cache or local directory. Problem: .venv symlinks are gitignored, causing them to be wiped on every git operation. The SessionStart hook should recreate them but this was unreliable, leading to repeated MCP server failures. Solution: run.sh scripts that: - First check ~/.cache/claude-mcp-venvs/leo-claude-mktplace/{server}/.venv - Fallback to local .venv if exists - Exit with helpful error if neither found This eliminates dependency on symlinks entirely - the scripts are tracked in git and will always be present after clone/pull/update. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>