Skip to main content
Glama
DeckProbe MCP Server

DeckProbe MCP Server

Official
by deckflow

DeckProbe MCP 服务器

让智能体无需打开 PDF、Office 或 iWork 文件,即可探知其中内容。

CI npm License: MIT

安装 · 工具 · 配置 · 安全 · 工作原理 · DeckProbe

一个 MCP 服务器,将 DeckProbe —— 文档领域的 ffprobe —— 以 四个类型化工具的形式暴露出来。查询页数、幻灯片数、元数据、加密和 宏信号、结构或完整性,即可获得有界、确定性的 JSON 结果,其中包含置信度、证据和实测 I/O 开销。

不渲染任何内容,不运行宏,不跟随任何外部引用,也不 打开任何网络连接。将其指向不受信任的文件是安全的。

// probe { "path": "deck.pptx", "targets": ["slide_count"], "view": "values" }
{
  "schema_version": 2,
  "status": "ok",
  "driver": { "id": "powerpoint", "profile": "pptx" },
  "values": { "powerpoint.slide_count": 31 },
  "view": "values"
}

安装

无需预先安装任何内容 —— npx 会同时获取服务器和引擎。

Claude Code

claude mcp add deckprobe -- npx -y @deckflow/deckprobe-mcp

Claude Desktop、Cursor、VS Code、Zed 以及任何其他读取 mcpServers 的客户端

{
  "mcpServers": {
    "deckprobe": {
      "command": "npx",
      "args": ["-y", "@deckflow/deckprobe-mcp"]
    }
  }
}

如需固定版本安装,请执行 npm install -g @deckflow/deckprobe-mcp,并使用 deckprobe-mcp 作为命令。

需要 Node.js 20 或更高版本。引擎二进制文件以按平台区分的 可选依赖形式提供,支持 macOS、Linux(glibc 和 musl)以及 Windows 的 x86-64 和 ARM64 架构;在其他任何平台上,服务器会回退到同一引擎的 WebAssembly 编译版本,因此只要 Node 可用,npx 就能在任何地方工作。

Related MCP server: papyrus-mcp

工具

工具

用途

probe

获取单个文档的所有信息

probe_batch

在一次调用中盘点或分类多个文档

list_formats

支持哪些格式,以及支持范围到哪里为止

list_targets

某格式提供的精确目标名称

此外还有一个资源 deckprobe://schema,携带随运行中的引擎一起打包的报告 JSON Schema。

probe

{
  "path": "reports/q3.pptx",
  "targets": ["@summary", "@security"],  // presets, short names, or canonical names
  "level": "metadata",                   // header | metadata | deep
  "min_confidence": "high",              // low | medium | high | exact
  "target_confidence": { "slide_count": "exact" },
  "view": "report",                      // report | values
  "budget": { "max_physical_bytes": 8388608, "timeout_ms": 1000 }
}

targets 接受短名称(slide_count)、规范名称 (powerpoint.slide_count)以及预设:

预设

展开为

@header

仅容器身份 —— 格式、大小、扩展名匹配、加密标志

@summary

身份、常见元数据和主要结构

@security

加密、宏、签名、外部引用、活动内容

@structure

格式自有的计数、名称和尺寸

@assets

图像、媒体、预览、字体、嵌入对象

@quality

完整性、修复、扩展名匹配、一致性

@format

当前级别下所有格式特定的目标

@all

当前级别下所有可用的目标

@summary 刻意省略了需要完整读取文件才能得到的统计信息。PDF 的 page_count 就是典型例子 —— 请显式请求它。

probe_batch

{ "paths": ["a.pdf", "b.pptx", "c.xlsx"], "targets": ["@security"] }

一个引擎进程处理整个批次。结果按输入顺序返回, 每个结果都带有自己的报告或自己的错误,因此一个坏文件永远不会破坏整个运行。 默认使用紧凑的 values 视图。仅支持字面路径 —— 请自行展开通配符。

list_formats 和 list_targets

list_targets 接受一个 format(pdf、docx、xlsx、pptx、doc、xls、 ppt、key、numbers、pages),并返回每个目标的别名、 描述、值类型、最低级别、开销类别和选择器成员资格。 传入 detail: "full" 可获取引擎的完整报告,包括每个目标的 JSON Schema 片段和展开的选择器列表。

