Gemini CLI + pdfmcp:設定指南

透過 settings.json 將 pdfmcp 新增到 Gemini CLI。

僅限本地。相同的 74 個工具,在您的機器上執行:無賬戶、無金鑰、無限制。 使用 Gemini CLI 時,本頁的配置會在您的機器上執行 pdfmcp;透過更換配置,您可以隨時重新安裝或更換客戶端。

您需要: 本地 pdfmcp 軟體包:安裝一次(或讓 uvx 在首次啟動時下載它)。無賬戶、無金鑰,沒有任何秘密需要替換。

它放在哪裡: Wherever your client keeps its MCP server list

{
  "mcpServers": {
    "pdfmcp": {
      "command": "uvx",
      "args": [
        "--from",
        "https://pdfmcp.org/downloads/pdfmcp-4.2.1-py3-none-any.whl",
        "pdfmcp"
      ]
    }
  }
}

步驟

  1. Save the config at the location above — uvx fetches the pdfmcp package on first launch, so there is nothing to install by hand (or install it once with the pip command on the MCP page and use "command": "pdfmcp").
  2. Restart Gemini CLI so it loads the new server.
  3. Ask the agent to run a pdfmcp tool — it executes on this machine, and your files never leave it.

疑難排解

試試這些

本地 · MCPPDF 轉 Word (DOCX)將 PDF 轉換為可編輯的 Word 文件。基於文字的轉換:段落和標題從文字層重建;確切版面、表格和圖像不會保留。裝置端處理PDF 資訊與中繼資料以 JSON 提供頁數、頁面大小、中繼資料和加密狀態。裝置端處理合併 PDF按上傳順序將多個 PDF 檔案合併為一個。

更多用戶端: Claude Desktop MCP 設定 · Claude Code MCP 設定 · ChatGPT MCP 設定 · 所有 MCP 設定指南 · 本地 API 指南