AI工具截图服务

AI工具截图服务

提供屏幕截图功能的MCP服务器,支持AI工具捕获和处理屏幕内容。

快速入门

安装

通过以下步骤安装:

  1. 克隆仓库:git clone https://github.com/codingthefuturewithai/screenshot_mcp_server.git
  2. 进入目录:cd screenshot_mcp_server
  3. 使用UV安装:uv pip install -e . 或使用pip:pip install -e .

使用

命令行工具

运行命令截图并保存: screenshot_mcp_server-client output.jpg

程序调用

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

async with stdio_client(StdioServerParameters(command="screenshot_mcp_server-server")) as (read, write):
    async with ClientSession(read, write) as session:
        result = await session.call_tool("take_screenshot")
        # 处理截图数据

配置

  • 默认为stdio模式,适合命令行。
  • SSE模式适用于Web应用,运行命令:screenshot_mcp_server-server-sse --port 3001