Back to Browse

Stock Images MCP Server

FinanceModerate5.2MCP RegistryLocal
Free

Server data from the Official MCP Registry

Search and download free stock images from Pexels, Unsplash, and Pixabay.

About

Search and download free stock images from Pexels, Unsplash, and Pixabay.

Security Report

5.2
Moderate5.2Moderate Risk

This is a well-engineered MCP server with strong security practices. Authentication is properly required for all three providers via environment variables, and file operations include comprehensive path traversal and symlink protections. The code implements careful input validation, URL allowlisting, and size limits on downloads. No credential exfiltration or code execution risks were identified. Minor quality issues around error handling don't significantly impact security. Supply chain analysis found 3 known vulnerabilities in dependencies (2 critical, 0 high severity). Package verification found 1 issue.

7 files analyzed · 8 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

env_vars

Check that this permission is expected for this type of plugin.

HTTP Network Access

Connects to external APIs or services over the internet.

File System Read

Reads files on your machine. Normal for tools that analyze or process local data.

File System Write

Writes or modifies files on your machine. Check that this is expected for the tool.

What You'll Need

Set these up before or after installing:

API key from pexels.com/api (free). At least one provider key is required.Required

Environment variable: PEXELS_API_KEY

Access key from unsplash.com/developers (free). Required to download Unsplash photos.Required

Environment variable: UNSPLASH_API_KEY

API key from pixabay.com/api/docs (free).Required

Environment variable: PIXABAY_API_KEY

Directory where download_image saves files (default: ./downloads).Optional

Environment variable: STOCK_IMAGES_DOWNLOAD_DIR

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-jeanpfs-stock-images-mcp": {
      "env": {
        "PEXELS_API_KEY": "your-pexels-api-key-here",
        "PIXABAY_API_KEY": "your-pixabay-api-key-here",
        "UNSPLASH_API_KEY": "your-unsplash-api-key-here",
        "STOCK_IMAGES_DOWNLOAD_DIR": "your-stock-images-download-dir-here"
      },
      "args": [
        "-y",
        "stock-images-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

Stock Images MCP

CI npm license

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

Setup

Get API keys (at least one required)

ProviderEnv varGet a key
PexelsPEXELS_API_KEYhttps://www.pexels.com/api/
UnsplashUNSPLASH_API_KEYhttps://unsplash.com/developers
PixabayPIXABAY_API_KEYhttps://pixabay.com/api/docs/

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 20+.

Docker

docker build -t stock-images-mcp .
docker run -i --rm -e PEXELS_API_KEY=xxx -v "$PWD/downloads:/downloads" stock-images-mcp

From 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.js

Tools

search_images

Search for stock images across configured providers.

Parameters:

  • query (required): search term
  • provider: "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): https image URL on pexels.com, unsplash.com or pixabay.com (use downloadUrl from search_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, or STOCK_IMAGES_DOWNLOAD_DIR if 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 test

See CONTRIBUTING.md and SECURITY.md.

License

MIT

Reviews

No reviews yet

Be the first to review this server!