stock-images-mcp
This server provides MCP tools to search stock images and download them locally.
search_images: Search images with a required
query; optionally filter byprovider(pexels,unsplash,pixabay,all; currently available:pexels),count(1–20, default 5), andorientation(landscape,portrait,square). Returns metadata includingdownloadUrl.download_image: Download an allowed
httpsimage URL from Pexels, Unsplash, or Pixabay into a download directory; optionally specifyfilenameandfolder; refuses to overwrite existing files.Safety/limits: Saves only
image/*files up to 50 MiB, uses a 30s timeout, restricts redirects, prevents path traversal, and requiresUNSPLASH_API_KEYfor Unsplash downloads.
Allows for searching and downloading stock images from the Pexels platform, with support for filtering by orientation and count.
Enables searching and downloading stock images from Pixabay's collection of stock media.
Provides tools for searching and downloading high-quality stock images from the Unsplash library.
Stock Images MCP
An MCP (Model Context Protocol) server for searching and downloading stock images from Pexels, Unsplash, and Pixabay.
Features
search_images: search one or all configured providers; partial failures are reported per provider
download_image: download an image safely into a local folder
Related MCP server: Pexels MCP Server
Setup
Get API keys (at least one required)
Provider | Env var | Get a key |
Pexels |
| |
Unsplash |
| |
Pixabay |
|
Optional: STOCK_IMAGES_DOWNLOAD_DIR — where download_image writes files (default ./downloads).
Claude Code / Cursor / Claude Desktop
Add to your MCP config (~/.claude/mcp.json, ~/.cursor/mcp.json, or claude_desktop_config.json):
{
"mcpServers": {
"stock-images": {
"command": "npx",
"args": ["-y", "stock-images-mcp"],
"env": {
"PEXELS_API_KEY": "your-key-here",
"UNSPLASH_API_KEY": "your-key-here",
"PIXABAY_API_KEY": "your-key-here"
}
}
}
}Requires Node.js 22+.
Docker
docker build -t stock-images-mcp .
docker run -i --rm -e PEXELS_API_KEY=xxx -v "$PWD/downloads:/downloads" stock-images-mcpFrom source
git clone https://github.com/jeanpfs/stock-images-mcp.git
cd stock-images-mcp
npm ci && npm run build
PEXELS_API_KEY=xxx node dist/index.jsTools
search_images
Search for stock images across configured providers.
Parameters:
query(required): search termprovider:"pexels","unsplash","pixabay", or"all"(default:"all")count: results per provider (default 5, max 20)orientation:"landscape","portrait", or"square"
Each result has id, provider, url, thumbnail, description, author, authorUrl, downloadUrl, width, height. Pass downloadUrl to download_image.
download_image
Download an image into the download directory.
Parameters:
url(required):httpsimage URL onpexels.com,unsplash.comorpixabay.com(usedownloadUrlfromsearch_images)filename: output name — letters, digits,_,-,.only; the extension is added from the content-type if missing (auto-generated if omitted)folder: subfolder inside the download directory
Behavior and limits:
Download directory is
./downloads, orSTOCK_IMAGES_DOWNLOAD_DIRif set. Paths that escape it (including via symlinks) are rejected.Only
image/*responses are saved; max 50 MiB; 30 s timeout; redirects are followed only to allowed hosts.Existing files are never overwritten.
Unsplash downloads require
UNSPLASH_API_KEY: the tool calls Unsplash's download endpoint, as their API guidelines require.
Errors
Failures return isError: true. search_images also returns a per-provider errors list when some providers fail but others succeed. Provider requests time out after 10 s and are retried on network errors, 429 and 502/503/504.
Attribution and licensing
Images stay under each provider's license. Credit the photographer where the provider requires it (author and authorUrl are returned for that purpose) and review the terms: Pexels, Unsplash, Pixabay.
Development
npm ci
npm run lint && npm run format:check && npm run typecheck && npm testSee CONTRIBUTING.md, CODE_OF_CONDUCT.md and SECURITY.md (report vulnerabilities privately, not in public issues).
License
MIT
Available Tools
2 toolsdownload_imageA
Download a stock image (https URL on pexels.com, unsplash.com or pixabay.com) into the download directory. Refuses to overwrite existing files.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL of the image to download | |
| folder | No | Subfolder inside the download directory | |
| filename | No | Output filename (auto-generated if omitted) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does disclose real behavior: files land in the download directory, only specific stock domains are accepted, and existing files are never overwritten (a refusal outcome). It omits auth requirements, failure modes for disallowed URLs, and rate limits, but the overwrite rule is genuinely useful beyond structured data.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences with the resource, domain scope, destination, and overwrite rule front-loaded; every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 3-param download tool with no annotations and no output schema, the description covers destination and the non-overwrite guarantee, which is what an agent needs to avoid surprising behavior. Return-value and error semantics are left implicit, a minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and all three parameters are documented in the schema, so the baseline is 3. The description confirms the download directory as the destination, contextualizing folder/filename, but adds no syntax or format detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Download a stock image') and constrains the accepted sources (pexels.com, unsplash.com, pixabay.com), which cleanly separates it from the search_images sibling. It stops short of explicitly naming or contrasting against that sibling, but the action is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No statement of when to use this tool versus search_images or any alternative, and no prerequisites. The accepted-domain list is a constraint rather than usage guidance, so the agent must infer the search-then-download workflow.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_imagesC
Search stock images across providers. Available providers: pexels
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of images per provider (default: 5, max: 20) | |
| query | Yes | Search term for images | |
| provider | No | Which provider to search (default: all configured) | all |
| orientation | No | Image orientation filter |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden but discloses little: it does not mention provider API key/credential requirements, rate limits, or that results are metadata rather than image bytes. The only real disclosure is which providers exist.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, zero filler, with the core action front-loaded and the provider availability noted immediately after. Nothing could be cut without losing information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 4-parameter search tool with no annotations and no output schema, the description is thin — it omits return shape, whether results are paginated or deduplicated across providers, and what happens when a provider is unconfigured. An agent would need to trial-and-error these.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds one piece of runtime context — "Available providers: pexels" — which is slightly helpful given the schema's "default: all configured" wording, but it does not explain count, orientation, or query semantics beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource ("Search stock images") and adds scope ("across providers"), which is enough to distinguish it from the sibling download_image. It stops short of explicitly contrasting the two, but the read-vs-fetch distinction is inferable.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No when-to-use guidance is given: nothing about when to choose this over download_image, whether a prior search is required before downloading, or how the provider parameter interacts with the task. Usage is only implied by the verb.
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.
2 tool updates
v2.0.1- Changed
download_image4 fields changed- added
Input schema / $schemaAdded value: +"http://json-schema.org/draft-07/schema#" - removed
Input schema / properties / folder / defaultRemoved value: -"./downloads" - changed
Input schema / properties / folder / descriptionPrevious value: -"Destination folder (default: ./downloads)"New value: +"Subfolder inside the download directory" - added
Input schema / properties / url / formatAdded value: +"uri"
- Changed
search_images1 field changed- added
Input schema / $schemaAdded value: +"http://json-schema.org/draft-07/schema#"
2 tool updates
v1.0.0- First observed
download_image - First observed
search_images
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: search_images finds images and download_image retrieves a specific one to disk. There is no plausible way to confuse them, and their boundaries are crisp.
Both follow the same verb_noun snake_case pattern (search_images, download_image). Fully predictable and consistent.
Only 2 tools is thin for a stock-image server; a search-plus-download pair is a reasonable minimal core, but it feels under-scoped for a domain that typically needs provider listing, metadata, and pagination.
The search-to-download workflow is covered, but there is no way to list providers or fetch image metadata/details, and search only exposes pexels while download accepts pexels/unsplash/pixabay, an inconsistency that hints at a partial surface.
Maintenance
Related MCP Connectors
MCP server exposing the YourImageShare upload API (upload/list/delete) as tools for AI agents.
MCP server for Pixapi: check live credit pricing and balance, then generate images and video.
MCP server for Qwen Image 3 AI image generation
Hosted MCP server for AI photo editing: nothing to install, no desktop photo editor needed.
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for searching images with Google213 npm14MIT
- AlicenseAqualityDmaintenanceAn MCP server to search for photos and videos on Pexels.311 npmMIT
- AlicenseAqualityDmaintenanceMCP server that allows AI coding agents to search, download, and convert stock photos from Pexels, Unsplash, and Pixabay into WebP format for direct use in web development projects.313 npm5MIT
- AlicenseAqualityDmaintenanceMCP server that enables searching and downloading Unsplash photos and collections.4MIT