Vibe Coded a PDF Reader MCP Tool for Claude Code - to save my context
So I got annoyed and built something. Again. š¤
Last week I was trying to analyze yet another massive McKinsey report with Claude, watching my precious context window evaporate, and I thought: āthere has to be a better way.ā
An hour of vibe-coding with Claude Code later, I had a working MCP server. Published it to npm. Itās called PDF Reader MCP Server and it solves my exact problem.
The Problem
As someone who regularly works with research PDFs from major consulting firms (think McKinsey, BCG, Deloitte), I was constantly hitting the same frustrating wall. These documents are gold mines of insights that I use to:
Learn about industry trends and best practices
Pull context and data for my blog posts
Create educational materials for my work
Stay current with research in my field
But hereās the thing: these PDFs are massive. Not just because of the content, but because theyāre packed with formatting, styling, charts, images, and visual elements. A 26-page research report can easily be 5MB+ with hundreds of decorative elements. All I want is the text - to search it, understand it, and extract meaningful insights.
If youāve ever tried to analyze these documents with Claude, you know the pain: you paste in the entire text, it consumes massive amounts of context, and youāre left with fewer tokens for actual analysis. A single consulting report can eat up your entire context window before you even ask your first question.
The Solution (That I Built in Like 45 Minutes)
Three simple tools. Thatās it:
š search-pdf - Find What You Need
Search for specific terms or phrases within a PDF without loading the entire document. Get results with surrounding context, perfect for quickly locating relevant sections.
š read-pdf - Smart Text Extraction
Extract text from PDFs with options for cleaning and formatting. Only read what you need, when you need it.
š pdf-metadata - Document Intelligence
Get instant access to PDF metadata: page count, author, creation date, and more. Perfect for understanding documents before diving in.
Why This Actually Matters
Look, Iām not trying to save the world here. I just wanted to stop wasting context tokens on formatting and images when all I need is to search some text and pull out insights.
Now I can:
Search first, then read only what matters
Work with multiple consulting reports in one session
Actually have context left for analysis
Not lose my mind copying and pasting text
Getting Started (Literally One Command)
claude mcp add pdf-reader npx @fabriqa.ai/pdf-reader-mcp@latestRestart Claude Code. Done. You now have PDF superpowers.
(No npm install needed - `npx` handles it automatically and always fetches the latest version. Magic.)
Real-World Example: My Actual Use Case
Hereās how I used it just last week with a McKinsey research report on AI adoption:
The old, painful way:
Download the 26-page PDF (5.6MB with all the formatting)
Extract text ā massive wall of text with image descriptions and formatting artifacts
Paste into Claude ā 150,000+ tokens consumed
Context left for my actual questions: barely any
Result: Canāt even ask follow-up questions or include other sources
The new way with PDF Reader MCP:
1. āSearch for AI native engineeringā
ā Found 3 matches with surrounding context
ā Great, this gives me ideas for my current project
2. āRead the section about organizational changes for AIā
ā Extracts just that section, clean text
ā Perfect content for what Iām writing about
3. āSearch for statistics about AI adoption ratesā
ā Found 12 mentions with data points
ā Now I can cite actual numbers in my post
Context used: ~8,000 tokens
Remaining for analysis: 190,000+ tokens!
The difference? I can now analyze multiple consulting reports in a single session, cross-reference findings, and still have plenty of context left to synthesize everything into a coherent blog post or education document.
The Tech (For Those Who Care)
MCP SDK + pdf-parse + some quick Node.js glue. Runs locally, talks to Claude via stdio. Nothing fancy, just works.
Itās on npm and GitHub if you want to check it out or improve it:
Should You Use This?
If you:
Analyze research PDFs regularly
Write blog posts using consulting reports as sources
Create educational materials from various PDF sources
Just want to search through PDFs without context pain
Then yeah, try it. It might save you as much frustration as it saved me.
If it doesnāt work or you have ideas, hit up the GitHub. PRs welcome.
P.S. Yes, I used Claude Code to build a tool that makes Claude Code better at PDFs. Meta, I know. š
P.P.S. The whole thing took less than an hour. MCP servers are ridiculously easy to build. You should try making one for your own annoying problem.
P.P.P.S. This blog post itself was written with Claude Code in the same coding session - 9 prompts to get it right. The irony continues.


