1.3 KiB
Issues
PDF Reader MCP Connection Issue
Status: Resolved
Reported: 2026-02-04
Resolved: 2026-02-05
Issue: The pdf-reader-mcp is in the path, I have enabled it, but it still says connection closed.
Details:
- Package is installed and available in PATH
- MCP server has been enabled in configuration
- Connection still fails with "connection closed" error
Root Cause:
The package used an npx wrapper that fetched @sylphx/pdf-reader-mcp from the npm registry at
runtime. On first invocation npx needs to download and cache the package before the server process
starts, causing the MCP client to time out and close the connection before the server was ready to
respond to the initial handshake. The pinned version (2.2.0) was also outdated.
Fix:
Rewrote packages/pdf-reader-mcp/package.nix to use buildNpmPackage, following the same pattern
used by claude-code in nixpkgs. The npm tarball (v2.3.0) is fetched at build time via fetchzip,
a package-lock.json is provided for reproducible dependency resolution, and dontNpmBuild = true
skips the build step because dist/ is already included in the published tarball. The resulting
binary starts instantly with no network dependency at runtime.