SuperAPI AI Directory

stock-images-mcp

stock-images-mcp is a Model Context Protocol (MCP)-based server for searching and downloading stock images from Pexels, Unsplash, and Pixabay. It provides two tools, search_images and download_image: the former can query a single or all configured stock image sources and reports errors by source when some sources fail; the latter securely downloads images to a local directory. Before use, an API key for at least one stock image source must be configured, and the download directory can optionally be set, defaulting to ./downloads. The project requires Node.js 22+ and can be integrated into the MCP configuration of Claude Code, Cursor, or Claude Desktop. Downloads accept only image/* responses, are limited to 50 MiB with a 30-second timeout, and prevent path traversal and overwriting existing files. Images remain subject to the licenses of each stock image source, and photographers must be credited as required.

Open website

About this tool

Purpose: stock-images-mcp is an MCP server intended for MCP client scenarios that need to retrieve and save images from stock image sources, supporting three sources: Pexels, Unsplash, and Pixabay.

Main capabilities: It provides the search_images tool, which can search one or all configured sources by keyword, supports specifying the number of results and orientation (landscape, portrait, square), and returns fields such as id, source, URL, thumbnail, description, author, author link, download link, and width and height; when some sources fail, it returns an error list by source. It provides the download_image tool, which can save download links from search results to a local download directory and supports specifying a filename and subfolder.

Usage: An API key for at least one stock image source must be obtained; STOCK_IMAGES_DOWNLOAD_DIR can optionally be set to specify the download directory, defaulting to ./downloads. Add the server to the MCP configuration (such as ~/.claude/mcp.json, ~/.cursor/mcp.json, or claude_desktop_config.json), requiring Node.js 22+. When calling search_images, pass query, and optionally provider (pexels, unsplash, pixabay, or all, default all), count (default 5, maximum 20), and orientation; pass the returned downloadUrl to download_image, and optionally specify filename (only letters, digits, underscores, hyphens, and dots; if the extension is missing, it is added based on content-type) and folder.

Limitations and security: The download directory is fixed to ./downloads or the directory specified by the environment variable, and escaping paths (including symbolic links) are rejected; only image/* responses are saved, with a maximum of 50 MiB, a 30-second timeout, and redirects only to allowed hosts; existing files are not overwritten. Unsplash downloads require UNSPLASH_API_KEY and call its download endpoint. Failures return isError: true; source requests have a 10-second timeout, and network errors, 429, and 502/503/504 are retried. Images remain subject to the licenses of each source, and photographers must be credited and the terms reviewed as required by each source.