Skip to main content
Glama

📸 screenshot-mcp

给 AI 装上一双眼睛 — 让 Claude Code 能截图、看图、自动清理的 MCP 服务器

License: MIT Node.js Platform MCP


这是什么?

screenshot-mcp 是一个 MCP (Model Context Protocol) 服务器,让 AI 助手(如 Claude Code)可以直接在你的 Windows 桌面上:

能力

说明

📷 截图

全屏截图、区域截图、活动窗口截图

👁️ 看图

读取图片让 AI 视觉分析

🗑️ 自动删图

按条件清理旧截图,用完即走

工作原理

┌──────────────────────┐         MCP 协议          ┌──────────────────────┐
│                      │◄──────────────────────►│                      │
│   Claude Code        │     tools/list           │   screenshot-mcp     │
│   (MCP 客户端)        │     tools/call           │   (MCP 服务器)       │
│                      │                          │                      │
│  "帮我看看桌面" ──────┼── screenshot ──────────►│  PowerShell .NET     │
│  "这个界面怎么样" ─────┼── screenshot_region ────►│  System.Drawing      │
│  "把截图删掉" ────────┼── cleanup ──────────────►│  fs.unlinkSync       │
└──────────────────────┘                          └──────────────────────┘
                                                           │
                                              ┌────────────┴────────────┐
                                              │   Windows 原生截图 API   │
                                              │   (无需额外工具)          │
                                              └─────────────────────────┘

Related MCP server: screen-capture-mcp

快速开始

前置要求

  • Windows 10/11(截图依赖 Windows GDI+)

  • Node.js 18 或更高版本

  • Claude Code(或其他 MCP 客户端)

安装

# 1. 克隆仓库
git clone https://github.com/你的用户名/screenshot-mcp.git
cd screenshot-mcp

# 2. 安装依赖
npm install

配置(选一种即可)

方式一:全局配置(推荐,所有项目生效)

编辑 ~/.claude.json(在 C:\Users\你的用户名\.claude.json),在 mcpServers 里添加:

"mcpServers": {
  "playwright": {
    "type": "stdio",
    "command": "npx",
    "args": ["@playwright/mcp", "--headless"],
    "env": {}
  },
  "screenshot-mcp": {
    "command": "node",
    "args": ["C:\\你的路径\\screenshot-mcp\\src\\index.js"]
  }
}

路径说明args 中的路径要改成你电脑上的实际路径,例如:

  • 项目在桌面:C:\Users\你的用户名\Desktop\screenshot-mcp\src\index.js

  • 项目在 D 盘:D:\projects\screenshot-mcp\src\index.js

方式二:项目级配置(仅当前项目生效)

在项目目录下创建 .claude/settings.json

{
  "mcpServers": {
    "screenshot-mcp": {
      "command": "node",
      "args": ["C:\\你的路径\\screenshot-mcp\\src\\index.js"]
    }
  }
}

方式三:.mcp.json 文件(自动发现)

在工作目录下创建 .mcp.json,Claude Code 会自动发现并加载:

{
  "mcpServers": {
    "screenshot-mcp": {
      "command": "node",
      "args": ["C:\\你的路径\\screenshot-mcp\\src\\index.js"]
    }
  }
}

验证配置是否生效

重启 Claude Code 后,随便说一句:

"你能用 screenshot-mcp 吗?"

如果配置正确,Claude 会回答"可以"并调用截图工具。

使用

配置好后,在 Claude Code 中直接说:

🗣️ "帮我截个图看看桌面" 🗣️ "截取当前活动窗口" 🗣️ "看看这张图片" 🗣️ "把刚才的截图删掉" 🗣️ "清理超过1小时的截图"


提供的工具

工具

说明

参数

screenshot

全屏截图

filename(可选,自定义文件名)

screenshot_region

区域/活动窗口截图