两者都会在服务器进程的整个生命周期内缓存。

阅读报告

工具结果就是引擎自身的 schema-v2 信封,未做任何修改。在消费它之前, 有两件事值得了解:

  • status: "partial" 不是失败。 它意味着至少有一个请求的 目标无法在请求的置信度下被解析。该目标会在 execution.unresolved_targets 中被点名,而所有其他结果仍然有效。

  • confidence_score 是每个标签的固定常量(0.4、0.7、0.95、 1.0),不是校准后的概率。0.95 并不意味着该值在 95% 的情况下是正确的。

只有状态为 resolved 或 estimated 的结果才带有 value。unknown 很常见, 通常意味着文档根本没有记录该事实。

失败的调用会返回 isError,其中包含引擎的错误信封,外加一行 说明该如何处理。服务器在引擎运行之前自行引发的失败 —— 路径缺失、目录、 允许列表之外的路径、超出截止时间 —— 使用相同的信封形状,带有 MCP_ 前缀的代码和 origin: "mcp-server"。

配置

每个设置都是一个环境变量,在客户端的 MCP 配置中设置。 所有变量都是可选的。

变量

默认值

含义

DECKPROBE_MCP_BIN

–

要使用的引擎二进制文件,替代随附的二进制文件

DECKPROBE_MCP_ROOTS

不受限制

允许的目录,按 PATH 的方式分隔

DECKPROBE_MCP_TIMEOUT_MS

30000

引擎进程的每次调用硬性截止时间

DECKPROBE_MCP_MAX_CONCURRENCY

4

并发引擎进程数

DECKPROBE_MCP_MAX_BATCH

64

一次 probe_batch 调用接受的路径数

{
  "deckprobe": {
    "command": "npx",
    "args": ["-y", "@deckflow/deckprobe-mcp"],
    "env": { "DECKPROBE_MCP_ROOTS": "/Users/me/Documents:/Users/me/Downloads" }
  }
}

安全

DeckProbe 专为不受信任的输入而构建:有界解析、无渲染器、无宏 解释器、无外部引用解析、无网络访问。此 服务器在此基础上增加了两项内容。

  • 进程隔离和硬性截止时间。 每次探测都在自己独立的 短生命周期进程中运行,如果超过 DECKPROBE_MCP_TIMEOUT_MS 则被终止。

  • 可选的读取允许列表。 DECKPROBE_MCP_ROOTS 固定了可访问的 目录树;路径在检查前会先解析符号链接,因此链接无法绕过它。 默认是不受限制的,与用户自己可以运行的 CLI 一致 —— 请在共享或自动化部署中设置它。

报告描述文档(元数据、计数、信号),而不是重现其 内容。请注意,报告值(如文档标题)仍然是攻击者控制的字符串: 服务器将它们作为 JSON 数据传递,绝不会将它们插入到指令中, 消费者应以同样的方式对待它们。

请按照 SECURITY.md 中的描述私下报告漏洞。

工作原理

MCP client
    │  JSON-RPC over stdio
    ▼
deckprobe-mcp ── validates arguments, resolves the path, maps the result
    │  argv + stdout (one process per probe, or one --jsonl process per batch)
    ▼
DeckProbe engine ── plans the cheapest paths that answer the request

服务器启动原生 DeckProbe CLI,而不是调用 WebAssembly 构建。CLI 只读取探测计划所需的字节范围,而 WebAssembly 路径会将整个文件保存在内存中,并且独立的操作系统进程既能 隔离不受信任的解析,也可以被直接终止。引擎按以下顺序选择:

  1. DECKPROBE_MCP_BIN

  2. 随此包的 @deckflow/deckprobe 依赖一起提供的二进制文件

  3. PATH 上的 deckprobe

  4. 随附的 WebAssembly 引擎

解析到的引擎会在启动时记录到 stderr。stdout 属于 MCP 传输层,不携带任何其他内容。

MCP 服务器还是智能体技能?

