# FileToPDF

Convert files from public URLs, HTML, and Markdown into PDFs through the FileToPDF API. Useful when an agent needs to produce a PDF from a document or text.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 2 repo stars
- Author: FileToPDF
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/FileToPDF/filetopdf-mcp
- Updated: 2026-06-10
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/filetopdf

## What it does

FileToPDF adds conversion tools to an MCP client. One accepts files at public URLs, including DOCX, XLSX, PPTX, and images. The others turn supplied HTML or Markdown into PDFs. You need a FileToPDF API key to use the service.

Each conversion returns a PDF resource alongside a metadata summary. A client that supports saving resources can write the PDF to a file; set `FILETOPDF_OUTPUT_DIR` or pass `save_path` to choose disk output. The file tool needs a public URL, so it cannot take a local file path directly.

## Requirements
- Needs: Node.js (commands run via npx)
- Remote server: `https://api.filetopdf.dev/mcp`
- Environment variables: `FILETOPDF_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

1. **Platform CLI**
```bash
claude mcp add filetopdf-mcp -e FILETOPDF_API_KEY=<FILETOPDF_API_KEY> -- npx -y filetopdf-mcp
```
Replace <…> with your own values

2. **Platform CLI: remote server**
```bash
claude mcp add --transport http filetopdf https://api.filetopdf.dev/mcp
```

### Codex

1. **Platform CLI: remote server**
```bash
codex mcp add filetopdf --url https://api.filetopdf.dev/mcp
```

2. **Platform CLI**
```bash
codex mcp add filetopdf --env FILETOPDF_API_KEY=<FILETOPDF_API_KEY> -- npx -y filetopdf-mcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "filetopdf": {
            "url": "https://api.filetopdf.dev/mcp"
        }
    }
}
```
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "filetopdf": {
            "command": "npx",
            "args": [
                "-y",
                "filetopdf-mcp"
            ],
            "env": {
                "FILETOPDF_API_KEY": "<FILETOPDF_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "filetopdf": {
            "type": "http",
            "url": "https://api.filetopdf.dev/mcp"
        }
    }
}
```
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "filetopdf": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "filetopdf-mcp"
            ],
            "env": {
                "FILETOPDF_API_KEY": "<FILETOPDF_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

1. **Platform CLI: remote server**
```bash
gemini mcp add -t http filetopdf https://api.filetopdf.dev/mcp
```

2. **Platform CLI**
```bash
gemini mcp add -e FILETOPDF_API_KEY=<FILETOPDF_API_KEY> filetopdf npx -y filetopdf-mcp
```
Replace <…> with your own values

## When to use it
- Turn a document at a public URL into a PDF
- Render HTML content as a PDF
- Export Markdown text to PDF
- Check the API plan and remaining credits

## Example prompts
- Convert the document at this public URL into a PDF.
- Render this HTML as a PDF in landscape layout.
- Check my FileToPDF API key and remaining credits.

## Similar
- [doc-to-markdown](https://affpapa.org/en/nevibecode/skills/doc-to-markdown.md) — skill · 945 installs
- [mcp-document-converter](https://affpapa.org/en/nevibecode/mcp/mcp-document-converter.md) — MCP server · ★ 12 repo stars
- [mdv-markdown-visualization](https://affpapa.org/en/nevibecode/skills/mdv-markdown-visualization.md) — skill · 397 installs
- [htmldrop](https://affpapa.org/en/nevibecode/mcp/htmldrop.md) — MCP server · ★ 15 repo stars
- [exam-study-guide](https://affpapa.org/en/nevibecode/skills/exam-study-guide.md) — skill · ★ 402 repo stars
- [html-to-pdf](https://affpapa.org/en/nevibecode/skills/html-to-pdf.md) — skill · 1300 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