filename(可选),region(可选:"active_window""x,y,width,height"

view_image

读取图片给 AI 分析

path(必填,图片路径)

list_images

列出所有截图

limit(可选,默认 20)

delete_image

删除指定图片

path(必填)

cleanup

批量清理截图

older_than_hours(可选),pattern(可选,文件名前缀)


使用示例

截图 + AI 分析

你:帮我截个图,看看我桌面上有什么
Claude:(调用 screenshot 截图)
       (调用 view_image 看图)
      → 你桌面上有这些文件和文件夹……

截图指定区域

你:截取当前活动窗口
Claude:(调用 screenshot_region region="active_window")
      → 这是当前窗口的内容……

看完自动清理

你:把刚才的截图删掉
Claude:(调用 delete_image 删除指定文件)
      → 已删除

安全性

措施

说明

🛡️ 目录限制

delete_imagecleanup 只能操作 screenshots/ 目录下的文件

📦 文件大小限制

图片最大支持 20MB

🔒 本地存储

截图保存在本地 screenshots/ 目录,不会外传

🧹 自动清理

支持按时间批量清理,用完即删


技术栈

技术

用途

Node.js

运行环境

@modelcontextprotocol/sdk

MCP 协议实现

PowerShell .NET (System.Drawing)

Windows 原生截图

JSON-RPC 2.0

通信协议

纯 Windows 原生实现,无需任何第三方截图工具。


在 GitHub 上使用

如果你把这个项目放在 GitHub 上,别人克隆后会得到一份不带配置的源码。他们需要:

  1. 运行 npm install 安装依赖

  2. 在自己的 Claude Code 配置中注册这个 MCP 服务器

  3. args 中的路径改成自己机器上的实际路径


开源协议

MIT — 随便用,随便改,随便玩。


相关资源


screenshot-mcp — 给 AI 装上一双眼睛 👀

Available Tools

6 tools
cleanupA

Delete screenshots. Default: deletes all. Can filter by age or filename pattern.

ParametersJSON Schema
NameRequiredDescriptionDefault
patternNoOnly delete files matching this prefix pattern (e.g. 'screenshot-')
older_than_hoursNoDelete screenshots older than this many hours (0 = all, default: 0)

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses the destructive nature ('Delete') and the risky default (deletes all), but does not mention permanence, reversibility, or side effects such as whether files are moved to trash or permanently removed.

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?

Two sentences, front-loaded with the core action. Every word earns its place, and the default behavior is highlighted effectively.

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

Completeness3/5

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

The tool is simple, but without annotations or an output schema, the description should clarify side effects (e.g., permanent deletion) and success/failure behavior. The current description covers basic functionality but leaves out important operational details for a destructive operation.

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?

Schema description coverage is 100%, with parameters well-documented in the schema. The description adds a brief paraphrase of filters but does not add significant semantics beyond the schema.

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 action ('Delete screenshots') and resource (screenshots). It distinguishes from siblings like delete_image by indicating bulk deletion with filters, while delete_image likely handles individual images.

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 gives context on when to use: default deletes all, with options to filter by age or filename pattern. It does not explicitly compare to alternatives like delete_image, but the behavior is clear enough for an agent to infer bulk cleanup use.

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

delete_imageA

Delete a specific image file by path.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the image file to delete

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the action (delete) and the input (path) but does not disclose that deletion is likely permanent and irreversible, whether special permissions are required, or what happens if the path does not exist. This is a significant transparency gap for a destructive tool.

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 a single, concise sentence that contains no filler or irrelevant information. It is front-loaded with the action and resource, making it easy to process quickly.

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

Completeness3/5

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

The tool is simple (one parameter, no output schema), so the description is mostly adequate. However, it omits important operational context such as whether the deletion is permanent and whether errors are raised for non-existent paths. Given the lack of annotations, a bit more detail would make it complete.

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 input schema already describes 'path' as 'Absolute path to the image file to delete' with 100% coverage, so the description adds no additional semantic meaning. The baseline of 3 applies because the schema handles the parameter documentation adequately.

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 uses a specific verb ('delete'), identifies a precise resource ('image file'), and clearly scopes the action to a single file identified 'by path'. This differentiates it from sibling tools like 'cleanup' which likely handle bulk deletion, and from 'view_image'/'list_images' which are read operations.

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

Usage Guidelines3/5

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

The description implies the tool is for deleting a specific image when you have its path, but it does not explicitly state when to use this versus alternatives like 'cleanup' for bulk deletion, nor does it mention prerequisites like locating the path via 'list_images'. The guidance is implied rather than explicit.

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

list_imagesA

List all screenshot images in the screenshots directory, sorted by newest first.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of images to return (default: 20)

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description must carry the transparency burden. It discloses the sorting behavior ('newest first') but does not mention other behavioral aspects such as return format, read-only nature, behavior when the directory is empty, or any error conditions. For a simple list tool, this is adequate but not comprehensive.

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 a single sentence that is front-loaded with the action and scope. It contains no filler or redundant information. Every word contributes to the meaning.

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

Completeness3/5

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

The tool is a simple listing operation with one optional parameter and no output schema. The description covers the core behavior but does not specify what fields are returned for each image (e.g., file name, path, timestamp) or how the results are formatted. Given that an output schema is absent, the description falls short of fully documenting the tool's response.

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 input schema provides a complete description for the sole parameter 'limit' (100% coverage). The tool description adds no additional meaning or context beyond what the schema already specifies, so the baseline score of 3 is appropriate.

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's function: 'List all screenshot images in the screenshots directory, sorted by newest first.' It uses a specific verb ('list'), identifies the resource ('screenshot images'), and adds a scope detail ('screenshots directory'). This differentiates it from siblings like view_image or delete_image.

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

Usage Guidelines2/5

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

The description provides no explicit guidance on when to use this tool versus alternatives. It does not mention any exclusions, prerequisites, or refer to sibling tools like view_image or delete_image. The intended use case is implied but not stated.

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

screenshotA

Take a screenshot of the entire screen. Saves to local screenshots/ directory.

ParametersJSON Schema
NameRequiredDescriptionDefault
filenameNoOptional custom filename (without extension). Default: screenshot-{timestamp}.png

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the burden of disclosure. It reveals the key side effect: saving to a local screenshots/ directory. However, it omits other behavioral details such as whether it returns a path, behavior on headless environments, or handling of existing files.

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 two short sentences, front-loaded with the action, and every word adds value. No fluff or redundancy.

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

Completeness4/5

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

For a simple tool with one optional parameter and no output schema, the description covers the essential purpose and side effect. It is complete enough for an agent to understand what the tool does, though it could benefit from a note on what it returns (or not).

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?

Schema coverage is 100% for the single optional filename parameter, and the description adds no extra meaning beyond that. The baseline score applies since the schema already documents the parameter fully.

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 takes a screenshot of the entire screen, using a specific verb ('Take') and resource ('screenshot of the entire screen'). It distinguishes from the sibling tool 'screenshot_region' by explicitly mentioning 'entire screen'.

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

Usage Guidelines3/5

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

The description implies usage for full-screen captures but does not explicitly mention alternatives or when not to use it. The phrase 'entire screen' indirectly contrasts with screenshot_region, but no direct guidance or exclusions are provided.

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

screenshot_regionB

Take a screenshot of a specific screen region. Specify coordinates or use 'active_window'.

ParametersJSON Schema
NameRequiredDescriptionDefault
regionNoRegion: 'active_window' to capture the active window, or 'x,y,width,height' for a specific region
filenameNoOptional custom filename (without extension)

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It only states the action and input format, but does not mention that a file is saved, where it is saved, default filename behavior, or what the tool returns. This is a significant gap for a screenshot tool that likely creates image files.

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 a single, concise sentence with no redundant information, front-loading the core purpose and input method. It is well-structured and easy to parse.

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

Completeness2/5

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

Given the absence of annotations and output schema, the description is too thin to fully understand the tool's behavior, such as file output, naming defaults, and error handling. It does not explain what happens after the screenshot is taken or how the 'active_window' option behaves across platforms.

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 already provides 100% coverage with descriptions for both 'region' and 'filename,' and the description merely restates the region format without adding new details about coordinate systems, units, or default values. The 'filename' parameter is not mentioned in the description, so no added value beyond the schema.

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 takes a screenshot of a specific screen region, distinguishing it from the sibling 'screenshot' tool by emphasizing 'specific region.' It also mentions the two input modes, making the purpose unmistakable.

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

Usage Guidelines3/5

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

The description implies usage for capturing a defined screen area but does not explicitly contrast it with the sibling 'screenshot' tool, nor does it provide when-to-use/when-not-to-use guidance or exclusions. Users must infer that full-screen captures would use 'screenshot.'

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

view_imageA

Read an image file and return it for AI vision analysis. Supports PNG, JPG, GIF, BMP, WEBP.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the image file

TDQS

A3.9/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states that the tool reads a file and returns it, and which formats are supported. However, it does not describe the return format (e.g., base64, binary), error handling for missing/invalid files, or any safety constraints. The basic behavior is disclosed, but important details are omitted.

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 one sentence plus a short format list. It is front-loaded with the core action and purpose, with no superfluous words. Every sentence earns its place.

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

Completeness3/5

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

For a simple read operation with one parameter and no annotations, the description covers the primary use case. However, with no output schema provided, it does not explain the exact return representation or how the image will be delivered for vision analysis. This is a significant gap for an agent deciding whether the tool will meet its needs.

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 input schema already fully documents the single 'path' parameter with the description 'Absolute path to the image file.' The tool description adds no additional parameter-level meaning beyond the schema, so the baseline of 3 applies. Supported formats are a tool-level trait, not parameter semantics.

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's function: 'Read an image file and return it for AI vision analysis.' It uses a specific verb ('read') and resource ('image file'), and distinguishes itself from siblings like screenshot (captures new images) and delete_image (removes files). The list of supported formats adds specificity.

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 context is clear: use this tool when you need to analyze an existing image file with AI vision. It does not explicitly name alternatives or exclusions, but the purpose is distinct enough from sibling tools (screenshot, screenshot_region) that an agent would not confuse them. The description implies it is for reading pre-existing files, not capturing new ones.

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

TDQS

A4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: full-screen capture, region capture, image viewing for vision, listing, specific deletion, and bulk cleanup. The only potential overlap is delete_image and cleanup, but cleanup is clearly bulk with filters, so boundaries are clear.

Naming Consistency4/5

Most tools follow a verb_noun pattern (view_image, list_images, delete_image), but screenshot, screenshot_region, and cleanup deviate slightly. The naming is still readable and predictable, with only minor inconsistencies.

Tool Count5/5

Six tools is well-scoped for a screenshot server, covering capture, viewing, listing, and deletion without unnecessary bloat. The count feels natural and each tool earns its place.

Completeness5/5

The server covers the full screenshot lifecycle: capture (full and region), view for AI analysis, list, delete specific, and cleanup. No obvious missing operations are apparent for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for capturing screen regions directly into Claude Code conversations via hotkeys or tool calls. It provides Windows-specific screen snipping with multi-monitor support, persistent storage, and automatic management of captured images.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Open-source screenshot tool for Windows with a built-in MCP server that allows AI assistants like Claude to capture and view screen content through tools like take_screenshot, ask_user_to_select_region, and more.
    3
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cai-cai-jun/screenshot-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server