Clipboard to Supabase MCP server

Monitors your clipboard for images, automatically uploads them to Supabase Storage, and writes the public URL back to the clipboard for seamless sharing across platforms.
Back to servers
Provider
Martin Bowling
Release date
May 11, 2025
Stats
1 star

This MCP server monitors your system clipboard, automatically uploads copied images to Supabase Storage, and returns the public URL to your clipboard—making image sharing seamless and efficient with sub-800ms latency.

Prerequisites

  • Node.js 18+
  • Supabase account with Storage enabled
  • Platform-specific dependencies:
    • macOS: pngpaste (brew install pngpaste)
    • Windows/Linux: Native OS clipboard access

Installation

1. Clone and Setup

git clone https://github.com/martinbowling/clipboard-to-supabase-mcp-helper.git
cd clipboard-to-supabase-mcp-helper
npm install

2. Configure Environment

Create a .env file with your Supabase credentials:

SUPABASE_URL=https://<project>.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
BUCKET=media
MCP_PORT=3333

3. Test Connection and Build

npm run test:supabase
npm run build

4. Install as System Service

For macOS:

npm run install:macos

For Linux:

npm run install:linux

For Windows:

npm run install:windows

Usage

Basic Operation

Once installed and running, the helper automatically:

  • Monitors your clipboard for image changes (polling every 300ms)
  • Uploads any copied images to your Supabase bucket
  • Places the public URL back in your clipboard, ready to paste

Running the Service Manually

Stdio Mode (Default)

npm start

HTTP Mode

npm run start:http

This runs an Express HTTP server on port 3333 (configurable).

MCP Integration

Upload Clipboard Image

With HTTP server mode:

POST http://localhost:3333/mcp

Request body:

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

Response:

{
  "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"
      }
    ]
  }
}

Cleanup Old Files

Request body:

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

Response:

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

The days parameter is optional and defaults to the value in the RETENTION_DAYS environment variable.

Platform-Specific Notes

macOS

  • Requires pngpaste: Install with brew install pngpaste
  • Uses LaunchAgents for auto-start

Windows

  • Uses PowerShell's System.Windows.Forms.Clipboard for image capture
  • Uses Windows Registry for auto-start

Linux

  • Uses xclip (X11) or wl-paste (Wayland) for clipboard access
  • Uses systemd for auto-start

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later