Skip to content
smallPict
Start Free

Model Context Protocol (MCP)

Connect SmallPict image optimization tools directly to AI Agents: Claude Desktop, Cursor, Google Antigravity, OpenCode, Codex, Windsurf, and custom AI workflows.

The SmallPict MCP Server (@smallpict/mcp) implements the open Model Context Protocol standard, giving Large Language Models (LLMs) and autonomous AI coding agents native tools to inspect, compress, convert, and manage web assets directly within their workflow.

End-to-End Image Processing & Edge CDN Flow

Sub-50ms image optimization lifecycle from client upload to global edge delivery.

  1. 01

    Client Application

    WordPress / SDK / API

    Uploads raw image binary with HMAC-SHA256 signature and UUID v4 idempotency key.

    Origin Request

  2. 02

    smallPict Edge CDN

    Global Edge PoPs

    Checks global edge cache. On cache HIT, delivers AVIF/WebP in <20ms worldwide.

    Cache & Delivery

  3. 03

    SmallPict API Gateway

    Authentication & Quotas

    Validates HMAC credentials, verifies quota limits, and scopes access to customer_id.

    Auth & Scoping

  4. 04

    Optimization Engine

    High-Speed Native Encoder

    Multi-threaded quantization transcode to AVIF & WebP with no visible quality loss and much smaller files.

    Transcoding

  5. 05

    Secure Storage & Sync

    Encrypted Cloud Storage

    Stores optimized output, invalidates outdated cache tags, and warms the edge cache.

    Persistent Sync

Zero Data Interception: End-to-end HMAC validation & SHA256 integrity check

Engine: smallPict


Overview

  • Supported clients: Works with Claude for Desktop, Cursor, Google Antigravity (AGY), OpenCode, Windsurf, Cline / Roo Code, Goose, and any MCP-compliant runtime.
  • No build step: Runs with npx -y @smallpict/mcp on Node.js 18+.
  • stdio transport: Communicates over standard input/output. Logs go to stderr so they never corrupt the JSON-RPC stream.
  • Production and sandbox: Accepts production keys (sp_live_...) and sandbox keys (sp_test_...), which do not use quota.

Tools

Once the server is configured, your agent can use three tools:

1. smallpict_optimize_image

Compresses local image files or remote URLs and converts them to WebP or AVIF.

ParameterTypeRequiredDescription
image_pathstringYesAbsolute or relative local file path, or public HTTP/HTTPS image URL.
target_formatstringNoTarget format: webp (default), avif, jpg, or png.
qualitynumberNoCompression quality from 1 to 100 (default: 80).
modestringNobalanced (default), aggressive, ultra, or lossless.
max_long_edge_pxnumberNoResize constraint: downscales image while maintaining original aspect ratio.
output_pathstringNoCustom local destination path (defaults to same folder with new extension).

2. smallpict_get_quota

Returns your plan, monthly limit, and remaining quota.

ParameterTypeRequiredDescription
(None)--Uses the quota of the account that owns the API key.

3. smallpict_purge_cdn_cache

Purges cached images from the CDN after you update them.

ParameterTypeRequiredDescription
urlsstring[]NoArray of specific image URLs or CDN relative paths to invalidate.
purge_allbooleanNoInvalidate all cached assets across the active domain (default: false).

Setup

1. Claude for Desktop

Add the smallpict server definition to your claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
JSON
{  "mcpServers": {    "smallpict": {      "command": "npx",      "args": [        "-y",        "@smallpict/mcp"      ],      "env": {        "SMALLPICT_API_KEY": "sp_live_YOUR_API_KEY"      }    }  }}

Restart Claude Desktop. The SmallPict tools then appear in the tools menu.


2. Cursor IDE

Configure SmallPict MCP in Cursor globally or per-project:

Option A: Cursor Global Settings

  1. Open Cursor Settings (Cmd + , or Ctrl + ,).
  2. Navigate to Features → MCP Servers.
  3. Click + Add New MCP Server.
    • Name: smallpict
    • Type: command
    • Command: npx -y @smallpict/mcp
    • Environment Variables: SMALLPICT_API_KEY=sp_live_YOUR_API_KEY

Option B: Workspace Configuration (.cursor/mcp.json)

Create a file at .cursor/mcp.json in your project root:

JSON
{  "mcpServers": {    "smallpict": {      "command": "npx",      "args": [        "-y",        "@smallpict/mcp"      ],      "env": {        "SMALLPICT_API_KEY": "sp_live_YOUR_API_KEY"      }    }  }}

3. Google Antigravity (AGY)

For developers using the Antigravity multi-agent coding environment, add the SmallPict MCP server to ~/.gemini/antigravity/mcp/smallpict/mcp.json or your workspace settings:

JSON
{  "mcpServers": {    "smallpict": {      "command": "npx",      "args": [        "-y",        "@smallpict/mcp"      ],      "env": {        "SMALLPICT_API_KEY": "sp_live_YOUR_API_KEY"      }    }  }}

Antigravity agents can then optimize project images as part of their tasks.


4. VS Code (Cline / Roo Code)

In VS Code with the Cline or Roo Code extension:

  1. Open the Cline panel and click the MCP Servers icon.
  2. Select Configure MCP Servers (opens cline_mcp_settings.json).
  3. Add the server entry:
JSON
{  "mcpServers": {    "smallpict": {      "command": "npx",      "args": [        "-y",        "@smallpict/mcp"      ],      "env": {        "SMALLPICT_API_KEY": "sp_live_YOUR_API_KEY"      },      "disabled": false,      "autoApprove": [        "smallpict_get_quota",        "smallpict_optimize_image"      ]    }  }}

5. Windsurf (Codeium)

Edit your Windsurf configuration at ~/.codeium/windsurf/mcp_config.json:

JSON
{  "mcpServers": {    "smallpict": {      "command": "npx",      "args": [        "-y",        "@smallpict/mcp"      ],      "env": {        "SMALLPICT_API_KEY": "sp_live_YOUR_API_KEY"      }    }  }}

6. OpenCode, Codex & Custom AI Runners

For terminal-based agents (Goose, OpenCode, custom LangChain / LlamaIndex scripts), invoke @smallpict/mcp directly via standard input/output:

Shell
# Launch directly in your agent subprocessSMALLPICT_API_KEY"sp_live_YOUR_KEY" npx -y @smallpict/mcp

Example prompts

Once configured, you can ask your agent in plain language:

Optimize local images

"Agent, find all PNG and JPEG images inside public/images/, convert them to WebP at quality 80, and give me a summary table of how many bytes we saved."

Check quota

"What is my remaining SmallPict quota this month before I start bulk optimizing hero assets?"

Purge the CDN cache

"I just replaced hero-banner.jpg on my site. Please purge the SmallPict CDN cache for that asset."


Testing with sandbox keys

You can test without consuming your monthly transformation quota by using a Sandbox key:

JSON
"env": {  "SMALLPICT_API_KEY": "sp_test_sandbox_secret_key"}
  • Images are processed by the same pipeline as production.
  • Requests are tracked separately and do not use your monthly quota.
  • Converted files are deleted after 24 hours.