MCP Client Setup Guide

All clients below connect over stdio to the same 10-tool server (Schema v4.0.0) on Node.js 22 or 24. Replace /path/to/pdfs with the directory your agent is allowed to read.

Generate a snippet directly from the CLI
npx -y pdf-decompiler setup --client claude-code --allow-root ./pdfs
npx -y pdf-decompiler setup --client codex --allow-root ./pdfs
npx -y pdf-decompiler setup --client claude-desktop --allow-root ./pdfs
npx -y pdf-decompiler setup --client vscode --allow-root ./pdfs
npx -y pdf-decompiler setup --client cursor --allow-root ./pdfs

Copy-paste configurations by client

Select your MCP host below. Each configuration launches pdf-decompiler mcp over stdio with workspace root confinement.

Claude Code

bash
claude mcp add pdf-decompiler -- npx -y pdf-decompiler mcp --allow-root /path/to/pdfs

Claude Desktop

Config path: %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (macOS).

claude_desktop_config.json
{
  "mcpServers": {
    "pdf-decompiler": {
      "command": "npx",
      "args": ["-y", "pdf-decompiler", "mcp", "--allow-root", "/path/to/pdfs"]
    }
  }
}

OpenAI Codex (CLI & Desktop)

bash
codex mcp add pdf-decompiler -- npx -y pdf-decompiler mcp --allow-root /path/to/pdfs
~/.codex/config.toml
[mcp_servers.pdf-decompiler]
command = "npx"
args = ["-y", "pdf-decompiler", "mcp", "--allow-root", "/path/to/pdfs"]

Cursor

Project config .cursor/mcp.json or global ~/.cursor/mcp.json.

.cursor/mcp.json
{
  "mcpServers": {
    "pdf-decompiler": {
      "command": "npx",
      "args": ["-y", "pdf-decompiler", "mcp", "--allow-root", "/path/to/pdfs"]
    }
  }
}

Windsurf

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "pdf-decompiler": {
      "command": "npx",
      "args": ["-y", "pdf-decompiler", "mcp", "--allow-root", "/path/to/pdfs"]
    }
  }
}

VS Code

VS Code uses "servers" with "type": "stdio" in .vscode/mcp.json, not "mcpServers".

.vscode/mcp.json
{
  "servers": {
    "pdf-decompiler": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "pdf-decompiler", "mcp", "--allow-root", "${workspaceFolder}/pdfs"]
    }
  }
}

Antigravity (agy)

bash (writes ~/.gemini/config/mcp_config.json)
agy mcp add pdf-decompiler -- npx -y pdf-decompiler mcp --allow-root /path/to/pdfs

Workspace confinement & doctor diagnostics

Deny-by-default & roots/list confinement

Without --allow-root, all local file reads are denied. Symlinks and paths outside configured allow-roots (or inside --deny-root) are rejected with path_denied.

When an MCP client supports roots/list, workspace roots act as a monotonic intersection: they can further confine access to the active workspace, and never widen --allow-root.

Preflight with pdf-decompiler doctor

Run doctor before troubleshooting client issues. It checks Node version, --allow-root directories, state/cache initialization, PDFium WASM startup, Tesseract/ONNX availability, and optional verification env vars without exposing secrets.

bash
npx -y pdf-decompiler doctor --allow-root /path/to/pdfs

Optional pure-Node ONNX PP-OCRv5

Tesseract CLI is used by default for scanned pages. If you want zero-Python PP-OCRv5 inside Node without bundling ~293 MB of native binaries for everyone, install the optional onnxruntime-node peer dependency and download the SHA-256-verified models:

bash
npm install onnxruntime-node
npx -y pdf-decompiler ocr install
npx -y pdf-decompiler mcp --ocr-engine onnx --allow-root /path/to/pdfs

Pass --dir <path> to ocr install if you want to store models in a custom directory.