Stock Images MCP — Claude Code MCP server: how to install
Search and fetch stock photography from Pexels, Unsplash, and Pixabay directly inside your coding agent. Ideal for seeding mockups and UI assets.
claude mcp add --env PEXELS_API_KEY=<PEXELS_API_KEY> --env UNSPLASH_API_KEY=<UNSPLASH_API_KEY> --env PIXABAY_API_KEY=<PIXABAY_API_KEY> --env STOCK_IMAGES_DOWNLOAD_DIR=<STOCK_IMAGES_DOWNLOAD_DIR> --transport stdio stock-images-mcp -- npx -y stock-images-mcpWhat Stock Images MCP does
The server exposes two tools to your agent: search_images and download_image. You can search across several photo providers simultaneously or pick just one, with filtering available for landscape or portrait layouts. The tool returns resolutions, thumbnail previews, direct download URLs, and photographer credits for proper attribution.
Local file operations include strict safety rules. File downloads are capped at 50 MiB with a 30-second timeout, and existing files are never overwritten. Download paths default to ./downloads or STOCK_IMAGES_DOWNLOAD_DIR. Any attempt to escape the designated directory through relative paths or symlinks is blocked.
Node.js 22 or higher is required. You must provide an API key for at least one service among Pexels, Unsplash, or Pixabay. Queries to providers without configured keys will fail.
What it helps with
- search multiple stock photo services with a single query
- fetch mockup images into a local directory automatically
- filter stock results by portrait or landscape orientation
- collect photographer attribution metadata for project assets
Example prompts for the agent
- Find three landscape photos of modern architecture on Unsplash and download the best one into ./assets.
- Search Pexels for portrait shots of a software engineer and show photographer credits.
- Download this Pixabay picture directly to our images folder under the name hero.jpg.
How to install Stock Images MCP
Platform CLI
claude mcp add --env PEXELS_API_KEY=<PEXELS_API_KEY> --env UNSPLASH_API_KEY=<UNSPLASH_API_KEY> --env PIXABAY_API_KEY=<PIXABAY_API_KEY> --env STOCK_IMAGES_DOWNLOAD_DIR=<STOCK_IMAGES_DOWNLOAD_DIR> --transport stdio stock-images-mcp -- npx -y stock-images-mcpReplace <…> with your own values
Platform CLI
codex mcp add stock-images-mcp --env PEXELS_API_KEY=<PEXELS_API_KEY> --env UNSPLASH_API_KEY=<UNSPLASH_API_KEY> --env PIXABAY_API_KEY=<PIXABAY_API_KEY> --env STOCK_IMAGES_DOWNLOAD_DIR=<STOCK_IMAGES_DOWNLOAD_DIR> -- npx -y stock-images-mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"stock-images-mcp": {
"command": "npx",
"args": [
"-y",
"stock-images-mcp"
],
"env": {
"PEXELS_API_KEY": "<PEXELS_API_KEY>",
"UNSPLASH_API_KEY": "<UNSPLASH_API_KEY>",
"PIXABAY_API_KEY": "<PIXABAY_API_KEY>",
"STOCK_IMAGES_DOWNLOAD_DIR": "<STOCK_IMAGES_DOWNLOAD_DIR>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"stock-images-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"stock-images-mcp"
],
"env": {
"PEXELS_API_KEY": "<PEXELS_API_KEY>",
"UNSPLASH_API_KEY": "<UNSPLASH_API_KEY>",
"PIXABAY_API_KEY": "<PIXABAY_API_KEY>",
"STOCK_IMAGES_DOWNLOAD_DIR": "<STOCK_IMAGES_DOWNLOAD_DIR>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e PEXELS_API_KEY=<PEXELS_API_KEY> -e UNSPLASH_API_KEY=<UNSPLASH_API_KEY> -e PIXABAY_API_KEY=<PIXABAY_API_KEY> -e STOCK_IMAGES_DOWNLOAD_DIR=<STOCK_IMAGES_DOWNLOAD_DIR> stock-images-mcp npx -y stock-images-mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Stock Images MCP
How to install Stock Images MCP in Claude Code?
Run `claude mcp add stock-images-mcp -e PEXELS_API_KEY=<PEXELS_API_KEY> -e UNSPLASH_API_KEY=<UNSPLASH_API_KEY> -e PIXABAY_API_KEY=<PIXABAY_API_KEY> -- npx -y stock-images-mcp`. Replace placeholders with keys for whichever providers you use.
What does Stock Images MCP do?
It connects your coding agent to Pexels, Unsplash, and Pixabay. Your assistant can find photos across these platforms and save files directly into your project.
Are API keys required for all three providers?
No, having a key for just one service is enough. The server queries whichever providers have credentials configured and isolates errors per service.