FileToPDF

dev.filetopdf由 filetopdf.dev 發布官方發布者v0.1.1更新於 Nov 2, 2026

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

已驗證Streamable HTTP可網頁執行檔案與儲存開發者工具

概覽

AI 產生的概覽

FileToPDF 透過 FileToPDF API 把檔案、HTML 與 Markdown 轉成 PDF,並以嵌入資源的形式回傳產生的 PDF。

可以做什麼
  • 把公開網址上的檔案轉成 PDF,自動辨識 Office 文件、圖片、HTML、Markdown 或既有 PDF
  • 用 Chromium 將原始 HTML 字串算繪為 PDF,可選 CSS 與版面參數
  • 將原始 Markdown 字串算繪為 PDF,未提供 CSS 時套用預設樣式表
  • 檢查 API 金鑰並查看方案、剩餘轉換額度與訂閱狀態
適用情境
適合需要讓助理依需求把發票、報告、文件、DOCX/XLSX/PPTX 檔案、圖片或網頁轉成 PDF 的情境,來源可以是網址,也可以是助理產生的 HTML 或 Markdown 文字。
執行需求
需要一組 FileToPDF API 金鑰:本機 npm 套件透過環境變數 FILETOPDF_API_KEY 提供,託管端點透過 x-api-key 標頭提供。可作為遠端 Streamable HTTP 端點使用,也可用 npx 在本機執行(需 Node.js)。需要能連線至 FileToPDF API 的網路。
安裝前請注意
每次成功轉換會消耗帳戶 1 點額度,超出免費額度即產生費用;失敗不扣額度。API 金鑰屬機密,需寫入設定。檔案會從公開網址抓取,內容會傳送給第三方 FileToPDF 服務。部分版面選項(橫向、紙張尺寸、頁邊距、縮放、PDF/A、密碼)僅限較高方案。設定 FILETOPDF_OUTPUT_DIR 或 save_path 會把 PDF 寫入磁碟。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 FileToPDF,將其新增到工作區。
  2. 連接 x-api-key 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/dev.filetopdf%2Ffiletopdf-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

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

README

FileToPDF MCP server

[npm] [smithery badge] [Install 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, …):

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

Claude Code:

bash
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):

json
{  "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.

json
{  "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:

bash
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

bash
npm installnpm 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.

Links

License

MIT

來源:README.md,提交 1008c3d

工具

4

get_account

Get FileToPDF account status

Check the FileToPDF API key and return the plan, remaining conversion credits, and subscription status. Free — costs no credits. Use this to verify the connection works.

無需輸入參數。

convert_file

Convert a file (by URL) to PDF

Convert a file fetched from a public URL into a PDF. Auto-detects the engine from the extension: Office docs (DOCX, XLSX, PPTX, ODT, RTF, TXT, CSV…), images (PNG, JPG, WebP…), HTML, Markdown, or an existing PDF (passthrough). Costs 1 credit on success. Returns the PDF as an embedded resource.

輸入參數url必填pdfapdfuapasswordlandscapesave_pathuserPasswordownerPasswordnativePageRanges

convert_html

Convert HTML to PDF

Render a raw HTML string to a PDF using Chromium, with optional CSS and layout options. Costs 1 credit on success. Returns the PDF as an embedded resource.

輸入參數csshtml必填pdfapdfuascalelandscapemarginTopsave_pathmarginLeftpaperWidthmarginRightpaperHeight另有 6 個

convert_markdown

Convert Markdown to PDF

Render a raw Markdown string to a PDF, with optional CSS and layout options. A sensible default stylesheet is applied when no CSS is given. Costs 1 credit on success. Returns the PDF as an embedded resource.

輸入參數csspdfapdfuascalemarkdown必填landscapemarginTopsave_pathmarginLeftpaperWidthmarginRightpaperHeight另有 6 個

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分