Skip to main content
Glama

MCP Clipboard Image Server

A Model Context Protocol (MCP) server that enables Claude Code to paste images directly from your system clipboard for instant analysis and processing.

License: MIT Node.js Version Claude Code

Features

  • 🖼️ Paste images directly from clipboard (Ctrl+C/Cmd+C → MCP tool)

  • 🔄 Cross-platform support (Windows, macOS, Linux)

  • 📁 Automatic temporary file creation with accessible paths

  • 🎨 Support for multiple image formats (PNG, JPEG, GIF, BMP, TIFF)

  • ⚡ Format conversion capabilities

  • 🛡️ Robust error handling and user feedback

  • 🔍 Automatic format detection via magic numbers

Related MCP server: view-image-mcp

Installation

npm install
npm run build

Dependencies

  • System Dependencies: The server requires platform-specific clipboard utilities:

    • macOS: Built-in osascript support, optional pngpaste for enhanced functionality

    • Linux: xclip (X11) or wl-paste (Wayland)

    • Windows: Built-in PowerShell support

Linux Setup

# For X11-based systems
sudo apt-get install xclip

# For Wayland-based systems
sudo apt-get install wl-clipboard

macOS Setup (Optional Enhancement)

# Install pngpaste for better clipboard handling
brew install pngpaste

Usage

🚀 Quick Start for Claude Code

Step 1: Install the Server

# Clone and build
git clone https://github.com/yourusername/mcp-clipboard-image-server.git
cd mcp-clipboard-image-server
npm install
npm run build

Step 2: Add to Claude Code

Choose one of these methods:

claude mcp add clipboard-image -s project -- node /absolute/path/to/mcp-clipboard-image-server/dist/index.js

Method B: User scope (Global - Available everywhere)

claude mcp add clipboard-image -s user -- node /absolute/path/to/mcp-clipboard-image-server/dist/index.js

Method C: Local scope

claude mcp add clipboard-image -s local -- node /absolute/path/to/mcp-clipboard-image-server/dist/index.js

Method D: Manual configuration

Create .mcp.json in your project root:

{
  "mcpServers": {
    "clipboard-image": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-clipboard-image-server/dist/index.js"],
      "env": {}
    }
  }
}

Step 3: Restart Claude Code

Restart Claude Code to load the new MCP server.

Step 4: Test it!

  1. Copy any image to clipboard

  2. In Claude Code, say: "paste image"

  3. Claude will automatically capture and analyze your image!

🎯 Claude Code Usage Examples

Basic Usage

