Fix PYTHONPATH contamination causing nextcloud-mcp-server to crash on startup with C extension ABI mismatches.
Problem
The Nix-built binary works perfectly in a clean environment, but when launched by Hermes Agent (which inherits the system's PYTHONPATH from the mautrix Matrix bridge and other Python 3.12 services), the Python 3.13 wrapper picks up Python 3.12 site-packages. This causes:
ImportError: cannot import name '_imaging' from 'PIL'
(/nix/store/...-python3.12-pillow-12.2.0/lib/python3.12/site-packages/PIL/__init__.py)
The root cause: Python 3.13 can't load C extensions compiled for Python 3.12.
Fix
Add makeWrapperArgs = [ "--unset" "PYTHONPATH" ] to the derivation. The wrapper already has the full correct closure in its own sys.path — the external PYTHONPATH provides nothing useful and only causes breakage.
Test Plan
nix build .#nextcloud-mcp-server succeeds
./result/bin/nextcloud-mcp-server run --transport stdio --help works
MCP server starts correctly when launched by Hermes Agent
## Summary
Fix PYTHONPATH contamination causing `nextcloud-mcp-server` to crash on startup with C extension ABI mismatches.
## Problem
The Nix-built binary works perfectly in a clean environment, but when launched by Hermes Agent (which inherits the system's PYTHONPATH from the mautrix Matrix bridge and other Python 3.12 services), the Python 3.13 wrapper picks up Python 3.12 site-packages. This causes:
```
ImportError: cannot import name '_imaging' from 'PIL'
(/nix/store/...-python3.12-pillow-12.2.0/lib/python3.12/site-packages/PIL/__init__.py)
```
The root cause: Python 3.13 can't load C extensions compiled for Python 3.12.
## Fix
Add `makeWrapperArgs = [ "--unset" "PYTHONPATH" ]` to the derivation. The wrapper already has the full correct closure in its own `sys.path` — the external PYTHONPATH provides nothing useful and only causes breakage.
## Test Plan
- [ ] `nix build .#nextcloud-mcp-server` succeeds
- [ ] `./result/bin/nextcloud-mcp-server run --transport stdio --help` works
- [ ] MCP server starts correctly when launched by Hermes Agent
Prevents Python 3.12 site-packages (from host env like mautrix bridge) from contaminating the Python 3.13 wrapper, causing C extension ABI mismatches (e.g. PIL._imaging).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Fix PYTHONPATH contamination causing
nextcloud-mcp-serverto crash on startup with C extension ABI mismatches.Problem
The Nix-built binary works perfectly in a clean environment, but when launched by Hermes Agent (which inherits the system's PYTHONPATH from the mautrix Matrix bridge and other Python 3.12 services), the Python 3.13 wrapper picks up Python 3.12 site-packages. This causes:
The root cause: Python 3.13 can't load C extensions compiled for Python 3.12.
Fix
Add
makeWrapperArgs = [ "--unset" "PYTHONPATH" ]to the derivation. The wrapper already has the full correct closure in its ownsys.path— the external PYTHONPATH provides nothing useful and only causes breakage.Test Plan
nix build .#nextcloud-mcp-serversucceeds./result/bin/nextcloud-mcp-server run --transport stdio --helpworksPull request closed