← All articles

How to Use Your PDFs Directly Inside Claude and Cursor (MCP Setup)

July 17, 2026 · 6 min read

Stop copy-pasting broken PDF text into Claude. Connect an MCP server so Claude and Cursor convert documents to clean Markdown on demand. Full setup guide.

You are deep in a conversation with Claude or Cursor, you have a PDF, a spreadsheet export or a slide deck, and getting that file into the chat is the worst part of the workflow. You copy the text and it arrives mangled. You upload it and the tables lose their shape. Either way you burn a chunk of the context window on noise before the model even understands what it is looking at.

There is a better way now: connect a document-conversion tool over MCP, and the assistant converts files on demand, inside the conversation. Here is why the copy-paste route fails, how to set the MCP route up in about two minutes, and where its limits are.

Why copy-pasting a PDF fails

A PDF is a layout format, not a text format. It stores glyphs at coordinates on a page, with no reliable notion of reading order. When you copy from it, or when a naive extractor reads it, that structure has to be guessed, and the guess is often wrong.

  • Words split across line breaks, so "inter- national" arrives as two tokens that mean nothing.
  • Tables flatten into a run of numbers, so a value loses the column and row label that gave it meaning.
  • Page headers, footers and page numbers repeat in every chunk, polluting context.
  • Multi-column layouts interleave, so sentences from two columns get stitched together.
  • Scanned or image-only pages extract as nothing at all, silently, so the model answers from a document that is half empty.

The frustrating part is that none of this looks like an error. The model answers confidently from bad input, and you blame the model.

What MCP changes

MCP, the Model Context Protocol, is an open standard that lets AI clients such as Claude Desktop and Cursor call external tools. Once a tool is connected, the assistant can use it on its own during a conversation, without you leaving the chat.

For documents, that flips the workflow. Instead of converting a file yourself, then pasting the result, then hoping the formatting survived, you simply point the assistant at the file. It calls the conversion tool, gets clean Markdown back, and continues with that in context.

Setting it up (about two minutes)

You need Node.js 18 or newer, and an API key for the conversion service. The example below uses the open-source PackForAI MCP server, which converts PDF, DOCX, PPTX, XLSX, CSV and JSON into clean, compact Markdown.

Claude Desktop

  1. Open Settings, then Developer, then Edit Config.
  2. Add the block below to claude_desktop_config.json.
  3. Restart Claude Desktop.
{
  "mcpServers": {
    "packforai": {
      "command": "npx",
      "args": ["-y", "packforai-mcp"],
      "env": { "PACKFORAI_API_KEY": "your_key_here" }
    }
  }
}

Cursor

Cursor uses the same shape. Put the identical block in .cursor/mcp.json for a single project, or in ~/.cursor/mcp.json to make it available everywhere.

That is the whole setup. There is nothing to install globally, because npx fetches the server on demand.

What you can do once it is connected

After a restart, the assistant has a convert_document tool. You can talk to it in plain language:

  • "Convert ~/Downloads/Q3-report.pdf to clean Markdown, then summarise the revenue table."
  • "Fetch https://example.com/spec.docx and give me the AI-ready version."
  • "This scan is unreadable, convert it with OCR: /path/to/contract.pdf"
  • "Convert this spreadsheet and tell me which line items grew the most."

The conversion happens as a tool call, so the clean Markdown enters the context directly. You never open another tab, and the structure that matters, such as tables and headings, arrives intact.

Why clean input matters more than people expect

Two things improve at once. Accuracy goes up, because a number that keeps its column label can actually be retrieved with its meaning. And cost goes down, because stripping repeated page furniture and layout noise typically removes 40 to 65 percent of the tokens without removing information. On long documents, that is the difference between fitting in context and truncating the part you needed.

Honest limits

  • You need an API key, and API access is a paid plan on most conversion services, including this one.
  • PDF table reconstruction has real limits. Simple tables come through as readable text, but complex PDF layouts may arrive as text rather than a perfect grid. Word and Excel tables convert far more reliably.
  • OCR applies to scanned or image-only pages. It is excellent for recovering pages that would otherwise be empty, but it is not magic on low-quality scans.
  • MCP support depends on your client. Claude Desktop and Cursor support it well today; other clients vary.

If MCP is not your workflow

MCP is the lowest-friction option if you already live inside Claude or Cursor. If you would rather script it, the same conversion is available from the command line, which is handy in a Makefile or a CI step:

export PACKFORAI_API_KEY="your_key"
npx packforai-cli report.pdf > report.md

And if you are building a product rather than a workflow, there is a REST API that does the same job with polling or signed webhooks.

The takeaway

Most bad answers from documents are an input problem, not a model problem. Whether you use MCP, a CLI or an API, the win comes from the same place: give the model clean, structured Markdown instead of whatever fell out of the PDF. MCP just makes that step disappear into the conversation, which is exactly where it belongs.

Try PackForAI

Turn your PDFs, DOCX, PPTX, and XLSX into clean, AI-ready Markdown with token savings. Free to start.

Open the app