Clipboard to Supabase MCP Helper

1
  • Apple
  • Linux

Integrations

  • Can run as an Express HTTP server that exposes MCP endpoints via REST API for programmatic image uploading and file management.

  • Provides platform-specific integration for clipboard monitoring on Linux using xclip (X11) or wl-paste (Wayland), with systemd for auto-start functionality.

  • Provides platform-specific integration for clipboard monitoring and image capture on macOS using pngpaste, with LaunchAgents for auto-start functionality.

剪贴板到 Supabase MCP 助手

监视系统剪贴板的本地代理,将任何复制的图像上传到 Supabase Storage,然后将公共(或签名)URL 写回剪贴板。

特征

  • 零点击图片托管:复制图片,立即获取 URL
  • 低延迟:从复制到 URL 不到 800 毫秒
  • 跨平台:适用于 macOS、Windows 和 Linux
  • MCP 集成:将剪贴板图像上传公开为 MCP 端点
  • 自动启动:配置为在系统启动时运行
  • 高效检测:基于哈希的重复数据删除,CPU 使用率低

先决条件

  • Node.js 18+
  • 已启用存储的 Supabase 帐户
  • 特定于平台的依赖项:
    • macOS: pngpastebrew install pngpaste
    • Windows/Linux:本机操作系统剪贴板访问

安装

  1. 克隆存储库:
git clone https://github.com/martinbowling/clipboard-to-supabase-mcp-helper.git cd clipboard-to-supabase-mcp-helper
  1. 安装依赖项:
npm install
  1. 根据.env.example创建.env文件:
SUPABASE_URL=https://<project>.supabase.co SUPABASE_SERVICE_ROLE_KEY=your-service-role-key BUCKET=media MCP_PORT=3333
  1. 测试您的 Supabase 连接:
npm run test:supabase
  1. 构建项目:
npm run build
  1. 安装为系统服务:

对于 macOS:

npm run install:macos

对于 Linux:

npm run install:linux

对于 Windows:

npm run install:windows

用法

一旦安装并运行,该助手将:

  1. 监视剪贴板上的图像变化(每 300 毫秒轮询一次)
  2. 将任何复制的图像上传到您的 Supabase 存储桶
  3. 将公共 URL 放回剪贴板,准备粘贴

运行服务

剪贴板助手可以以两种模式运行:

标准输入输出模式(默认)
npm start

这将使用 StdioServerTransport 运行 MCP 服务器,非常适合命令行使用。

HTTP 模式
npm run start:http

这将在端口 3333(可配置)上运行一个 Express HTTP 服务器,并具有适当的 REST API 端点。

MCP 集成

该助手公开以下 MCP 端点:

上传剪贴板图像

使用 HTTP 服务器模式:

POST http://localhost:3333/mcp

请求正文:

{ "id": "1", "jsonrpc": "2.0", "method": "tool", "params": { "name": "upload_clipboard_image", "input": {} } }

回复:

{ "id": "1", "jsonrpc": "2.0", "result": { "content": [ { "type": "text", "text": "https://your-project.supabase.co/storage/v1/object/public/media/clips/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png" } ] } }
清理旧文件

该助手还提供一个 MCP 端点来手动触发旧文件的清理。

请求正文:

{ "id": "1", "jsonrpc": "2.0", "method": "tool", "params": { "name": "cleanup_old_files", "input": { "days": 30 } } }

回复:

{ "id": "1", "jsonrpc": "2.0", "result": { "content": [ { "type": "text", "text": "Cleanup completed: Deleted 5 files older than 30 days. Failed: 0." } ] } }

days参数是可选的。如果未提供,则将使用RETENTION_DAYS环境变量中的值。

工作原理

  1. 变化检测:每 300 毫秒轮询剪贴板并计算图像数据的 SHA-1 哈希值
  2. 重复数据删除:仅根据哈希比较处理新的或更改的图像
  3. 平台适配:使用特定于平台的方法来捕获剪贴板图像
  4. Supabase 集成:使用唯一的 UUID 将图像上传到您的 Supabase 存储桶
  5. MCP 端点:通过模型上下文协议向 AI 代理公开功能
  6. 自动清理:定期删除超过配置的保留期(默认值:30 天)的图像

特定平台的说明

macOS

  • 需要pngpaste :使用brew install pngpaste安装
  • 使用 LaunchAgents 实现自动启动

视窗

  • 使用 PowerShell 的 System.Windows.Forms.Clipboard 进行图像捕获
  • 使用 Windows 注册表实现自动启动

Linux

  • 使用 xclip (X11) 或 wl-paste (Wayland) 进行剪贴板访问
  • 使用 systemd 进行自动启动

发展

# Run with live reload (stdio mode) npm run dev # Run with live reload (HTTP mode) npm run dev:http # Build for production npm run build # Run stdio version npm start # Run HTTP version npm run start:http

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

本地代理监视您的系统剪贴板,自动将复制的图像上传到 Supabase Storage,并用公共 URL 替换剪贴板内容以便立即共享。

  1. 特征
    1. 先决条件
      1. 安装
        1. 用法
          1. 运行服务
          2. MCP 集成
        2. 工作原理
          1. 特定平台的说明
            1. macOS
            2. 视窗
            3. Linux
          2. 发展
            1. 执照

              Related MCP Servers

              • A
                security
                A
                license
                A
                quality
                This server provides tools for uploading images and videos directly to Cloudinary using Claude/Cline, facilitating resource management with customizable options like resource type and public ID.
                Last updated -
                1
                71
                4
                JavaScript
                MIT License
                • Apple
              • A
                security
                A
                license
                A
                quality
                This server generates placeholder image URLs from various providers, supporting input validation and integration with desktop applications like Claude and Cursor.
                Last updated -
                1
                6
                MIT License
              • A
                security
                A
                license
                A
                quality
                Provides AI assistants access to the macOS clipboard content, supporting text, images, and binary data via OSAScript.
                Last updated -
                1
                2
                TypeScript
                MIT License
                • Apple
              • -
                security
                F
                license
                -
                quality
                A multi-tenant service that automatically monitors Supabase database changes, generates OpenAI embeddings, and maintains synchronized vector search capabilities for each tenant's projects.
                Last updated -
                TypeScript

              View all related MCP servers

              ID: mux0dtwljv