Metadata-Version: 2.4
Name: pdf-api-mcp
Version: 1.0.0
Summary: MCP server for Simple PDF API — generate and manipulate PDFs from Claude Desktop, Cursor, and Windsurf
Project-URL: Homepage, https://rapidapi.com/mahiuddinalkamal/api/simple-pdf-api
Project-URL: Repository, https://github.com/mahiuddinalkamal/pdf-api
Project-URL: Documentation, https://github.com/mahiuddinalkamal/pdf-api/tree/master/mcp
License: MIT
Keywords: claude,cursor,html-to-pdf,mcp,pdf,windsurf
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: httpx>=0.28.0
Requires-Dist: mcp[cli]>=1.2.0
Description-Content-Type: text/markdown

# Simple PDF API — MCP Server

Use Simple PDF API tools directly inside **Claude Desktop**, **Cursor**, **Windsurf**, and any MCP-compatible client.

8 tools available: `html_to_pdf`, `url_to_pdf`, `merge_pdfs`, `split_pdf`, `watermark_pdf`, `compress_pdf`, `protect_pdf`, `rotate_pdf`, `extract_text`.

## Prerequisites

- A [RapidAPI key](https://rapidapi.com/mahiuddinalkamal/api/simple-pdf-api) (free tier available)
- Python 3.10+ and [`uv`](https://docs.astral.sh/uv/getting-started/installation/) installed

## Setup

### Option A — `uvx` (no install needed)

```bash
PDF_API_KEY=your_rapidapi_key uvx --from "git+https://github.com/mahiuddinalkamal/pdf-api#subdirectory=mcp" pdf-api-mcp
```

### Option B — local clone

```bash
git clone https://github.com/mahiuddinalkamal/pdf-api
cd pdf-api/mcp
uv run server.py
```

---

## Claude Desktop

Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "pdf-api": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/mahiuddinalkamal/pdf-api#subdirectory=mcp",
        "pdf-api-mcp"
      ],
      "env": {
        "PDF_API_KEY": "your_rapidapi_key_here"
      }
    }
  }
}
```

Restart Claude Desktop. You'll see PDF tools in the toolbar.

---

## Cursor

Add to `.cursor/mcp.json` in your project root (or `~/.cursor/mcp.json` for global):

```json
{
  "mcpServers": {
    "pdf-api": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/mahiuddinalkamal/pdf-api#subdirectory=mcp",
        "pdf-api-mcp"
      ],
      "env": {
        "PDF_API_KEY": "your_rapidapi_key_here"
      }
    }
  }
}
```

---

## Windsurf

Add to `~/.codeium/windsurf/mcp_config.json`:

```json
{
  "mcpServers": {
    "pdf-api": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/mahiuddinalkamal/pdf-api#subdirectory=mcp",
        "pdf-api-mcp"
      ],
      "env": {
        "PDF_API_KEY": "your_rapidapi_key_here"
      }
    }
  }
}
```

---

## Tools

| Tool | Description |
|------|-------------|
| `html_to_pdf` | Convert HTML string → PDF |
| `url_to_pdf` | Render a public URL → PDF |
| `merge_pdfs` | Merge multiple PDFs into one |
| `split_pdf` | Extract page ranges from a PDF |
| `watermark_pdf` | Add CONFIDENTIAL / DRAFT overlays |
| `compress_pdf` | Reduce file size |
| `protect_pdf` | AES password-encrypt |
| `rotate_pdf` | Rotate all or selected pages |
| `extract_text` | Pull plain text from a PDF |

All output files are saved to `~/Downloads/`.

## Environment Variables

| Variable | Required | Description |
|---|---|---|
| `PDF_API_KEY` | Yes | Your RapidAPI key |
| `PDF_API_HOST` | No | Override base URL (for self-hosted) |
