# PDF Reader MCP Server - PDF to Markdown, Search & Metadata (`rjmacarthy/document-tools-mcp-server`) Actor

MCP server for AI agents (Claude, Cursor, n8n): read any public PDF URL as clean Markdown a page range at a time, with page markers and nextPages for long files; find the pages that mention a phrase; get title, dates, page count. No login, no API key. $0.01 per call.

- **URL**: https://apify.com/rjmacarthy/document-tools-mcp-server.md
- **Developed by:** [rj](https://apify.com/rjmacarthy) (community)
- **Categories:** MCP servers, AI, Developer tools
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PDF Reader MCP Server - PDF to Markdown, Search & Metadata

Let your AI agent read the PDFs it finds on the web. This MCP server gives Claude, Cursor, n8n agents or any MCP client three read-only tools: turn a **public PDF URL into clean Markdown, a page range at a time** (so a 300-page report fits in context step by step), **find the pages that mention a phrase**, and **get a PDF's title, dates, page count and whether it has a text layer**. Running headers, footers and page numbers are removed; headings, lists and tables come through as Markdown, with `<!-- page N -->` markers so the agent can cite pages. There is no login, no API key and no proxy, and it downloads only the URL the agent gives it. Most PDF MCP servers return the whole file or nothing; this one returns `nextPages` so the agent knows exactly what to read next. It costs a flat **$0.01 per answered call**. Failed calls are free.

**Scope:** public `http(s)` PDF URLs up to 25 MB, no uploads over MCP. Scanned PDFs (images without a text layer) return a clear "no text layer" error, because there is no OCR of PDF pages. Word, Excel and PowerPoint files are not supported.

### What your agent can ask

- "Read the Attention Is All You Need paper (arxiv.org/abs/1706.03762) and summarise the method section."
- "Which pages of this annual report mention 'net revenue'? Quote them."
- "How long is this PDF, who wrote it, when was it published, and is it a scan?"
- "Read pages 40-55 of this standard and list every requirement that uses the word 'shall'."
- "Find where this contract talks about termination, then read those pages in full."
- "Turn this GitHub-hosted whitepaper into Markdown so I can quote it."

### Tools

| Tool | What it returns | Arguments |
|---|---|---|
| `pdf_to_markdown` | Markdown (or plain text) of a page range, with `<!-- page N -->` markers, running headers/footers removed. At most 30 pages per call, and it stops once `maxChars` is reached. Returns `title`, `author`, `pageCount`, `pagesConverted` ("1-6"), `content`, `truncated`, `nextPages` ("7-15") and `warnings` | `url` (required), `pages` ("1-5, 9", "20-"; default from page 1), `format` (`markdown` default, or `text`), `maxChars` (2000-60000, default 25000) |
| `pdf_info` | `title`, `author`, `subject`, `keywords`, `creator`, `producer`, `createdAt`, `modifiedAt`, `pageCount`, `fileSizeBytes`, `hasTextLayer` (checked on the first 3 pages), `language` and a 500-character `preview` of the first page | `url` (required) |
| `search_pdf` | The pages that mention a word or phrase (case-insensitive plain text, not regex), with a ~240-character snippet centred on each match: `pageCount`, `scannedPages`, `totalMatches`, `pagesWithMatches` ("1, 8-9") and up to 20 `matches` `{page, snippet}`. Scans up to the first 200 pages; if time runs out first, `scannedPages` and `warnings` say where it stopped | `url` (required), `query` (1-200 characters, required), `limit` (1-20, default 10) |

**URLs:** arXiv abstract pages, GitHub file pages, Dropbox and Google Drive share links are rewritten to the file itself. Only public internet addresses are fetched. Private, loopback and cloud-metadata addresses are refused, including on every redirect.

#### Example calls

```json
{ "name": "pdf_info", "arguments": { "url": "https://arxiv.org/pdf/1706.03762" } }
{ "name": "pdf_to_markdown", "arguments": { "url": "https://arxiv.org/abs/1706.03762", "pages": "1-5" } }
{ "name": "pdf_to_markdown", "arguments": { "url": "https://arxiv.org/pdf/1706.03762", "pages": "8-", "format": "text", "maxChars": 10000 } }
{ "name": "search_pdf", "arguments": { "url": "https://arxiv.org/pdf/1706.03762", "query": "BLEU", "limit": 5 } }
```

Real answer from `search_pdf` (`limit: 2`):

```json
{"query":{"url":"https://arxiv.org/pdf/1706.03762","query":"BLEU","limit":2},"pageCount":15,"scannedPages":15,"totalMatches":11,"pagesWithMatches":"1, 8-9","matches":[{"page":1,"snippet":"…or in quality while being more parallelizable and requiring significantly less time to train. Our model achieves 28.4 BLEU on the WMT 2014 English- to-German translation task, improving over the existing best results, including ensembles, b…"},{"page":1,"snippet":"…MT 2014 English- to-German translation task, improving over the existing best results, including ensembles, by over 2 BLEU. On the WMT 2014 English-to-French translation task, our model establishes a new single-model state-of-the-art BLEU s…"}]}
```

Real answer from `pdf_info` (preview trimmed):

```json
{"query":{"url":"https://arxiv.org/pdf/1706.03762"},"title":"Attention Is All You Need","creator":"LaTeX with hyperref","producer":"pdfTeX-1.40.25","createdAt":"2024-04-10T21:11:43.000Z","modifiedAt":"2024-04-10T21:11:43.000Z","pageCount":15,"fileSizeBytes":2215244,"hasTextLayer":true,"language":"en","preview":"Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures in this paper solely for use in journalistic or scholarly works.\n\nAttention Is All You Need\n\n..."}
```

`pdf_to_markdown` with `"pages": "1-15"` returns pages 1-7 (about 22,000 characters, under the default `maxChars`) and `"nextPages": "8-15"`. The agent asks for `"pages": "8-15"` next. A search with no matches is a normal, charged answer with `totalMatches: 0`. Invalid arguments, unreachable or private URLs, files that aren't PDFs, files over 25 MB, password-protected or scanned PDFs, upstream HTTP errors and calls over the 50-second limit return an error message and are **not charged**.

### How to connect

Endpoint: `https://rjmacarthy--document-tools-mcp-server.apify.actor/mcp` (Streamable HTTP)
Header: `Authorization: Bearer <YOUR_APIFY_TOKEN>` (find your token in Apify Console → Settings → API & Integrations)

**Claude Desktop / Claude Code** (`claude_desktop_config.json` or `.mcp.json`):

```json
{
  "mcpServers": {
    "pdf-reader": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://rjmacarthy--document-tools-mcp-server.apify.actor/mcp",
               "--header", "Authorization: Bearer YOUR_APIFY_TOKEN"]
    }
  }
}
```

Or in Claude Code: `claude mcp add --transport http pdf-reader https://rjmacarthy--document-tools-mcp-server.apify.actor/mcp --header "Authorization: Bearer YOUR_APIFY_TOKEN"`

**Cursor** (`~/.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "pdf-reader": {
      "url": "https://rjmacarthy--document-tools-mcp-server.apify.actor/mcp",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

Any MCP client that supports Streamable HTTP works with the same URL and header, including n8n's MCP Client node, ChatGPT connectors and the OpenAI Agents SDK.

### Pricing

| Event | Price | When |
|---|---|---|
| `tool-call` | **$0.01** | Once per answered tool call |

There is no per-page fee and no proxy surcharge, and failed calls are free. **Example:** an agent reads a 60-page report in 3 calls of 20 pages, after 1 `pdf_info` and 1 `search_pdf`, which makes 5 calls for **$0.05**. 1,000 tool calls cost $10.

### What data can you get

| Field | Description |
|---|---|
| `content` | Markdown or plain text of the converted pages, with page markers |
| `pagesConverted`, `nextPages`, `truncated` | What was read, what to read next, and whether a single page was cut at `maxChars` |
| `title`, `author`, `subject`, `keywords` | Document metadata (the title falls back to the first heading) |
| `creator`, `producer`, `createdAt`, `modifiedAt` | Authoring tool and ISO dates |
| `pageCount`, `fileSizeBytes`, `language` | Size and declared or detected language |
| `hasTextLayer`, `preview` | Whether the PDF has extractable text (false = a scan) and a first-page preview |
| `matches[].page`, `matches[].snippet`, `totalMatches`, `pagesWithMatches` | Search hits with context |
| `warnings` | URL rewrites, pages without text, skipped rotated text |

### Use cases

- **Research assistants:** read arXiv papers, standards and reports page by page and answer with page citations.
- **Due diligence and finance:** search annual reports and filings for a figure or term, then read the pages around it.
- **Legal and compliance:** find clauses in public contracts, policies and regulations.
- **RAG on demand:** pull clean Markdown from a PDF link into an agent's context without a separate ingestion pipeline.
- **Triage:** check page count, date and text layer before deciding whether a document is worth reading.

### Normal (non-MCP) runs

You can also run the Actor like any other Actor. A normal run executes **one** tool with your input and saves dataset rows, for a single `tool-call` charge per run:

```json
{ "tool": "pdf_to_markdown", "url": "https://arxiv.org/pdf/1706.03762", "pages": "1-3" }
{ "tool": "search_pdf", "url": "https://arxiv.org/pdf/1706.03762", "query": "BLEU", "limit": 10 }
{ "tool": "pdf_info", "url": "https://arxiv.org/pdf/1706.03762" }
```

`pdf_to_markdown` saves **one row per page** (`type: "page"`, `page`, `content`, `charCount`), `search_pdf` one row per match (`type: "match"`, `page`, `snippet`) and `pdf_info` one row (`type: "info"`). Every row has every field (`null` where it doesn't apply) plus `id`, `url`, `tool` and `scrapedAt`. The **Pages**, **Search matches** and **PDF info** dataset views show the main columns, and the `RUN_SUMMARY` record holds `nextPages` and the request counts.

### Tips and limits

- **Long PDFs:** call `pdf_info` first, then `search_pdf` to find the right pages, then `pdf_to_markdown` on just those pages. Follow `nextPages` to read on.
- **30 pages and `maxChars` per call.** A dense page is 3,000-5,000 characters, so the default 25,000 is roughly 5-8 pages. Raise `maxChars` up to 60,000 if your model's context allows.
- **Each call is capped at 50 seconds.** On a very slow host or a huge file the server may convert fewer pages and say so in `warnings`; `nextPages` continues from there.
- **Scanned PDFs** have no text layer and return an error (not charged). The server does not OCR PDF pages.
- **Tables** are rebuilt from text positions. Simple tables come out as Markdown tables, while complex ones may come out as text lines.
- **Search** matches the text as it appears in the PDF. Words hyphenated across a line break are not joined.
- Some hosts block automated downloads or need a login, and those calls return the HTTP error (not charged).

### FAQ

**Is it legal?** The server reads only public files at URLs you or your agent provide, the same files anyone can download in a browser. It never logs in and does not collect personal data. You are responsible for having the right to process the documents you read, and for complying with their terms and with data-protection laws such as the GDPR.

**Do I need an API key or a proxy?** No. You only need your Apify token to call the server. It downloads directly and never uses a residential proxy.

**Can I upload a PDF?** Not over MCP. Put the file at a public URL (a GitHub raw link, a Dropbox or Google Drive share link, or an Apify key-value store record) and pass that URL.

**Can it read scanned PDFs or images?** No. It needs a text layer. `pdf_info` tells you whether a PDF has one (`hasTextLayer`).

**Why is my call an error?** The message says why: an invalid argument, a URL that isn't a PDF or isn't public, a file over 25 MB, a password, no text layer, the host's HTTP error, or the time limit. Errors are never charged.

### Integrations

- **MCP:** Claude, Cursor, ChatGPT connectors, the n8n AI Agent (MCP Client tool), the OpenAI Agents SDK, LangChain MCP adapters
- **Apify API:** run one tool as a normal run and read the dataset (`/v2/acts/rjmacarthy~document-tools-mcp-server/run-sync-get-dataset-items`)
- **Make, Zapier, n8n:** the Apify integrations, for scheduled document checks
- **Need bulk conversion?** For many PDFs at once (uploads, chunking for RAG), use the batch Actor [PDF to Markdown](https://apify.com/rjmacarthy/pdf-to-markdown).

### Changelog

- **0.1** (November 2026): first release with three tools: `pdf_to_markdown`, `pdf_info` and `search_pdf`.

### More scrapers by the same developer

- [AI Visibility Tracker: ChatGPT, Perplexity, Gemini, Claude](https://apify.com/rjmacarthy/ai-search-visibility-tracker)
- [AliExpress Scraper - Product Search, Prices, Ratings & Details](https://apify.com/rjmacarthy/aliexpress-scraper)
- [Apple App Store Scraper: Apps, Search & Reviews](https://apify.com/rjmacarthy/app-store-scraper)
- [AutoScout24 Scraper - Used Car Listings & Prices (Europe)](https://apify.com/rjmacarthy/autoscout24-scraper)
- [Bilibili Scraper - Videos, Search, Popular & Uploader Stats](https://apify.com/rjmacarthy/bilibili-scraper)
- [Bing Search Scraper: Organic Results, Ads & Related Searches](https://apify.com/rjmacarthy/bing-search-scraper)

Browse all my Actors on [my Apify Store profile](https://apify.com/rjmacarthy).

### Support

Found a PDF that converts badly or a host that fails? Open an issue on the Actor's **Issues** tab with the URL and the tool call, and I'll look at it.

# Actor input Schema

## `tool` (type: `string`):

Which tool to run.

## `url` (type: `string`):

A public PDF URL. arXiv abstract pages, GitHub file pages, Dropbox and Google Drive share links are rewritten to the file. Max 25 MB.

## `pages` (type: `string`):

PDF to Markdown only: page range such as "1-5, 9" or "20-". Empty = from page 1. At most 30 pages per run.

## `format` (type: `string`):

PDF to Markdown only: Markdown (headings, lists, tables) or plain text.

## `maxChars` (type: `integer`):

PDF to Markdown only: stop adding pages once the text reaches this length (2000-60000).

## `query` (type: `string`):

Search only: a word or phrase (case-insensitive, plain text).

## `limit` (type: `integer`):

Search only: max matches returned (1-20).

## Actor input object example

```json
{
  "tool": "pdf_to_markdown",
  "url": "https://arxiv.org/pdf/1706.03762",
  "pages": "1-3",
  "format": "markdown",
  "maxChars": 25000,
  "query": "multi-head attention",
  "limit": 10
}
```

# Actor output Schema

## `pages` (type: `string`):

pdf_to_markdown pages (table).

## `matches` (type: `string`):

search_pdf matches (table).

## `info` (type: `string`):

pdf_info row (table).

## `allFields` (type: `string`):

Every field of every row.

## `summary` (type: `string`):

Tool, arguments, counts, nextPages and requests per host.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tool": "pdf_to_markdown",
    "url": "https://arxiv.org/pdf/1706.03762",
    "pages": "1-3"
};

// Run the Actor and wait for it to finish
const run = await client.actor("rjmacarthy/document-tools-mcp-server").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "tool": "pdf_to_markdown",
    "url": "https://arxiv.org/pdf/1706.03762",
    "pages": "1-3",
}

# Run the Actor and wait for it to finish
run = client.actor("rjmacarthy/document-tools-mcp-server").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tool": "pdf_to_markdown",
  "url": "https://arxiv.org/pdf/1706.03762",
  "pages": "1-3"
}' |
apify call rjmacarthy/document-tools-mcp-server --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rjmacarthy/document-tools-mcp-server"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/y0usEgB78H1NwMDbM/builds/OvHdz3IBNDoNrtXXJ/openapi.json
