Skip to main content
Glama
martinbowling

Clipboard to Supabase MCP Helper

Ayudante de portapapeles a Supabase MCP

Un agente local que monitorea el portapapeles del sistema, carga cualquier imagen copiada en Supabase Storage y luego escribe la URL pública (o firmada) nuevamente en el portapapeles.

Características

  • Alojamiento de imágenes sin clics: copie una imagen y obtenga una URL al instante

  • Baja latencia: menos de 800 ms desde la copia hasta la URL

  • Multiplataforma: funciona en macOS, Windows y Linux

  • Integración con MCP: Exponer la carga de imágenes del portapapeles como un punto final de MCP

  • Inicio automático: configurar para que se ejecute al iniciar el sistema

  • Detección eficiente: deduplicación basada en hash con bajo uso de CPU

Related MCP server: ClipMCP

Prerrequisitos

  • Node.js 18+

  • Cuenta de Supabase con almacenamiento habilitado

  • Dependencias específicas de la plataforma:

    • macOS: pngpaste ( brew install pngpaste )

    • Windows/Linux: Acceso al portapapeles del sistema operativo nativo

Instalación

  1. Clonar el repositorio:

git clone https://github.com/martinbowling/clipboard-to-supabase-mcp-helper.git
cd clipboard-to-supabase-mcp-helper
  1. Instalar dependencias:

npm install
  1. Cree un archivo .env basado en .env.example :

SUPABASE_URL=https://<project>.supabase.co
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
BUCKET=media
MCP_PORT=3333
  1. Pruebe su conexión Supabase:

npm run test:supabase
  1. Construir el proyecto:

npm run build
  1. Instalar como servicio del sistema:

Para macOS:

npm run install:macos

Para Linux:

npm run install:linux

Para Windows:

npm run install:windows

Uso

Una vez instalado y en ejecución, el ayudante hará lo siguiente:

  1. Monitorea tu portapapeles para detectar cambios en las imágenes (sondeo cada 300 ms)

  2. Sube cualquier imagen copiada a tu bucket de Supabase

  3. Coloque la URL pública nuevamente en su portapapeles, lista para pegar

Ejecución del servicio

El asistente del portapapeles se puede ejecutar en dos modos:

Modo Stdio (predeterminado)

npm start

Esto ejecuta el servidor MCP con StdioServerTransport, ideal para el uso de la línea de comandos.

Modo HTTP

npm run start:http

Esto ejecuta un servidor HTTP Express en el puerto 3333 (configurable) con un punto final de API REST adecuado.

Integración MCP

El ayudante expone los siguientes puntos finales de MCP:

Subir imagen del portapapeles

Con modo de servidor HTTP:

POST http://localhost:3333/mcp

Cuerpo de la solicitud:

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

Respuesta:

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

Limpiar archivos antiguos

El ayudante también proporciona un punto final MCP para activar manualmente la limpieza de archivos antiguos.

Cuerpo de la solicitud:

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

Respuesta:

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

El parámetro days es opcional. Si no se proporciona, se utilizará el valor de la variable de entorno RETENTION_DAYS .

Cómo funciona

  1. Detección de cambios : sondea el portapapeles cada 300 ms y calcula el hash SHA-1 de los datos de la imagen

  2. Desduplicación : solo procesa imágenes nuevas o modificadas según la comparación de hash

  3. Adaptación de la plataforma : utiliza métodos específicos de la plataforma para capturar imágenes del portapapeles

  4. Integración con Supabase : carga imágenes en su depósito de Supabase con UUID únicos

  5. Punto final MCP : expone la funcionalidad a los agentes de IA a través del Protocolo de contexto de modelo

  6. Limpieza automática : elimina periódicamente las imágenes más antiguas que el período de retención configurado (predeterminado: 30 días)

Notas específicas de la plataforma

macOS

  • Requiere pngpaste : instalar con brew install pngpaste

  • Utiliza LaunchAgents para el inicio automático

Ventanas

  • Utiliza System.Windows.Forms.Clipboard de PowerShell para la captura de imágenes

  • Utiliza el Registro de Windows para el inicio automático

Linux

  • Utiliza xclip (X11) o wl-paste (Wayland) para acceder al portapapeles

  • Utiliza systemd para el inicio automático

Desarrollo

# 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

Licencia

Instituto Tecnológico de Massachusetts (MIT)

Available Tools

2 tools
cleanup_old_filesD
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

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

Completeness1/5

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

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

upload_clipboard_imageD
ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

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

Completeness1/5

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

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv1.0.0
    • Changedcleanup_old_files1 field changed
      • addedInput schema / properties
        Added value: +{}
    • Changedupload_clipboard_image1 field changed
      • removedInput schema / additionalProperties
        Removed value: -false
  2. 2 tool updates
    • First observedcleanup_old_files
    • First observedupload_clipboard_image

TDQS

D1.8/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: cleanup_old_files handles file management, while upload_clipboard_image handles image uploads. There is no overlap in functionality, making them easy to distinguish.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern with snake_case naming: cleanup_old_files and upload_clipboard_image. The naming is predictable and uniform across the set.

Tool Count2/5

With only 2 tools, the server feels thin for a 'Clipboard to Supabase MCP Helper' that might imply broader clipboard or Supabase integration. This minimal set likely leaves gaps in functionality.

Completeness2/5

Inferred domain includes clipboard operations and Supabase integration, but the tools only cover image uploads and file cleanup. Missing obvious functions like handling text/data from clipboard or other Supabase CRUD operations.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers