OpenScreenShot

io.github.PGHQdev由 GitHub 帳號 PGHQdev 發布v2.5.2更新於 Oct 29, 2026

Capture website screenshots (viewport or full page) with local Chrome, or on OpenScreenShot Cloud.

已驗證Streamable HTTP可網頁執行瀏覽器自動化開發者工具

概覽

AI 產生的概覽

OpenScreenShot 使用本機 Chrome(或可選的 OpenScreenShot Cloud)擷取公開網頁的 PNG 截圖,並可在截圖前遮蔽敏感內容。

可以做什麼
  • 擷取公開網頁的 PNG 截圖,可選視窗大小或整頁,並可指定寬高
  • 截圖前遮蔽:用黑框蓋住 CSS 選擇器符合的元素、電子郵件/電話/金鑰類文字或指定像素矩形
  • 以圖片內容形式把截圖直接回傳給 MCP 用戶端,而不是寫入檔案
  • 開啟雲端模式時改由 OpenScreenShot Cloud 算圖
適用情境
適合需要讓助理真正「看到」頁面樣貌的情境:檢查剛建置或修改的頁面、擷取文件、狀態頁或預備環境建置,或為版本說明與事故報告產生截圖。
執行需求
本機模式需要 Node.js 22.12 以上版本,以及已安裝的 Chrome、Chromium 或 Edge;非標準路徑可用 CHROME_PATH 指定。可作為透過 npx 啟動的本機 stdio 程序,也可使用遠端 Streamable HTTP 端點。雲端模式需要 auth login 流程取得的 API 金鑰或 OPENSCREENSHOT_API_KEY 環境變數,遠端端點則使用 Authorization bearer 標頭。
安裝前請注意
雲端模式會把網址與選項送到 OpenScreenShot Cloud 並在其伺服器上算圖;本機模式不會向廠商傳送任何內容。回傳的圖片會交給 MCP 用戶端,若用戶端使用託管模型,圖片可能被送往該模型供應商,因此敏感資料應使用遮蔽——但樣式比對可能漏掉被拆開、繪製在畫布中或格式未知的文字,分享前請先檢視圖片。無頭瀏覽器以 --no-sandbox 執行,只擷取可信的網址。雲端服務依方案計量。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 OpenScreenShot,將其新增到工作區。
  2. 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.PGHQdev%2Fopenscreenshot/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "openscreenshot": {
      "type": "http",
      "url": "https://cloud.openscreenshot.app/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

[圖片]

openscreenshot

Website screenshots from your terminal, your CI, or your AI agent.

A local CLI and MCP server. It drives the Chrome already on your machine.
Local by default, with no account and no API key. OpenScreenShot Cloud is optional.

[npm] [npm downloads] [License] [Node]

[openscreenshot MCP server – quality and maintenance score on Glama]

Website · CLI guide · MCP guide · Report a bug


Quick start

sh
npx openscreenshot shot https://example.com --out example.png --full

That opens a headless Chrome, loads the page, saves a full-page PNG, and closes the browser.

You need: Node.js 22.12 or newer, and Google Chrome, Chromium, or Microsoft Edge. The package ships no browser of its own, so the install stays small.

Package managerRun onceInstall globally
npmnpx openscreenshot shot <url>npm i -g openscreenshot
pnpmpnpm dlx openscreenshot shot <url>pnpm add -g openscreenshot
Bunbunx openscreenshot shot <url>bun add -g openscreenshot

Install globally to use the openscreenshot command everywhere. For CI, add it to the project instead (npm i -D openscreenshot), so each run uses the version in your lockfile.

CLI

openscreenshot shot <url> [--out <file>|-] [--full] [--width <n>] [--height <n>]                    [--redact <selector>]... [--redact-pattern <name>]... [--redact-rect <x,y,w,h>]...                    [--cloud [<base-url>]] [--key <api-key>] [--format <format>]openscreenshot auth login [--cloud <base-url>]openscreenshot auth logoutopenscreenshot serve
OptionDefaultWhat it does
<url>requiredThe page to capture. Use a full URL with https://.
--out <file>screenshot.pngWhere to write the PNG. Use - to write bytes to stdout.
--fulloffCapture the whole scrollable page, not only the viewport.
--width <n>1280Viewport width in pixels, from 200 to 3840.
--height <n>800Viewport height in pixels, from 200 to 2160.
--redact <selector>noneCover the elements that match a CSS selector. Repeat for more.
--redact-pattern <name>noneCover text that matches email, phone, or secret. Repeat, or use a comma list.
--redact-rect <x,y,w,h>noneCover a rectangle, in pixels of the output image. Repeat for more.
--cloud [<base-url>]offRender on OpenScreenShot Cloud. See Cloud.
--key <api-key>noneCloud API key (osc_live_…) for this run.
--format <format>pngWith --cloud: png, jpeg, webp, pdf, html, or markdown.

Examples

sh
# Full pageopenscreenshot shot https://example.com --out page.png --full
# Fixed desktop viewportopenscreenshot shot https://example.com --out desktop.png --width 1440 --height 900
# Narrow viewport to check a responsive layoutopenscreenshot shot https://example.com --out narrow.png --width 390 --height 844
# Pipe the PNG to another toolopenscreenshot shot https://example.com --out - > shot.png
# Cover the account menu, every email address, and a 200x40 area at the top leftopenscreenshot shot https://example.com --out safe.png --redact "#account-menu" --redact-pattern email --redact-rect 0,0,200,40

See Redaction for how it works and what it can miss.

Local output is always PNG. A .jpg or .pdf file name does not convert it. For other formats, use --cloud with --format.

A narrow viewport changes the layout width only. The CLI keeps a desktop user agent, so it does not emulate a phone's touch input or pixel ratio.

Exit codes

CodeMeaning
0The file was written.
1The capture failed, for example Chrome not found or a timeout.
2Bad usage or an option out of range.

Exit code 0 means the CLI saved the file. It does not prove that the page loaded correctly, so look at the image for error pages or loading spinners.

MCP server

openscreenshot with no arguments on a piped stdin starts a Model Context Protocol server over stdio, which is how an MCP client runs it. openscreenshot serve does the same and stays for existing configs. Your AI client starts it as a local process; there is no URL to enter.

Add it to your client

Clients that use an mcpServers object (Claude Desktop, Cursor, Windsurf, and others):

json
{  "mcpServers": {    "openscreenshot": {      "command": "npx",      "args": ["-y", "openscreenshot"]    }  }}

Claude Code:

sh
claude mcp add openscreenshot -- npx -y openscreenshot

Restart or reload the client after you save the config. The client must find npx (or pnpm, bunx) on its PATH.

Tool: capture_screenshot

InputTypeDefaultNotes
urlstring—Required. A full page URL.
fullPagebooleanfalseCapture the whole page.
widthinteger1280200 to 3840.
heightinteger800200 to 2160.
redactobject—Optional. See below.
cloudbooleanfalseRender on Cloud. See Cloud.
json
{ "url": "https://example.com", "fullPage": true, "width": 1440, "height": 900 }

redact has three optional lists:

FieldTypeWhat it covers
selectorsstring[]Elements that match each CSS selector.
patterns("email" | "phone" | "secret")[]Matching text in the page and in form values.
rects{ x, y, width, height }[]Rectangles, in pixels of the output image.
json
{  "url": "https://example.com",  "redact": {    "selectors": ["#account-menu"],    "patterns": ["email", "secret"],    "rects": [{ "x": 0, "y": 0, "width": 200, "height": 40 }]  }}

The tool returns the PNG as MCP image content (image/png). It does not write a file. To save a named file, use the CLI.

Redaction

Redaction puts black boxes over the targets in the page, and then takes the screenshot. The unredacted pixels never get into the PNG, so they never get to your MCP client or to a hosted model.

  • Selectors. The box covers the element and all of its children. If a selector matches no element, or is not valid CSS, the capture fails.
  • Patterns. email finds email addresses. phone finds numbers with 9 to 15 digits. secret finds common API key and token shapes (OpenAI, Anthropic, Stripe, GitHub, AWS, Slack, Google, JWT). It also finds any run of 32 or more letters, digits, and underscores that has both a letter and a digit, such as a hash. Patterns look in text and in the values of input, textarea, and select fields.
  • Rectangles. Use these for canvas, images, and cross-origin iframes, where selectors and patterns cannot look. A rectangle that is fully outside the image fails the capture.

When redaction is on, the tool pauses CSS animations, places the boxes, and takes the screenshot. Then it finds the targets again. If a target moved out of its box, the capture fails. A failed capture writes no file and returns no image.

Patterns can miss text. They do not find text split across elements, text drawn in a canvas or an image, or a format they do not know. They can also cover text that only looks like a match. Look at the image before you share it.

What it can and cannot capture

Each capture starts a fresh headless browser with an empty profile.

  • It can capture any page a signed-out visitor can see: public sites, docs, status pages, staging builds, and localhost dev servers.
  • It cannot see your cookies or signed-in sessions. A page behind a login shows the login screen.
  • It does not click, type, wait for a selector, or set cookies. Navigation waits until the network is quiet (networkidle2), for up to 30 seconds.

For signed-in pages, annotations, or PDF export, use the OpenScreenShot browser extension for Chrome and Firefox.

OpenScreenShot Cloud (optional)

OpenScreenShot Cloud is a hosted screenshot API. It renders the page on Cloud servers, so you do not need Chrome on the machine. Local mode stays the default and needs no account.

The free plan gives 100 captures per month and needs no card. A failed capture is free. Paid plans are on the pricing page.

Sign in

sh
openscreenshot auth login

The command prints a code, such as ABCD-EFGH, and opens https://cloud.openscreenshot.app/device in your browser. Sign in with the code that Cloud sends to your email, and approve the code. The CLI then stores an API key in ~/.openscreenshot.json. To use another Cloud base URL, add --cloud <url>. openscreenshot auth logout removes the stored key.

Cloud from the CLI

sh
# Full-page PNG, rendered on Cloudopenscreenshot shot https://example.com --out page.png --full --cloud
# PDF of the pageopenscreenshot shot https://example.com --out page.pdf --cloud --format pdf

--format accepts png, jpeg, webp, pdf, html, and markdown. --full, --width, and --height work as in local mode.

The CLI uses the first API key that it finds:

  1. --key osc_live_…
  2. The OPENSCREENSHOT_API_KEY environment variable
  3. The key that auth login stored

The base URL is --cloud <url>, then OPENSCREENSHOT_CLOUD_URL, then https://cloud.openscreenshot.app.

--redact, --redact-pattern, and --redact-rect work with --cloud. The Cloud server draws the black boxes before it returns the image. Redaction needs PNG output. As in local mode, a selector that matches nothing fails the capture, and you get no image.

Cloud from MCP

Set cloud: true on capture_screenshot to render on Cloud:

json
{ "url": "https://example.com", "fullPage": true, "cloud": true }

The server needs a key from openscreenshot auth login, or OPENSCREENSHOT_API_KEY in the server's env block. redact works in both modes.

Cloud also serves a remote MCP endpoint over Streamable HTTP, for clients that accept only a remote MCP URL:

  • URL: https://cloud.openscreenshot.app/mcp
  • Header: Authorization: Bearer <api-key>
  • Tool: capture_screenshot

Privacy in Cloud mode

With --cloud or cloud: true, the URL and the options go to OpenScreenShot Cloud, and the page renders on Cloud servers. Read the Cloud privacy policy. Local mode sends nothing to OpenScreenShot.

The Cloud API docs have every option.

Use cases

  • CI/CD: capture pages on every deploy for release notes, docs, or visual review. See the CI guide.
  • DevOps: snapshot dashboards and status pages into incident reports and runbooks from cron or a chat command.
  • AI agents: let an agent look at the page it just built or changed.

Troubleshooting

Chrome not found. The CLI checks the standard install paths on macOS, Linux, and Windows. If your browser is somewhere else, set CHROME_PATH to the executable file:

sh
CHROME_PATH=/usr/bin/chromium openscreenshot shot https://example.com

On Windows, Chrome installed for one user lives under %LOCALAPPDATA%, and Edge is not probed. Set CHROME_PATH for both. In an MCP client, set CHROME_PATH in the server's env block.

A script hangs on openscreenshot with no arguments. With no arguments and a piped stdin, the command starts the MCP server and waits for a client. It prints one line to stderr that says so. Run openscreenshot shot <url> for a capture.

Timeout. The page did not go quiet within 30 seconds. Pages with long-polling or streaming connections can do this.

Blank or half-loaded image. Some pages render after the network goes quiet. The CLI has no extra wait option yet.

Privacy and security

  • In local mode, everything runs on your machine. The package sends no telemetry and calls no OpenScreenShot server. It calls OpenScreenShot Cloud only for auth login, --cloud, or cloud: true.
  • In MCP mode, your client receives the image. If the client uses a hosted model, it may send the image to that model's provider. Use redact to cover data before the image leaves the tool.
  • The headless browser runs with --no-sandbox so it works in containers and CI. Capture only URLs you trust.

Links

MIT © OpenScreenShot @PGHQdev

來源:mcp/README.md,提交 3342946

工具

1

capture_screenshot

Capture a PNG screenshot of a public web page via the system Chrome, or on OpenScreenShot Cloud with cloud: true. Use redact to cover elements, text patterns, or rectangles with black boxes before the screenshot is taken, in either mode. The capture fails with no image if a selector matches nothing or the page changes during the capture.

輸入參數url必填cloudwidthheightredactfullPage

版本歷史

3
  1. v2.5.2最新Oct 21, 2026
  2. v2.5.1Oct 17, 2026
  3. v2.4.1Oct 13, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分