User: paste image
Claude: [Captures image and describes what's in it]

User: paste image and help me debug this error
Claude: [Analyzes screenshot of error and provides solutions]

User: paste image and explain this diagram
Claude: [Interprets technical diagrams, flowcharts, etc.]

Command Shortcuts

Claude Code Slash Commands

# Setup slash commands in Claude Code
./setup-claude-commands.sh

# Now you can use in Claude Code:
/pasteimage             # Paste and analyze image
/pasteimage --debug     # Paste and debug errors  
/pasteimage --explain   # Paste and explain diagrams
/pi                     # Quick shortcut

Shell Commands

# Install shell commands
./install-commands.sh

# Use from terminal:
paste-image --debug     # Paste and debug errors
paste-image --explain   # Paste and explain diagrams
pi                      # Quick alias for paste-image

Advanced Usage

  • Screenshots: Perfect for debugging UI issues, error messages

  • Diagrams: Architecture diagrams, flowcharts, wireframes

  • Code snippets: Screenshots of code for review and suggestions

  • Data visualizations: Charts, graphs, analytics dashboards

Available Tools

paste_image

Captures an image from the system clipboard and saves it to a temporary file.

Parameters:

  • filename (optional): Custom filename without extension (UUID generated if not provided)

  • format (optional): Target format - "png", "jpeg", "jpg", "gif", "bmp", "tiff" (preserves original if not specified)

Usage Examples:

  1. Basic paste: paste_image

  2. Custom filename: paste_image({"filename": "screenshot"})

  3. Format conversion: paste_image({"format": "jpeg"})

  4. Both options: paste_image({"filename": "diagram", "format": "png"})

Returns:

  • Success: File path, format info, and size details

  • Error: Helpful troubleshooting information

🎯 Slash Commands

After running ./setup-claude-commands.sh, you can use these slash commands directly in Claude Code:

Command

Description

Usage

/pasteimage

Paste and analyze image

/pasteimage

/pasteimage --debug

Paste and debug errors

/pasteimage --debug

/pasteimage --explain

Paste and explain diagrams

/pasteimage --explain

/pi

Quick paste shortcut

/pi

/paste-debug

Paste and debug (alias)

/paste-debug

/paste-explain

Paste and explain (alias)

/paste-explain

Slash Command Examples:

/pasteimage                    → Paste image and analyze
/pasteimage --debug            → Paste image and debug error
/pi                           → Quick paste 
/paste-debug                  → Debug screenshot

Workflow

  1. Copy Image: Copy any image to clipboard (Ctrl+C/Cmd+C)

  2. Call Tool: Use paste_image tool in Claude Code

  3. Get Path: Receive temporary file path

  4. Process: Claude Code can now read and analyze the image

Error Handling

The server provides comprehensive error handling for:

  • No image in clipboard

  • Clipboard access permissions

  • Unsupported formats

  • File system errors

  • Platform compatibility issues

Security Considerations

  • Images are saved to system temporary directory

  • No network requests or external API calls

  • Temporary files use UUID naming to avoid conflicts

  • Cross-platform clipboard access uses standard system utilities

  • No persistent data storage

Platform Support

Platform

Primary Method

Fallback Method

Status

macOS

osascript

pngpaste

✅ Supported

Linux

xclip

wl-paste

✅ Supported

Windows

PowerShell

-

✅ Supported

Development

# Install dependencies
npm install

# Build TypeScript
npm run build

# Run in development mode
npm run dev

# Start production server
npm start

Troubleshooting

Common Issues

  1. "No image found in clipboard"

    • Ensure an image is actually copied (not just selected)

    • Try copying the image again

    • Some applications may not properly set clipboard data

  2. Clipboard access errors

    • Check system permissions for clipboard access

    • Ensure required utilities are installed (xclip, wl-paste)

    • Try restarting the MCP server

  3. Platform-specific issues

    • Linux: Install xclip or wl-paste depending on display server

    • macOS: Consider installing pngpaste for better compatibility

    • Windows: Ensure PowerShell execution policy allows scripts

Debug Mode

Set environment variable for detailed logging:

DEBUG=1 node dist/index.js

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make changes with tests

  4. Submit a pull request

For bug reports and feature requests, please use the GitHub issues page.

Available Tools

4 tools
auto_paste_statusA

Check the current status of auto-paste detection (enabled/disabled).

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It indicates a read-only status check ('check current status') but does not explicitly state that it has no side effects or describe the return format. It adds the enabled/disabled detail, but could be more explicit about the operation being non-destructive.

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

Conciseness5/5

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

The description is a single, concise sentence that front-loads the key information. Every word contributes to understanding the tool's function, with no unnecessary elaboration.

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

Completeness4/5

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

For a simple status check with no parameters and no output schema, the description is largely complete. It specifies what is being checked and the possible states. However, it could be slightly more explicit about the return value format, which is a minor gap.

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

Parameters4/5

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

The tool accepts zero parameters, so the baseline for parameter semantics is 4. The description does not need to explain parameter details, and it correctly implies no inputs are required for the status check.

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

Purpose5/5

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

The description clearly states the tool's purpose: checking the current status of auto-paste detection as enabled or disabled. The verb 'check' plus the specific resource 'status of auto-paste detection' distinguishes it from sibling tools that enable, disable, or paste.

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

Usage Guidelines4/5

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

The description clearly implies when to use the tool: when you need to know whether auto-paste is enabled or disabled. It does not explicitly mention alternatives or exclusions, but the sibling tools (enable/disable/paste) are conceptually distinct, making the usage context obvious.

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

disable_auto_pasteA

Disable automatic paste detection. Returns to manual paste mode using slash commands only.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the immediate effect (disables auto-paste) and the resulting mode (manual via slash commands), but it omits potential side effects, reversibility, or any prerequisites. Since this is a simple toggle, some inference is reasonable, but more explicit detail would improve transparency.

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

Conciseness5/5

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

The description is two sentences with no fluff. It front-loads the action and immediately explains the result, making every word earn its place. There is no redundancy.

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

Completeness4/5

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

Given the tool's simplicity (zero parameters, no output schema), the description is nearly complete. It states the action and the resulting mode, which is enough for an agent to invoke correctly. It could mention the opposite action (enable_auto_paste) for full completeness, but that is not essential.

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

Parameters4/5

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

The tool has zero parameters, so the baseline is 4 per the rubric. The description adds no parameter-specific meaning, but none is needed; the input schema is empty, and the description focuses on the action and outcome.

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

Purpose5/5

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

The description clearly states the tool's function with a specific verb ('Disable') and resource ('automatic paste detection'). It also differentiates from siblings by explicitly mentioning the result ('manual paste mode'), making it distinct from enable_auto_paste and auto_paste_status.

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

Usage Guidelines4/5

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

The description clearly implies when to use this tool: when you want to turn off automatic paste detection. It does not explicitly name alternatives, but the sibling tool 'enable_auto_paste' provides clear contrast, and the phrase 'using slash commands only' suggests the resulting behavior is manual, which guides usage.

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

enable_auto_pasteA

Enable automatic paste detection. When enabled, copying an image and pressing Ctrl+V will automatically trigger image pasting without needing to type slash commands.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It clearly describes the trigger (copying image + Ctrl+V) and the effect (auto-triggering pasting). It does not mention side effects, persistence, or scope, but for a simple toggle, this is reasonable. The description adds value beyond the tool name without being misleading.

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

Conciseness5/5

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

The description is two sentences, front-loaded with the core action and followed by a clear explanation of the behavior. Every sentence earns its place, with no fluff or redundancy. It is concise and well-structured.

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

Completeness5/5

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

Given the tool's simplicity (no parameters, no output schema, no annotations), the description is complete. It fully explains what the tool does and its effect. There are no missing pieces that would prevent an agent from using it correctly. The sibling context further clarifies its role.

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

Parameters4/5

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

The tool has zero parameters, so the baseline is 4. The description does not need to explain parameters, and the input schema shows none. The description adds context about the tool's behavior, which compensates for the lack of parameters entirely.

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

Purpose5/5

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

The description clearly states the tool's purpose: 'Enable automatic paste detection.' It uses a specific verb (enable) and resource (automatic paste detection), and explains the exact behavior triggered. This distinguishes it from siblings like 'paste_image' (manual) and 'disable_auto_paste' (the inverse).

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

Usage Guidelines4/5

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

The description provides clear usage context by explaining what happens when enabled (copying an image and pressing Ctrl+V triggers pasting). It implicitly contrasts with using slash commands ('without needing to type slash commands'), which suggests an alternative workflow. However, it does not explicitly name sibling tools or state when not to use this tool, so it falls short of full explicit guidance.

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

paste_imageA

Paste an image from the system clipboard. Captures clipboard image data, saves it to a temporary file, and returns the file path for Claude Code to display. Supports common image formats (PNG, JPEG, GIF, BMP, TIFF).

ParametersJSON Schema
NameRequiredDescriptionDefault
formatNoOptional target format. If not specified, the original format will be preserved.
filenameNoOptional custom filename (without extension). If not provided, a UUID will be used.

TDQS

A4.2/5.0
Behavior4/5

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

No annotations are provided, so the description carries full responsibility. It discloses the key behavioral traits: captures clipboard data, saves to a temporary file, and returns the file path. This adds meaningful transparency, though it does not cover edge cases like an empty clipboard or file cleanup.

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

Conciseness5/5

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

The description is compact and front-loaded with the primary action. It consists of two sentences that efficiently convey the operation, behavior, and supported formats, with no wasted words.

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

Completeness4/5

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

The tool is simple with no output schema, but the description explains the return value (file path) and the save-to-file behavior. It lacks details about prerequisites (e.g., clipboard must contain an image) and potential failure modes, which would make it more complete. Still, for a straightforward clipboard utility, it covers sufficient context.

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

Parameters3/5

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

Both parameters are fully described in the input schema, so the description does not need to add much. The description mentions support for common image formats, which aligns with the format enum, but adds no additional syntax or format details beyond what the schema already provides. Baseline of 3 is appropriate since schema coverage is 100%.

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

Purpose5/5

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

The description clearly states the tool's function: pasting an image from the system clipboard, saving it to a temporary file, and returning the file path. It distinguishes paste_image from sibling tools (enable_auto_paste, disable_auto_paste, auto_paste_status) which manage auto-paste settings rather than directly pasting an image.

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

Usage Guidelines4/5

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

The description clearly implies when to use this tool: when an image is in the clipboard and needs to be displayed via Claude Code. It doesn't explicitly name alternatives or exclusions, but the sibling tools are clearly about toggling auto-paste, so the context is unambiguous. This is a clear usage context without explicit when-not guidance.

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. 4 tool updatesv1.0.0
    • First observedauto_paste_status
    • First observeddisable_auto_paste
    • First observedenable_auto_paste
    • First observedpaste_image

TDQS

A4.4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a singular purpose: paste_image performs the actual paste, while enable/disable/status manage the auto-paste setting. There is no overlap or ambiguity between the action-oriented and configuration-oriented tools.

Naming Consistency4/5

Most tools follow a clear verb_noun pattern (paste_image, enable_auto_paste, disable_auto_paste). The status tool uses a noun phrase (auto_paste_status) instead of a verb, which is a slight deviation, but the style is consistent and readable.

Tool Count5/5

Four tools is well-scoped for a clipboard-image server. The set covers the core function (pasting) plus the auto-paste feature without unnecessary bloat.

Completeness5/5

The tool surface fully covers the domain: manual paste, auto-paste enable/disable, and status query. There appear to be no missing operations or dead ends for a clipboard-image utility.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers