You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

2.0 KiB

local-image-mcp

Minimal Model Context Protocol server for local image inspection.

local-image-mcp exposes two tools for debugging workflows:

  • list_local_images: scans a local directory and returns supported image files
  • load_local_image: loads a local image file and returns it as MCP image content

Loaded images are also exposed as MCP resources through debug-image://... URIs, which lets compatible clients reopen the same image resource later in the session.

Supported formats

  • PNG
  • JPEG / JPG
  • WEBP
  • GIF
  • BMP
  • SVG

Installation

From source

npm install

Run manually

node src/index.mjs

MCP configuration example

Add the server to your MCP client configuration:

{
  "servers": {
    "local-images": {
      "type": "stdio",
      "command": "node",
      "args": [
        "/absolute/path/to/local-image-mcp/src/index.mjs"
      ]
    }
  }
}

Tools

list_local_images

Lists supported images in a directory.

Input:

{
  "dirPath": "/absolute/path/to/images"
}

load_local_image

Loads an image file and returns it as MCP image content.

Input:

{
  "filePath": "/absolute/path/to/image.png"
}

Response content includes:

  • a text confirmation
  • an image item with base64 data and MIME type

Resources

Every successfully loaded image is cached for the current server session and published as a resource:

  • URI format: debug-image://<encoded-absolute-path>

This is useful when an MCP client supports resource browsing or reopening previously loaded assets.

Scripts

  • npm run check — syntax check for the server entrypoint

Publishing notes

Before publishing:

  1. update version in package.json
  2. set the author field if needed
  3. optionally add repository metadata and homepage fields
  4. publish with your preferred npm workflow

Use cases

  • inspect screenshots produced by test runs
  • review rendered UI snapshots from local tools
  • attach visual artifacts to debugging sessions in MCP-compatible clients