DeckProbe 还附带一个 Agent Skill, 用于教会具备 shell 能力的智能体直接使用 CLI。两者教授相同的 词汇表。当智能体拥有 shell 且你想要 CLI 的完整 功能面时,请使用该技能;当它没有 shell 时,或者当你希望在引擎运行之前 验证类型化参数时,请使用此服务器。

开发

npm install
npm test          # typecheck, lint, build, and the full suite
npm run test:watch

欢迎贡献 —— 请参阅 CONTRIBUTING.md。设计 理由,包括被否决的备选方案,见 docs/rfc.md。

许可证

MIT。请参阅 LICENSE。

Available Tools

4 tools
list_formatsList supported formatsA
Read-onlyIdempotent

List the document formats DeckProbe can inspect: drivers, the extensions each one handles, and where support stops. Call this when you are unsure whether a file type is supported at all.

Inputs: no named parameters.

list_targetsList targets for a formatA
Read-onlyIdempotent

List every target a format supports, with its aliases, value type, minimum probe level, cost class, and which @selectors include it. Call this before naming a target you have not already seen — probe rejects an unknown one rather than guessing.

Inputs: format (required), detail.

probeProbe a documentA
Read-onlyIdempotent

Read facts about one local PDF, Microsoft Office, or Apple iWork document without opening or rendering it: page, slide, and sheet counts; title, author, and dates; encryption, macro, signature, and active-content signals; structure; embedded assets; and integrity. Handles .pdf, .docx/.xlsx/.pptx, legacy .doc/.xls/.ppt, and modern .key/.numbers/.pages.

Start with targets ["@summary"], or ["@security"] to triage an untrusted file. Prefer this over unzipping the document or parsing its bytes by hand.

Reports facts ABOUT the document, never its text: it does not extract, render, run macros, follow external references, or open a network connection.

Inputs: path (required), view, level, budget, +3 more. Returns: A DeckProbe schema-v2 envelope. See the deckprobe://schema resource.

probe_batchProbe several documentsA
Read-onlyIdempotent

Probe many local documents in one call — inventory a folder, triage a batch of uploads, or compare a set of files. One engine process handles the whole batch, so this is much cheaper than calling probe once per file.

Takes literal paths; expand any glob yourself first. Returns one entry per path, in the order given, each carrying that file's report or its own error envelope. A file that fails does not affect the others.

Defaults to the compact "values" view because inventory rarely needs per-target evidence; pass view: "report" when it does.

Inputs: paths (required), view, level, budget, +2 more. Returns: reports

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.7/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a wholly distinct purpose: probe handles a single file, probe_batch handles multiples, list_formats enumerates supported file types, and list_targets enumerates probe targets. There is no overlap or ambiguity between them.

    Naming Consistency5/5

    All tools follow a consistent lowercase_snake_case convention with clear verb prefixes: probe, probe_batch, list_formats, list_targets. The naming style is uniform and predictable, making the tool set easy to reason about.

    Tool Count5/5

    With exactly 4 tools, the server is tightly scoped for its purpose of document inspection. Each tool fills a necessary role (single file, batch, format discovery, target discovery) without redundancy or bloat, fitting well within the ideal 3–15 range.

    Completeness5/5

    The surface covers all core workflows: probing an individual file, probing many files efficiently, discovering supported formats, and enumerating probe targets for a given format. There are no obvious dead ends or missing operations for the server's stated purpose.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Inspects documents for tampering, ineffective redactions, and text aimed at language models before they enter an agent's context, and compares documents to confirm whether they are unchanged.
      4
      78 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to inspect and convert PDF, PowerPoint, Excel, and many other file formats into clean, structured Markdown, with chunking support for long documents.
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI agents to inspect and work with PDF files entirely on the local machine, covering page counts, metadata, layout, encryption permissions, scan-vs-text detection, and page rendering. Generated results land in a temporary workspace as short artifact ids that can be chained between tools and exported to real folders on request.
      12
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Lets AI agents know things about files without reading them, supporting outline, search, slicing, SQL, log clustering, diffs, validation, and extraction for formats like PDF, DOCX, PPTX, XLSX, CSV, logs, and code.
      MIT