From 81c7f99174c6039b5eb514846e1e55055e24cbad Mon Sep 17 00:00:00 2001 From: Luis Eduardo Bueso de Barrio Date: Thu, 1 Oct 2026 16:44:32 +0200 Subject: [PATCH] msg --- packages/zotero-mcp/package.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/zotero-mcp/package.nix b/packages/zotero-mcp/package.nix index e3aa5e3..7e46a35 100644 --- a/packages/zotero-mcp/package.nix +++ b/packages/zotero-mcp/package.nix @@ -104,6 +104,21 @@ python3Packages.buildPythonApplication rec { tiktoken ]; + # `zotero_get_pdf_outline` reads a PDF's table of contents in a throwaway + # `sys.executable -c ...` child (tools/write.py, _extract_pdf_toc). Under the + # Nix wrapper this package's dependencies are injected into the *parent* + # interpreter via site.addsitedir, never exported as PYTHONPATH, so the child + # gets a bare sys.path and its `import pymupdf` fails. The tool then reports + # "PyMuPDF (fitz) is required..." even though PyMuPDF is a build input. + # Forward the parent's sys.path so the child resolves the same modules. + # Mirrors nixpkgs' python-modules/vllm/0003-propagate-pythonpath.patch. + postPatch = '' + substituteInPlace src/zotero_mcp/tools/write.py \ + --replace-fail \ + 'child_env.setdefault("PYTHONUTF8", "1")' \ + 'child_env.setdefault("PYTHONUTF8", "1"); child_env["PYTHONPATH"] = os.pathsep.join(p for p in sys.path if p)' + ''; + pythonImportsCheck = [ "zotero_mcp" ]; meta = with lib; {