PDF to MD
by liuyan-wjy
README.md
# PDF to MD — Remote MCP Server & CLI Bridge
> Hosted **Streamable HTTP** Model Context Protocol (MCP) server for converting PDFs, scanned documents (OCR), and images into clean GitHub Flavored Markdown — built for **Claude Desktop**, **Claude Code**, **Cursor**, **Windsurf**, and custom AI agents.
- **Hosted MCP Endpoint**: `https://pdf-to-md.app/mcp` (Streamable HTTP, JSON & SSE)
- **Browser Local Tool (Free, Zero Upload, No Sign-Up)**: https://pdf-to-md.app/
- **Developer & REST API Docs**: https://pdf-to-md.app/developers
- **OpenAPI Spec**: https://pdf-to-md.app/openapi.json
- **MCP Registry ID**: `io.github.liuyan-wjy/pdf-to-md`
This repository provides the open-source (MIT) **configuration templates**, **zero-dependency CLI client**, and **stdio-to-Streamable-HTTP bridge** for connecting any MCP client to the hosted `https://pdf-to-md.app/mcp` service — without installing Python, PyTorch, Docker, or local OCR weights.
---
## Quick Start (Native Streamable HTTP)
### 1. Create an API key
Sign in at [pdf-to-md.app/settings/apikeys](https://pdf-to-md.app/settings/apikeys) and generate a Bearer token.
- **Free tier**: 100 standard cloud conversions/month, 5 PDF exports/day, and 5 free OCR pages on sign-up (plus unlimited browser-local text PDF conversion on the web app with 0 bytes uploaded).
- **Pay-as-you-go OCR packs**: $5 for 500 OCR pages (valid 12 months, shared across Web, REST API, and MCP).
### 2. Add to Cursor / Claude Desktop / Windsurf
Add the following to `.cursor/mcp.json` or your MCP client configuration:
```json
{
"mcpServers": {
"pdf-to-md": {
"url": "https://pdf-to-md.app/mcp",
"headers": {
"Authorization": "Bearer YOUR_PDFTOMD_API_KEY"
}
}
}
}
```
### 3. Add to Claude Code (CLI)
```bash
claude mcp add --transport http pdf-to-md https://pdf-to-md.app/mcp \
--header "Authorization: Bearer $PDFTOMD_API_KEY"
```
### 4. Legacy stdio-only MCP clients (Zero-Dependency Bridge)
If your client only supports `stdio` MCP servers (and not native Streamable HTTP yet), run the included bridge with Node.js 20+:
```json
{
"mcpServers": {
"pdf-to-md": {
"command": "node",
"args": ["/path/to/pdf-to-md-mcp/bin/cli.mjs", "stdio"],
"env": {
"PDFTOMD_API_KEY": "YOUR_PDFTOMD_API_KEY"
}
}
}
}
```
---
## Available MCP Tools (5 Tools)
Unauthenticated capability discovery (`initialize`, `tools/list`, `resources/list`, `prompts/list`, `ping`) works directly against `POST https://pdf-to-md.app/mcp`. Executing any tool requires `Authorization: Bearer <PDFTOMD_API_KEY>`.
| Tool | Input | Description |
| --- | --- | --- |
| `upload_remote_file` | `{ "url": "https://..." }` | Fetches a public HTTPS document (PDF, JPEG, PNG, WebP, TIFF, HTML, MD, TXT; up to 10 MB, port 443) and returns `{ id, filename, pages, finalUrl }`. |
| `create_conversion` | `{ "uploadId": "...", "mode": "standard" \| "ocr" \| "pdf", "idempotencyKey?": "..." }` | Starts an async conversion job. Use `standard` for text PDFs/docs, `ocr` for scanned PDFs or images (1 OCR credit/page), or `pdf` for Markdown-to-PDF export. |
| `get_conversion` | `{ "id": "..." }` | Polls job status (`succeeded`, `failed`, `cancelled`), progress, page count, and error details. |
| `read_result` | `{ "id": "..." }` | Returns inline `{ markdown, assets }` JSON up to 128 KB, or a `{ url, contentType }` download descriptor for PDF outputs and large documents. |
| `get_usage` | `{}` | Checks remaining `{ ocr, standard, export, plan }` quotas before queuing large jobs. |
---
## CLI Usage (Node.js 20+, Zero Dependencies)
```bash
# Test unauthenticated MCP discovery against live https://pdf-to-md.app/mcp
node bin/cli.mjs discover
# Convert a local PDF or public HTTPS URL via the REST API
export PDFTOMD_API_KEY="your_api_key"
node bin/cli.mjs convert ./report.pdf --mode standard
node bin/cli.mjs convert ./scan.pdf --mode ocr
# Convert a public webpage URL synchronously to Markdown (with YAML frontmatter)
node bin/cli.mjs url https://pdf-to-md.app/guides/pdf-to-markdown-for-llm
```
---
## How It Compares with Self-Hosted PDF MCP Servers
| MCP Server | Hosting & Setup | Scanned PDF OCR | Best Fit |
| --- | --- | --- | --- |
| **PDF to MD (`/mcp`)** | Hosted remote Streamable HTTP (0 local setup) | Built-in cloud OCR (5 free pages; $5 / 500 pages) | Claude / Cursor agents needing PDF + OCR with zero Python/Docker maintenance |
| `docling-mcp` | Self-hosted Python / Docker + ML models | Local ML models (CPU/GPU required) | Air-gapped or high-volume self-hosted pipelines |
| `markitdown-mcp` | Self-hosted Python stdio / local server | Text-first; scans require extra OCR tooling | Local developer machine scripts |
| `firecrawl-mcp-server` | Web-scraping MCP | Focuses on website crawling | Scraping multi-page websites for LLMs |
---
## Privacy & Limits
- **Hosted MCP & Cloud OCR**: Original uploaded files are deleted right after processing; generated results remain downloadable for 24 hours. Cloud limits: up to **10 MB / 100 pages** per PDF.
- **Zero-Upload Local Mode (Web)**: Need 0-byte upload for confidential text PDFs? Open [pdf-to-md.app](https://pdf-to-md.app/) directly in your browser (free, no sign-up, up to **50 MB / 500 pages**).
## License
MIT — see [LICENSE](./LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues