Skip to main content
Glama

caido-screenshot-mcp

一个 MCP 服务器,通过驱动 Screenshot Mode 插件,捕获 Caido Replay 请求/响应对的格式化截图。

Caido 没有截图 API —— Screenshot Mode 是一个仅前端插件,在浏览器中将 DOM 渲染为 PNG。本服务器通过 Chrome DevTools 协议访问它,点击插件自身的导出功能,并在 Electron 打开保存对话框之前拦截生成的图像。输出的是插件的真实输出,直接写入磁盘。

要求

  • Node >= 22(使用内置的 WebSocket;没有 npm 依赖)

  • Caido 桌面版

  • 在 Caido 中安装 Screenshot Mode 插件

  • 使用 --remote-debugging-port 启动 Caido(见下文)

Related MCP server: Webshot MCP

安装

git clone <this-repo> caido-screenshot-mcp
cd caido-screenshot-mcp
npm link            # optional: puts `caido-screenshot` on your PATH

无需 npm install 步骤 —— 没有依赖。

使用调试端口启动 Caido

插件在 Caido 窗口内渲染,因此服务器需要与该窗口通信。正常启动 Caido 会保持端口关闭,所有调用都会失败。

caido-screenshot launch          # quits nothing; starts Caido with the port open

或手动操作:

# macOS
open -a Caido --args --remote-debugging-port=9222
# Linux
caido --remote-debugging-port=9222
# Windows
"%LOCALAPPDATA%\Programs\Caido\Caido.exe" --remote-debugging-port=9222

一次性检查所有内容:

caido-screenshot doctor

与 Claude Code 一起使用

claude mcp add caido-screenshot --scope user -- node /absolute/path/to/caido-screenshot-mcp/src/server.mjs

重启 Claude Code。然后直接询问:"screenshot the current Caido replay session"。

与任何 MCP 客户端一起使用

{
  "mcpServers": {
    "caido-screenshot": {
      "command": "node",
      "args": ["/absolute/path/to/caido-screenshot-mcp/src/server.mjs"]
    }
  }
}

工具:caido_screenshot

参数

类型

描述

out_path

string

PNG 保存位置。默认 ~/Downloads/caido-screenshot-<timestamp>.png

collection

string

包含会话的 Replay 集合。会自动展开。

session

string

要首先选择的 Replay 会话,按侧边栏名称(例如 GET /login)

session_id

string

精确的 Replay 会话 ID。优先使用,因为它无歧义。

require_response

boolean

拒绝仅请求的会话和过期的预览。默认 true。

inline

boolean

同时在结果中返回图像(较大)。默认 false

示例

服务器注册后,你无需指定工具名称。用自然语言描述你的需求,代理会自动选择。

仅捕获屏幕上的内容

screenshot the current Caido replay request

代理调用 caido_screenshot 并回复保存的路径:

Saved /Users/you/Downloads/caido-screenshot-2026-08-22T13-40-11-002Z.png (438 KB)

发送请求,然后捕获

这是常见用法。与官方的 Caido MCP server 配合使用,该服务器可以发送请求 —— 本服务器捕获结果。

send a GET to https://httpbin.org/get in Caido replay and screenshot it

代理发送请求,将返回的 Replay 条目映射到已填充的会话,并捕获该精确的会话 ID:

步骤

工具

服务器

1

caido_send_request

caido

2

caido_list_replay_sessions

caido

3

caido_screenshot(session_id: ...)

caido-screenshot

将 caido_send_request.entryId 与 caido_list_replay_sessions[].activeEntryId 匹配。不要从 requestSourceId 创建新会话作为响应证据:Caido 会填充请求模板,但不会复制完整的响应。

发送你编写的原始请求

粘贴原始 HTTP 并说明你的需求:

send this in Caido replay and screenshot it:

POST /post HTTP/1.1
Host: httpbin.org
Content-Type: application/json

{"user":"demo","token":"abc123"}

选择特定会话

会话在 Caido 侧边栏中以请求行命名,因此有 GET /、POST /login 等:

screenshot the "POST /login" replay session

这将变为 caido_screenshot(session: "POST /login")。每次捕获都使用 Side by Side 布局。

对于可靠的自动化,请使用会话 ID:

caido_screenshot(session_id: "67", require_response: true)

如果会话位于不同或折叠的集合中,请同时指定两者:

screenshot "01 admin create private conversation" from the "OBS AI Assistant IDOR - Fresh Evidence" collection

这将变为 caido_screenshot(collection: "OBS AI Assistant IDOR - Fresh Evidence", session: "01 admin create private conversation")。工具会先展开集合,再选择会话,并以 Side by Side 布局捕获。

注意: caido_send_request 会根据请求行自动命名会话,因此多个目标可能最终都叫 GET /。如果需要无歧义地引用会话,请在捕获前在 Caido 中重命名会话。

保存到特定位置

screenshot it and save to ~/reports/login-flow.png

从 Codex 使用

启动交互式会话并以相同方式询问:

codex
> screenshot the current Caido replay session

Codex 首次会请求批准。要跳过此工具的提示,请添加到 ~/.codex/config.toml:

[mcp_servers.caido-screenshot.tools.caido_screenshot]
approval_mode = "auto"   # auto | prompt | writes | approve

codex exec(非交互式)将无法工作 —— 它强制 approval: never 并拒绝所有 MCP 工具调用,无论每工具设置如何。请使用交互式会话。

命令行

