shottr-mcp

shottr-mcp

An Effect-native MCP server that lets local agents silently capture macOS windows, displays, and exact regions, then produce Shottr-style PNGs with programmable annotations, backgrounds, padding, rounded corners, and shadows.

Category
访问服务器

README

shottr-mcp

An Effect-native MCP server that lets local agents silently capture macOS windows, displays, and exact regions, then produce Shottr-style PNGs with programmable annotations, backgrounds, padding, rounded corners, and shadows.

This is an AI-assisted project, developed collaboratively with coding agents and reviewed through automated type, integration, and image-processing tests.

Requirements

  • macOS
  • Node.js 22 or newer
  • Shottr 1.8 or newer installed at /Applications/Shottr.app
  • pnpm 11

Shottr needs Screen Recording permission. The app that launches this MCP server also needs:

  • Screen Recording to enumerate windows and capture exact regions.

Grant these in System Settings → Privacy & Security, then restart the MCP host.

Install

pnpm install
pnpm build

Use the absolute path to dist/main.js in an MCP client. For Codex:

[mcp_servers.shottr]
command = "node"
args = ["/absolute/path/to/shottr-mcp/dist/main.js"]

For clients using JSON configuration:

{
  "mcpServers": {
    "shottr": {
      "command": "node",
      "args": ["/absolute/path/to/shottr-mcp/dist/main.js"]
    }
  }
}

Run shottr_doctor after connecting. It reports the installed Shottr version and any permission action still needed.

Tools

  • shottr_doctor — check platform, Shottr, and window-metadata access.
  • shottr_list_windows — return visible windows in front-to-back order, optionally filtered by app name or bundle ID.
  • shottr_capture_window — silently capture one uniquely selected window without opening capture UI.
  • shottr_capture_fullscreen — silently capture the main display without opening capture UI.
  • shottr_capture_region — capture an exact macOS logical-coordinate rectangle.
  • shottr_annotate_image — add pen, spotlight, measurement, and text annotations to an existing PNG.
  • shottr_beautify_image — beautify an existing local image.

Capture tools always return inline PNG image content and metadata. They write a file only when given an absolute .png outputPath whose parent directory already exists.

Window selection

Use a returned window ID for the strongest targeting:

{
  "selector": { "windowId": 1234 }
}

Or select by an exact app name/bundle ID and optional case-insensitive title substring:

{
  "selector": {
    "app": "com.apple.Safari",
    "title": "Effect"
  }
}

If more than one window matches, the server returns candidates instead of guessing.

Window capture never activates an app or switches tabs. It captures only the pixels currently rendered in the selected visible window. A background browser tab cannot be captured pixel-accurately without making it visible, so agents must not focus it automatically; they should explain the limitation and wait until the user makes that tab visible.

Beautification

Before adding beautify, agents must ask the user to choose the background, padding, corner radius, and shadow settings. The server requires every choice explicitly and rejects partial styling instead of inventing visual values.

{
  "selector": { "app": "Safari" },
  "beautify": {
    "background": {
      "type": "image",
      "path": "/absolute/path/to/background.jpg"
    },
    "padding": 80,
    "cornerRadius": 20,
    "shadow": {
      "color": "#000000",
      "opacity": 0.2,
      "blur": 30,
      "offsetX": 0,
      "offsetY": 14
    }
  },
  "outputPath": "/absolute/existing/folder/safari.png"
}

Background images are center-cropped to cover. Solid and linear-gradient backgrounds are also supported:

{
  "background": {
    "type": "linearGradient",
    "from": "#7C3AED",
    "to": "#2563EB",
    "angle": 135
  },
  "padding": { "top": 48, "right": 64, "bottom": 48, "left": 64 },
  "cornerRadius": 20,
  "shadow": {
    "color": "#000000",
    "opacity": 0.2,
    "blur": 30,
    "offsetX": 0,
    "offsetY": 14
  }
}

Annotations

Capture tools accept an annotations array, and shottr_annotate_image applies the same annotations to an existing local image. Coordinates are normalized from 0 to 1 relative to the screenshot: (0, 0) is the top-left, (1, 1) is the bottom-right, and (0.5, 0.5) is the centre.

Draw a red pen stroke and place “Hello” in the centre:

{
  "annotations": [
    {
      "type": "pen",
      "points": [
        { "x": 0.1, "y": 0.2 },
        { "x": 0.3, "y": 0.1 },
        { "x": 0.5, "y": 0.2 }
      ],
      "color": "#FF0000",
      "width": 6
    },
    {
      "type": "text",
      "text": "Hello",
      "position": { "x": 0.5, "y": 0.5 },
      "color": "#FF0000",
      "fontSize": 32,
      "backgroundColor": "#FFFFFF"
    }
  ]
}

Spotlight the centre of the image:

{
  "type": "spotlight",
  "region": { "x": 0.3, "y": 0.25, "width": 0.4, "height": 0.5 },
  "shape": "ellipse",
  "dimOpacity": 0.7,
  "color": "#FFD60A",
  "width": 4
}

Measure the full width and height of a captured window:

{
  "annotations": [
    {
      "type": "measurement",
      "from": { "x": 0, "y": 0.05 },
      "to": { "x": 1, "y": 0.05 },
      "color": "#FF3B30",
      "width": 3,
      "fontSize": 24
    },
    {
      "type": "measurement",
      "from": { "x": 0.05, "y": 0 },
      "to": { "x": 0.05, "y": 1 },
      "color": "#FF3B30",
      "width": 3,
      "fontSize": 24
    }
  ]
}

Measurement labels default to the calculated image-pixel distance, such as 1440 px. The same values are returned in structured MCP metadata so agents can report dimensions without reading the pixels back from the image. Set label to override the visible text while preserving the calculated numeric result.

Behavior and privacy

Shottr exposes capture actions through URL schemes, but those actions can show capture UI and do not support headless coordinate targeting. Therefore captures use macOS screencapture for a silent agent workflow, and Shottr-style annotations and beautification are rendered locally with Sharp.

Every successful capture leaves the final PNG on the macOS clipboard, including beautified and exact-window fallback results, so it can be pasted immediately. Existing clipboard content is replaced, matching normal screenshot-tool behavior.

Images remain local. The server has no HTTP transport, upload tool, telemetry, or remote-background download support.

Development

pnpm check
pnpm test
pnpm build

Real Shottr capture is intentionally not part of the default test suite because it needs macOS permissions and captures visible user content. Run it explicitly when the current display is safe to capture:

pnpm test:e2e

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选