mcpField
D
distill-mcp

distill-mcp

本地服务
github.com/lakshgk生产力029 周前更新

关于 distill-mcp

distill-mcp 是一个 MCP 服务,可将本地文档转换为精简 Markdown,供 LLM 处理。轻量和 Docker 模式支持的格式与转换能力不同。

主要功能

  1. 01文档转 Markdown
  2. 02轻量与 Docker 模式
  3. 03完整模式支持扫描 PDF OCR
  4. 04完整模式支持音频转换
  5. 05本地处理文档

适用场景

  1. 01为 LLM 分析准备办公文档
  2. 02在完整模式转换扫描 PDF
  3. 03在完整模式转换音频文件

MCP 相关

它通过 `convert_and_save` 工具向 MCP 客户端提供文档转换功能。客户端可使用返回的 Markdown,而非直接读取原文件。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"lakshgk-distill": {
"command": "npx",
"args": [
"-y",
"distill-mcp-server"
]
}
}
}
启动命令npx -y distill-mcp-server

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmdistill-mcp-server0.1.1

工具

还没有获取到工具列表

本地服务需要在你的电脑上运行后才能读取工具,维护者暂未提供工具列表。

详细介绍

distill-mcp

npm version license MCP Registry

一个 MCP 服务,可将任何兼容 MCP 的客户端连接到 Distill,在大模型读取本地文档前,将其转换为简洁且节省 Token 的 Markdown。 与原始文档文本相比,通常可减少 40–80% 的 Token,让模型的上下文窗口容纳更多内容,并更快地进行推理。

支持 Claude Desktop、Claude Code、Cursor、Windsurf,以及任何支持工具调用的其他 MCP 客户端。

两种模式

轻量模式完整模式(Docker)
是否需要 Docker否是
DOCX、XLSX、PPTX、原生 PDF、HTML是是
扫描版 PDF(OCR)否是
音频(MP3、WAV 等)否是
质量评分否是
安装时间~2 分钟~10 分钟

轻量模式仅需 Python 和 pip。完整模式需要 Docker,并运行 Distill 服务。详情请参阅设置指南。

快速安装

无需全局安装:

npx -y distill-mcp-server

然后配置 Claude Desktop——分步说明请参阅轻量模式设置或完整模式设置。

配置

将该服务添加到你的 claude_desktop_config.json。

轻量模式 — macOS / Linux:

{
  "mcpServers": {
    "distill-mcp": {
      "command": "npx",
      "args": ["-y", "distill-mcp-server"],
      "env": {
        "DISTILL_MCP_CONFIG": "{\"mode\":\"lightweight\",\"python_path\":\"python3\"}"
      }
    }
  }
}

轻量模式 — Windows:

{
  "mcpServers": {
    "distill-mcp": {
      "command": "npx",
      "args": ["-y", "distill-mcp-server"],
      "env": {
        "DISTILL_MCP_CONFIG": "{\"mode\":\"lightweight\",\"python_path\":\"py\"}"
      }
    }
  }
}

完整模式 — 所有平台:

{
  "mcpServers": {
    "distill-mcp": {
      "command": "npx",
      "args": ["-y", "distill-mcp-server"],
      "env": {
        "DISTILL_MCP_CONFIG": "{\"mode\":\"full\",\"distill_url\":\"http://localhost:7860\"}"
      }
    }
  }
}

完整的配置项参考请见设置指南: 轻量模式 | 完整模式

CLAUDE.md 代码片段

将此内容粘贴到项目的 CLAUDE.md,让 Claude 知道如何自动使用该工具。请原样复制下面的代码块:

## Document Conversion — distill-mcp

When the user references a local file path (e.g. a PDF, DOCX, PPTX, XLSX,
HTML, or audio file), ALWAYS call the `convert_and_save` tool before reading
or reasoning about the document. Do not read the original file directly via
filesystem tools — use only the Markdown returned by `convert_and_save` as
the document content.

### Rules

1. Call `convert_and_save` with the absolute file path before doing anything
   else with the document.
2. Use ONLY the Markdown output from `convert_and_save` as the document
   content. Never read the original file with filesystem tools.
3. If the response includes `"overwritten": true`, tell the user that a
   previous cached version was replaced before proceeding.
4. If the response includes any `warnings`, surface them to the user before
   proceeding with the document content.
5. If `convert_and_save` returns an unsupported format error, tell the user
   which formats are supported and suggest switching modes if applicable.

### Supported formats

| Category | Lightweight | Full (Docker) |
|---|---|---|
| Word | .docx, .doc, .odt | .docx, .doc, .odt |
| Excel | .xlsx, .xlsm, .csv | .xlsx, .xlsm, .csv |
| PowerPoint | .pptx, .ppt | .pptx, .ppt |
| PDF | .pdf (native text) | .pdf (native + scanned OCR) |
| HTML | .html, .htm | .html, .htm |
| Audio | — | .mp3, .wav, .m4a, .flac, .ogg |
| Other | — | .epub, .json, .sql, .wsdl, .wsd |

### Usage

Say "convert using distill" followed by the file path:
> Convert using distill C:\Users\me\Documents\report.pdf to markdown

也可在 docs/CLAUDE.md-snippet.md 中找到该代码片段。

支持的格式

类别扩展名轻量模式完整模式
Microsoft Word.docx、.doc、.odt是是
Microsoft Excel.xlsx、.xlsm、.csv是是
Microsoft PowerPoint.pptx、.ppt是是
PDF(原生文本).pdf是是
PDF(扫描版/OCR).pdf否是
HTML.html、.htm是是
音频.mp3、.wav、.m4a、.flac、.ogg否是
EPUB.epub否是
JSON.json否是
SQL.sql否是
WSDL.wsdl、.wsd否是

隐私

所有处理都在本地进行。在轻量模式下,文档由你电脑上的 distill-core Python 库转换——数据不会离开你的电脑。在完整模式下,文档会发送到你电脑上本地运行的 Distill Docker 服务——不会向外部服务发送数据。

构建基础

Distill — 文档转 Markdown 的转换引擎。

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。