FileToPDF

السجل الرسمي الإنتاجية

Convert files, HTML, and Markdown to PDF via the FileToPDF API. Bring your own API key.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

Remote (streamable-http)
Claude Code
claude mcp add --transport http filetopdf 'https://api.filetopdf.dev/mcp' --header 'x-api-key: <Your FileToPDF API key (sk_live_...). Get one free in one click at https://filetopdf.dev.>'
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "filetopdf": {
            "type": "http",
            "url": "https://api.filetopdf.dev/mcp",
            "headers": {
                "x-api-key": "<Your FileToPDF API key (sk_live_...). Get one free in one click at https://filetopdf.dev.>"
            }
        }
    }
}
NPM package filetopdf-mcp
Claude Code
claude mcp add filetopdf -e 'FILETOPDF_API_KEY=<your filetopdf_api_key>' -- npx -y filetopdf-mcp@0.1.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "filetopdf": {
            "command": "npx",
            "args": [
                "-y",
                "filetopdf-mcp@0.1.1"
            ],
            "env": {
                "FILETOPDF_API_KEY": "<your filetopdf_api_key>"
            }
        }
    }
}

متغيرات البيئة

  • FILETOPDF_API_KEY إلزامي سري Your FileToPDF API key (sk_live_...). Get one free in one click at https://filetopdf.dev.

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. FileToPDF MCP server
  2. Tools
  3. Quick start (local / stdio)
  4. Hosted / remote (Streamable HTTP) — no install
  5. Develop & test
  6. Links
  7. License

FileToPDF MCP server

A Model Context Protocol server for FileToPDF. It lets any MCP client — Claude Desktop, Claude Code, Cursor, Cline, VS Code, ChatGPT, n8n, Make, or your own agent — convert files, HTML, and Markdown to PDF through natural language: invoices, reports, documentation, DOCX/XLSX/PPTX, images, web pages, and more.

Bring your own API key — get one free, in one click, at https://filetopdf.dev (10 free conversions, no signup required).

Tools

ToolWhat it does
get_accountCheck the API key and show plan + remaining credits. Free, no credits used.
convert_fileConvert a file from a public URL (DOCX, XLSX, PPTX, images, HTML, MD, PDF…) to PDF.
convert_htmlRender a raw HTML string (with optional CSS + layout options) to a pixel-perfect PDF via Chromium.
convert_markdownRender a raw Markdown string (with optional CSS + layout options) to a clean PDF.

Each convert tool returns a metadata summary and the PDF as an embedded application/pdf resource (base64), so capable clients can save the file. Set the FILETOPDF_OUTPUT_DIR env var, or pass save_path, to also write the PDF to disk.

Layout options (landscape, paperWidth/Height, margins, scale, pdfa, passwords, …) are available on Pro, Scale, and the free trial; on Starter/Basic they return an upgrade error. Each successful conversion costs 1 credit; errors are free.

Quick start (local / stdio)

Cursor — one-click install: **Add to Cursor** (then replace the placeholder with your key).

Claude Desktop / Cline / any stdio client — add to the MCP config (claude_desktop_config.json, cline_mcp_settings.json, …):

{
  "mcpServers": {
    "filetopdf": {
      "command": "npx",
      "args": ["-y", "filetopdf-mcp"],
      "env": { "FILETOPDF_API_KEY": "sk_live_YOUR_API_KEY" }
    }
  }
}

Claude Code:

claude mcp add filetopdf -e FILETOPDF_API_KEY=sk_live_YOUR_API_KEY -- npx -y filetopdf-mcp

VS Code (.vscode/mcp.json or via MCP: Add Server):

{
  "servers": {
    "filetopdf": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "filetopdf-mcp"],
      "env": { "FILETOPDF_API_KEY": "sk_live_YOUR_API_KEY" }
    }
  }
}

Hosted / remote (Streamable HTTP) — no install

A hosted endpoint is available at https://api.filetopdf.dev/mcp. Authenticate with your own key via the x-api-key header, an Authorization: Bearer header, or an ?apiKey= query parameter.

{
  "mcpServers": {
    "filetopdf": {
      "type": "streamable-http",
      "url": "https://api.filetopdf.dev/mcp",
      "headers": { "x-api-key": "sk_live_YOUR_API_KEY" }
    }
  }
}

This is also the URL to paste into any platform with an MCP client step — n8n (MCP Client Tool), Make (MCP Client), Zapier (MCP Client beta), Relay.app (Call MCP tool), Flowise, Langflow, Dify, LibreChat, AnythingLLM, or agent frameworks (OpenAI Agents SDK, LangChain, CrewAI, Vercel AI SDK).

To self-host instead:

npm run build && npm run start:http   # listens on $PORT (default 8080) at /mcp

A Dockerfile is included for container hosting (Smithery, Fly, Render, Cloud Run).

Develop & test

npm install
npm run build          # tsc -> dist/
npm test               # spawns the built stdio server, runs a live conversion

npm test reads FILETOPDF_API_KEY, or API_KEY= from a gitignored .env.

License

MIT

الأسئلة الشائعة

ما هو FileToPDF؟

Convert files, HTML, and Markdown to PDF via the FileToPDF API. Bring your own API key.

كيف أثبّت FileToPDF؟

يعمل كخادم بعيد. في Claude Code: claude mcp add --transport http filetopdf 'https://api.filetopdf.dev/mcp' --header 'x-api-key: <Your FileToPDF API key (sk_live_...). Get one free in one click at https://filetopdf.dev.>'. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج FileToPDF إلى مفتاح API؟

نعم. يتطلب FILETOPDF_API_KEY, x-api-key، وتضبطها في إعداداته.

هل FileToPDF مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون FileToPDF؟

ينشره FileToPDF. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.