mcp
v0.0.5Official Model Context Protocol (MCP) server for SmallPict Image Optimization
Official Model Context Protocol (MCP) server for smallPict, the high-performance image optimization and AVIF/WebP transcoding platform. This MCP server equips AI coding assistants (such as Claude Desktop, Cursor, Windsurf, and Antigravity) with direct capabilities to compress, transcode, and maintain web image assets. 1. smallpict_optimize_image: - Compresses local image files or remote URLs to WebP or AVIF.
Summary extracted from the README.
@smallpict/mcp
Official Model Context Protocol (MCP) server for smallPict, the high-performance image optimization and AVIF/WebP transcoding platform.
This MCP server equips AI coding assistants (such as Claude Desktop, Cursor, Windsurf, and Antigravity) with direct capabilities to compress, transcode, and maintain web image assets.
Capabilities / Tools
smallpict_optimize_image:- Compresses local image files or remote URLs to WebP or AVIF.
mode:lossy(default),extreme(smallest files),lossless(pixel-perfect) orauto(the server picks, per image, the lowest quality that keeps the visual score at or above 70, and ignoresquality; WP Pro and Business, Velocity, Momentum and sandbox keys). The server checks the mode against your plan; a mode outside it returns the modes your plan allows.quality(1-100, optional). Leave it out and the server picks the default for the mode: 80 forlossy, a default per output format forextreme. The server applies the minimum quality of each mode, so the quality used can be higher.- Example: ask the assistant to "optimize
hero.jpgto AVIF with mode extreme", which callssmallpict_optimize_imagewith{ "filePath": "hero.jpg", "format": "avif", "mode": "extreme" }and noquality.extremegives the smallest files on every plan; leavequalityout so the server uses its default for the output format; a quality you set is kept or raised to the format floor. Mode comparison: https://smallpict.app/en/docs/image-settings lossless: trueis deprecated: it is treated asmode: "lossless"whenmodeis not set, and combining it with another mode is a validation error.- Downscaling constraints:
maxDimension(longest edge),maxWidth, andmaxHeight. - Automatically writes the optimized image back to the workspace if
outputPathis provided. folder(optional, e.g.blog/2026): 1-3 segments ofa-z,0-9,-or_. The server lower-cases it and stores the file in that folder; the result shows the stored folder.- Outputs full telemetry: original size, compressed size, percentage saved (up to 85%), and the mode and quality the server applied (
mode_applied,quality_applied).
smallpict_get_quota:- Inspects the account's active plan, processed bytes, and remaining monthly quota.
- Shows the read-only capacity of the key's product when the server reports it: storage used/limit (plan + add-on blocks), CDN used/limit and status, booster balances (active or paused, and the lot that expires first), the unpaid-account state with its deletion date, the period end, and the dashboard link (
manage_url). Members that do not apply are left out. - Read-only: boosters and storage are bought in the smallPict dashboard only; no tool buys anything.
smallpict_purge_cdn_cache:- Invalidates cached asset URLs on Cloudflare Edge CDN PoPs globally.
purgeType:url(default, the listedurls),folder(one uploadfolderand its sub-folders) orall(every file of the account).folderandallpurges are limited per hour by the server; the limit returns a tool error and is not retried.- On an account with BYO delivery the result says the purge was sent to your own CDN.
- Quota and capacity errors: a
402or409capacity error fromsmallpict_optimize_imageorsmallpict_purge_cdn_cachereturns a tool error with the server's reason and the dashboard link (upgrade_url) where capacity is added. The link is shown, never opened.
Installation & Setup
The server runs with npx, so there is nothing to install or build. It needs Node.js 18 or later and an API/SDK key with its secret key from the smallPict dashboard: the free sandbox key (sp_test_...) or a production key (sp_sdk_...). WordPress plugin keys (sp_wp_...) are refused.
1. Configure in Claude Desktop
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"smallpict": {
"command": "npx",
"args": ["-y", "@smallpict/mcp"],
"env": {
"SMALLPICT_API_KEY": "sp_sdk_...",
"SMALLPICT_SECRET_KEY": "sps_..."
}
}
}
}
2. Configure in Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"smallpict": {
"command": "npx",
"args": ["-y", "@smallpict/mcp"],
"env": {
"SMALLPICT_API_KEY": "sp_sdk_...",
"SMALLPICT_SECRET_KEY": "sps_..."
}
}
}
}
Guides for Windsurf, Antigravity, OpenCode and other clients: smallpict.app/en/docs/mcp.
3. Build from source (for development)
git clone https://github.com/smallPict/smallpict-mcp.git
cd smallpict-mcp
npm install
npm run build
Then point your client at the build instead of npx: "command": "node" and "args": ["/absolute/path/to/smallpict-mcp/dist/index.js"].
Environment Variables
SMALLPICT_API_KEY(Required): Your API key (sp_sdk_...or sandbox evaluation keysp_test_...).SMALLPICT_SECRET_KEY(Required): Your API secret key (sps_...). Every request is signed with it; without it every tool call fails.SMALLPICT_BASE_URL(Optional): API endpoint URL (default:https://api.smallpict.app).SMALLPICT_WAIT_TIMEOUT_MS(Optional): how longsmallpict_optimize_imagewaits for the job to finish (default120000). A job still running after that is a tool error naming the job id.SMALLPICT_POLL_INTERVAL_MS(Optional): how often the job status is polled while waiting (default1000).