/ 目录 / 演练场 / Kreuzberg
● 社区 kreuzberg-dev ⚡ 即开即用

Kreuzberg

作者 kreuzberg-dev · kreuzberg-dev/kreuzberg

通过Rust核心MCP从PDF、Office文档、图像和97多种其他格式中提取干净的文本、表格和元数据。

Kreuzberg是一个多语言文档情报框架。MCP服务器包装核心Rust管道: Claude调用它从任何文档格式中提取结构化内容,而无需外包到Unstructured/Tika/pdfplumber。在一次调用中处理扫描PDF、表检测和元数据的OCR。

为什么要用

核心特性

实时演示

实际使用效果

kreuzberg.replay ▶ 就绪
0/0

安装

选择你的客户端

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

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

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

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

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

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

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

格式与 Claude Desktop 相同。重启 Windsurf 生效。

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

Continue 使用服务器对象数组,而非映射。

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

加入 context_servers。Zed 保存后热重载。

claude mcp add kreuzberg -- uvx kreuzberg-mcp

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: Kreuzberg

从凌乱的PDF中提取表格到干净的扣分项

👤 处理报告PDF的分析师 ⏱ ~10 min beginner

何时使用: 您有一个PDF ,其中包含pdftotext修饰的表格,您不想重新键入它们。

前置条件
  • MCP已安装uvx kreuzberg-mcp —或通过claude mcp add添加
步骤
  1. 提取
    使用kreuzberg提取/docs/2025-annual-report.pdf。将表格分别作为扣分项和正文文本提供给我。✓ 已复制
    → 使用保留的标题清理降价表
  2. 验证
    对于“按细分市场的收入”表,核对列总计。标记任何OCR误读。✓ 已复制
    → 带标记单元格的算术检查

结果: 您可以将Markdown表粘贴到文档中,无需返工。

注意事项
  • 扫描PDF — OCR错误6比8 — 使用OCR置信度输出并手动重新扫描低置信度单元格
搭配使用: filesystem

导入混合格式文档的文件夹以进行下游索引

👤 工程师构建抹布管道 ⏱ ~30 min intermediate

何时使用: 客户端为您提供一个包含PDF、Word文档、PowerPoint的ZIP ,并且您需要纯文本进行嵌入。

前置条件
  • 文件系统MCP作用域到文件夹 — 启动以摄取目录为根目录的fs MCP
步骤
  1. 库存
    列出/ingest/下的每个文件。对于每个,请调用kreuzberg.detect_format并报告。✓ 已复制
    → 每文件格式表
  2. 散装提取物
    对于每个文件,提取文本+元数据。在原始文件旁边写入已清除的.txt ,并写入带有元数据的manifest.json。✓ 已复制
    → 已处理所有文件;清单包含每个条目
  3. 质检单
    列出提取返回< 100个字符的每个文件—这些文件可能已扫描或已损坏。强制OCR重新运行。✓ 已复制
    → 识别低内容文件并重试

结果: 准备好嵌入的已清除文本文件的文件夹,其中包含元数据清单。

注意事项
  • 加密PDF — Kreuzberg返回错误—使用qpdf解密或要求解锁副本
搭配使用: filesystem · memory

组合

与其他 MCP 搭配,撬动十倍杠杆

kreuzberg + filesystem

Walk a folder and extract every doc in place

For each PDF under /docs, extract text and save as .md next to it.✓ 已复制
kreuzberg + memory

Ingest extracted content into a knowledge graph

Extract /contracts/*.pdf and store key terms in memory for cross-doc querying.✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
extract_text path: str, ocr?: bool 主要提取呼叫 free
extract_metadata path: str 只想要没有正文的元数据 free
extract_tables path: str 以表格为中心的提取 free
detect_format path: str 提取前确认格式 free

成本与限制

运行它的成本

API 配额
Unlimited — local
每次调用 Token 数
Proportional to doc size; a 20-page PDF ≈ 8k tokens of output
费用
Free (open source)
提示
Use extract_metadata first on large files to avoid processing irrelevant ones

安全

权限、密钥、影响范围

凭据存储: None for local mode
数据出站: None — all processing is local

故障排查

常见错误与修复

ModuleNotFoundError: tesseract

Install Tesseract system binary: brew install tesseract / apt install tesseract-ocr

验证: `tesseract --version`
Empty output on PDF

Likely image-only PDF — re-run with ocr=true

验证: Check output.metadata.has_text_layer
XLSX tables come out jumbled

Pass sheet name explicitly: tool supports sheet arg

替代方案

Kreuzberg 对比其他方案

替代方案何时用它替代权衡
markdownify-mcpYou want a lighter, Node-based converter without OCRFewer formats, no table preservation
Unstructured.ioYou need enterprise PDF parsing and accept the cloud costPaid; cloud-hosted

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills