FileToPDF — Claude Code MCP server: PDF conversion and setup
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.
MIT ★ 2 updated 2026-06-10
claude mcp add filetopdf-mcp -e FILETOPDF_API_KEY=<FILETOPDF_API_KEY> -- npx -y filetopdf-mcpWhat FileToPDF 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.
What it helps with
- 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 for the agent
- 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.
How to install FileToPDF
1Platform CLI
claude mcp add filetopdf-mcp -e FILETOPDF_API_KEY=<FILETOPDF_API_KEY> -- npx -y filetopdf-mcpReplace <…> with your own values
2Platform CLI: remote server
claude mcp add --transport http filetopdf https://api.filetopdf.dev/mcp1Platform CLI: remote server
codex mcp add filetopdf --url https://api.filetopdf.dev/mcp2Platform CLI
codex mcp add filetopdf --env FILETOPDF_API_KEY=<FILETOPDF_API_KEY> -- npx -y filetopdf-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"filetopdf": {
"url": "https://api.filetopdf.dev/mcp"
}
}
}{
"mcpServers": {
"filetopdf": {
"command": "npx",
"args": [
"-y",
"filetopdf-mcp"
],
"env": {
"FILETOPDF_API_KEY": "<FILETOPDF_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"filetopdf": {
"type": "http",
"url": "https://api.filetopdf.dev/mcp"
}
}
}{
"servers": {
"filetopdf": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"filetopdf-mcp"
],
"env": {
"FILETOPDF_API_KEY": "<FILETOPDF_API_KEY>"
}
}
}
}Replace <…> with your own values
1Platform CLI: remote server
gemini mcp add -t http filetopdf https://api.filetopdf.dev/mcp2Platform CLI
gemini mcp add -e FILETOPDF_API_KEY=<FILETOPDF_API_KEY> filetopdf npx -y filetopdf-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about FileToPDF
How do I install FileToPDF in Claude Code?
For a stdio connection, run: claude mcp add filetopdf-mcp -e FILETOPDF_API_KEY=<FILETOPDF_API_KEY> -- npx -y filetopdf-mcp
What does FileToPDF do?
It gives an agent tools to convert files at public URLs, HTML, and Markdown into PDFs through the FileToPDF API.
Can it convert a local file?
The convert_file tool takes a public URL. For HTML and Markdown, you can provide the content directly.