caido-screenshot                                   # current session -> ~/Downloads
caido-screenshot shot.png                          # explicit path
caido-screenshot shot.png --session "GET /login"
caido-screenshot shot.png --session-id 67
caido-screenshot shot.png --collection "Fresh Evidence" --session "01 admin request"
caido-screenshot doctor
caido-screenshot launch

环境

变量

默认值

描述

CAIDO_CDP_PORT

9222

Caido 的远程调试端口

CAIDO_CDP_TIMEOUT_MS

45000

每次调用的 CDP 超时

已知限制

这些是插件的属性,而非本服务器的:

  • 长内容会被截断。 Caido 的编辑器是 CodeMirror,它只渲染可见行。任何高于 Caido 窗口的内容都不在 DOM 中,无法捕获。非常长的响应可能输出空白;服务器会报错,而不是写入近乎空白的文件。

  • 头部可能被丢弃。 DOM 到图像的渲染有时会省略行,行号会出现可见的间隙。请将这些图像视为示意,而非字节精确的证据 —— 需要精确时请使用 Caido 自身的请求导出。

  • 布局固定为 Side by Side。 服务器故意不提供布局或排列选项,以确保每张证据截图具有相同的报告就绪格式。

  • 截图不会脱敏。 屏幕上的任何内容 —— Authorization、Cookie、Set-Cookie —— 都会被完整捕获。分享前请检查。

  • 默认拒绝仅请求的 Replay 会话。 当所选会话没有响应时,Screenshot Mode 可能保留之前的预览。仅在有意截取仅请求的截图时传递 --allow-no-response。

故障排除

消息

原因

Cannot reach Caido's debug port

Caido 未使用 --remote-debugging-port 启动。退出并运行 caido-screenshot launch。

Caido is showing the instance picker

在 Caido 窗口中点击本地实例的 Connect。

No Screenshot button in the Replay toolbar

没有打开 Replay 会话,或 Screenshot Mode 插件未安装/未启用。

No Replay collection matching "..."

使用 Replay 侧边栏中显示的精确集合名称。

No Replay session matching "..."

工具在提供 collection 时会展开它,然后如果没有精确匹配,会列出可见的会话名称。

has no rendered response

所选会话是从请求填充的,或尚未完成。捕获其 activeEntryId 等于发送结果的 entryId 的会话。

preview is stale

Screenshot Mode 显示了不同的主机/路径(或冲突的可见查询)。未保存任何内容;请使用填充的 session_id 重试。方案、编码、查询顺序、省略的查询标签以及 Screenshot Mode 0.8.1 缺失的 ? 分隔符都会自动规范化。

returned an empty image

内容过长无法渲染。捕获较短的请求/响应。

许可证

MIT

Available Tools

1 tool
caido_screenshotA

Capture a formatted screenshot of a Caido Replay request/response using the Screenshot Mode plugin. Requires Caido running with --remote-debugging-port (default 9222) and a Replay session open. Uses one consistent Side by Side layout, verifies the selected session, requires a rendered response by default, rejects stale previews, then saves a PNG and returns its path plus the verified request metadata.

ParametersJSON Schema
NameRequiredDescriptionDefault
inlineNoAlso return the image in the tool result (large). Default false.
sessionNoReplay session to select first, by the name shown in the sidebar (e.g. 'GET /login')
out_pathNoWhere to save the PNG. Defaults to ~/Downloads/caido-screenshot-<timestamp>.png
collectionNoReplay collection containing the session. The collection is expanded automatically.
session_idNoExact Replay session ID. Preferred over session name because it is unambiguous.
require_responseNoReject sessions without a rendered response to prevent stale evidence. Default true.

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of transparency. It discloses multiple behavioral traits: uses a specific layout, verifies the selected session, requires a rendered response by default, rejects stale previews, saves a PNG, and returns path plus metadata. This gives the agent a strong understanding of what happens during execution.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured, opening with the core action and then efficiently enumerating prerequisites and key behaviors. It avoids unnecessary verbosity while covering all essential aspects, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of the tool (multiple preconditions, specific layout, output behavior), the description provides sufficient context for an agent to decide when to use it. It clearly states the environment requirements, what is verified, and what is returned, without needing an output schema. The description is complete enough for operational use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema provides 100% coverage with detailed descriptions for each parameter, so the baseline is 3. The tool description does not add additional insight beyond the schema's parameter explanations; it merely references the default behavior of require_response without expanding on relationships or interdependencies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool captures a formatted screenshot of a Caido Replay request/response using the Screenshot Mode plugin, specifying the exact resource and action. It also distinguishes itself by mentioning the Side by Side layout and the plugin, which sets it apart from generic screenshot tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit preconditions for use (Caido running with --remote-debugging-port, Replay session open) and mentions key behaviors (requires rendered response, rejects stale previews). While it doesn't explicitly contrast with alternatives, the specific prerequisites and layout make the intended use case clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 1 tool updatev1.2.1
    • First observedcaido_screenshot

TDQS

A4.4/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion between tools. The tool has a single, clearly defined purpose (capturing a screenshot of a Caido Replay session), so an agent cannot misselect it.

Naming Consistency5/5

The single tool follows a consistent snake_case naming convention (caido_screenshot), which is clear and predictable. There is no mix of styles or verbs to create inconsistency.

Tool Count3/5

The server provides only one tool, which feels thin for a typical MCP server. However, the tool targets a very specific, narrow use case (Caido Replay screenshot capture), so the count may be appropriate for that focused purpose, but it is borderline.

Completeness4/5

The tool covers the core workflow of capturing a formatted screenshot from a Replay session, including verification and metadata return. There are minor gaps (e.g., no options for custom layout or output format), but for its stated purpose, it is essentially complete.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers