/ 目錄 / 演練場 / MarkItDown MCP
● 官方 microsoft ⚡ 即開即用

MarkItDown MCP

作者 microsoft · microsoft/markitdown

Microsoft 的 MarkItDown 作為 MCP——將 PDF、DOCX、PPTX、XLSX、音訊和 HTML 轉換為乾淨的 Markdown,供 Claude 讀取。

MarkItDown 是 Microsoft 的通用文件轉 Markdown 轉換器,封裝為 MCP 伺服器。將任意 Office 文件、PDF、圖片、音訊檔案、ZIP、EPub 或 URL 交給它,獲得 Claude 可推理的結構化 Markdown。MCP 層(markitdown-mcp)是同一個 monorepo 中的獨立套件。

為什麼要用

核心特性

即時演示

實際使用效果

markitdown-mcp.replay ▶ 就緒
0/0

安裝

選擇你的客戶端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "markitdown-mcp": {
      "command": "uvx",
      "args": [
        "markitdown-mcp"
      ]
    }
  }
}

開啟 Claude Desktop → Settings → Developer → Edit Config。儲存後重啟應用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "markitdown-mcp": {
      "command": "uvx",
      "args": [
        "markitdown-mcp"
      ]
    }
  }
}

Cursor 使用與 Claude Desktop 相同的 mcpServers 格式。專案級設定優先於全域。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "markitdown-mcp": {
      "command": "uvx",
      "args": [
        "markitdown-mcp"
      ]
    }
  }
}

點擊 Cline 側欄中的 MCP Servers 圖示,然後選 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "markitdown-mcp": {
      "command": "uvx",
      "args": [
        "markitdown-mcp"
      ]
    }
  }
}

格式與 Claude Desktop 相同。重啟 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "markitdown-mcp",
      "command": "uvx",
      "args": [
        "markitdown-mcp"
      ]
    }
  ]
}

Continue 使用伺服器物件陣列,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "markitdown-mcp": {
      "command": {
        "path": "uvx",
        "args": [
          "markitdown-mcp"
        ]
      }
    }
  }
}

加入 context_servers。Zed 儲存後熱重載。

claude mcp add markitdown-mcp -- uvx markitdown-mcp

一行命令搞定。用 claude mcp list 驗證,claude mcp remove 移除。

使用場景

實戰用法: MarkItDown MCP

將 200 頁 PDF 以可讀取的 Markdown 呈現給 Claude

👤 有大量 PDF 工作流程的研究人員、律師和任何人 ⏱ ~15 min beginner

何時使用: 你需要討論 PDF 中的具體內容,但不想複製貼上頁面。

步驟
  1. 轉換
    Use markitdown. Convert ~/Downloads/whitepaper.pdf to Markdown. Tell me total length and section count.✓ 已複製
    → 回傳帶有目錄摘要的 Markdown
  2. 討論具體內容
    From section 3, what claims do they make about throughput? Quote the exact lines.✓ 已複製
    → 帶章節參照的直接引用
  3. 與另一份文件比較
    Now convert competitor.pdf the same way. Compare their throughput claims.✓ 已複製
    → 每份文件的聲明對照表

結果: 兩份 PDF 已讀入、比較,並可在對話中引用。

注意事項
  • 掃描的 PDF 輸出為空 — MarkItDown 執行基本 OCR——對於純圖片 PDF,先在上游執行 OCR
搭配使用: filesystem

將任何 URL 轉換為乾淨的 Markdown,無需瀏覽器爬取

👤 想要透過 URL 讀取文章或文件的任何人 ⏱ ~10 min beginner

何時使用: 文章是動態渲染或有付費牆;你想要結構化輸出,而非原始 HTML。

步驟
  1. 擷取並轉換
    Use markitdown to convert https://example.com/long-article. Strip nav and footer.✓ 已複製
    → Markdown 格式的文章內文
  2. 摘要或引用
    Give me the core claim and the strongest evidence cited.✓ 已複製
    → 結構化摘要

結果: URL 轉換為推理級別的 Markdown。

注意事項
  • 重度 JS 的 SPA 回傳空白 — 對 SPA 使用瀏覽器型 MCP(browser-act、mcp-chrome),再導入 markitdown

批次將一個資料夾中的混合 Office 文件轉換為知識庫

👤 建立內部語料庫的知識運營、支援團隊 ⏱ ~30 min intermediate

何時使用: 你有一個包含混合文件的 Dropbox/SharePoint 資料夾,想讓它們全部可讀。

步驟
  1. 清查
    List ~/docs/ — group by extension. How many PDFs, DOCXs, PPTXs?✓ 已複製
    → 按副檔名的數量統計
  2. 全部轉換
    Convert every doc in ~/docs/ to Markdown into ~/docs-md/. Preserve folder structure.✓ 已複製
    → 帶有 .md 檔案的鏡像目錄樹
  3. 建立索引以供檢索
    Now give me a single index.md listing each doc's title and 2-line summary.✓ 已複製
    → 知識庫索引檔案

結果: 混合格式資料夾轉換為同質 Markdown 語料庫。

搭配使用: filesystem

組合

與其他 MCP 搭配,撬動十倍槓桿

markitdown-mcp + filesystem

讀取來源檔案後批次轉換

markitdown-mcp + office-word-mcp

將 Word 文件轉為 Markdown 編輯後再轉回

工具

此 MCP 暴露的能力

工具輸入參數何時呼叫成本
convert_to_markdown uri (file:// or http://) 任何你想以文字形式獲取的文件 0 (LLM hooks optional, paid)

成本與限制

運行它的成本

API 配額
不適用——本地執行
每次呼叫 Token 數
依情況而定——大型 PDF 可能產生數萬行 MD
費用
免費(MIT)。可選的 LLM/Whisper 鉤子另行計費。
提示
跳過大型附錄——若 SDK 支援,針對你的檔案類型轉換特定頁面範圍

安全

權限、密鑰、影響範圍

最小權限: filesystem-read outbound:url-fetch
憑證儲存: 預設無;LLM 鉤子需要各自的金鑰
資料出站: 你要求擷取的 URL;若啟用鉤子,則包含 LLM 端點

故障排查

常見錯誤與修復

罕見格式出現 ImportError

MarkItDown 有可選的額外套件:pip install markitdown[all] 以包含 youtube/azure-docs 等解析器

舊版 DOC 出現編碼錯誤

在 Office 中重新儲存為 DOCX 後再轉換;.doc 支援為盡力而為

表格看起來被壓縮

MarkItDown 保留表格結構,但 Claude 可能需要明確提示才能渲染——要求 HTML 表格模式

替代方案

MarkItDown MCP 對比其他方案

替代方案何時用它替代權衡
Docling / Unstructured你需要複雜科學文件的 PDF 版面保真度依賴更重;表格更精確
kreuzberg對掃描文件進行帶 OCR 的純文字擷取不同的優化目標

更多

資源

📖 閱讀 GitHub 上的官方 README

🐙 查看未解決的 issue

🔍 瀏覽全部 400+ MCP 伺服器和 Skills