PDF To Text

v0.7.0
io.github.Jim-Panse/pdf-to-text Checked 1 day ago Published 1 month ago

Extracts PDF text locally, with macOS PDFKit and Vision OCR fallbacks and optional AI retry.

Values you need

VariableWhat it is
PDF_TO_TEXT_MCP_ROOTrequired Required existing directory that defines the root-relative filesystem namespace for PDF input and derived text output.
OPENAI_API_KEYoptional secret Optional secret. Enables one AI extraction retry when local extraction is inadequate; omit for local-only operation.
OPENAI_MODELoptional Optional OpenAI model used only for AI retry. Defaults to gpt-5.4-mini.
AI_MAX_OUTPUT_TOKENSoptional Optional cap for all AI-generated output tokens, including non-visible reasoning tokens. Integer minimum 800; defaults to 32000. Default: 32000
MAX_PARALLEL_EXTRACTIONSoptional Integer concurrency limit from 1 to 32. Defaults to min(os.availableParallelism(), 4).
EXTRACTION_QUEUE_CAPACITYoptional Integer maximum waiting requests from 0 to 100; zero disables waiting. Default: 10
EXTRACTION_QUEUE_WAIT_MSoptional Maximum queue wait in milliseconds, integer 1 through 2147483647. Does not limit active work. Default: 60000
WRITE_TEXToptional Optionally save successful extraction text beside the source PDF. Default: false

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add pdf-to-text -e 'PDF_TO_TEXT_MCP_ROOT=<PDF_TO_TEXT_MCP_ROOT>' -- npx -y @jim-panse/pdf-to-text-mcp@0.7.0
Add to claude_desktop_config.json
{
  "mcpServers": {
    "pdf-to-text": {
      "args": [
        "-y",
        "@jim-panse/pdf-to-text-mcp@0.7.0"
      ],
      "command": "npx",
      "env": {
        "PDF_TO_TEXT_MCP_ROOT": "<PDF_TO_TEXT_MCP_ROOT>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "pdf-to-text": {
      "args": [
        "-y",
        "@jim-panse/pdf-to-text-mcp@0.7.0"
      ],
      "command": "npx",
      "env": {
        "PDF_TO_TEXT_MCP_ROOT": "<PDF_TO_TEXT_MCP_ROOT>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "PDF_TO_TEXT_MCP_ROOT",
      "id": "pdf-to-text-mcp-root",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "pdf-to-text": {
      "args": [
        "-y",
        "@jim-panse/pdf-to-text-mcp@0.7.0"
      ],
      "command": "npx",
      "env": {
        "PDF_TO_TEXT_MCP_ROOT": "${input:pdf-to-text-mcp-root}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.pdf-to-text]
command = "npx"
args = ["-y", "@jim-panse/pdf-to-text-mcp@0.7.0"]
env = { "PDF_TO_TEXT_MCP_ROOT" = "<PDF_TO_TEXT_MCP_ROOT>" }

For AI agents

  1. Ask the user for: PDF_TO_TEXT_MCP_ROOT. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: extraction-try.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json