Skip to main content
Glama

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

Related MCP server: Pexels MCP Server

Setup

Get API keys (at least one required)

Provider

Env var

Get a key

Pexels

PEXELS_API_KEY

https://www.pexels.com/api/

Unsplash

UNSPLASH_API_KEY

https://unsplash.com/developers

Pixabay

PIXABAY_API_KEY

https://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

Available Tools

2 tools
download_imageC

Download a stock image to local folder

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesURL of the image to download
filenameNoOutput filename (auto-generated if omitted)
folderNoDestination folder (default: ./downloads)./downloads

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions downloading to a local folder but lacks details on permissions needed, file system impacts, error handling, or rate limits. For a tool that writes to disk, this is a significant gap in safety and operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core action and destination without any wasted words. It's appropriately sized for the tool's complexity and gets straight to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a tool that performs file system writes. It lacks details on behavioral traits, error responses, or output format, which are critical for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the input schema already documents all parameters thoroughly. The description adds no additional meaning beyond implying 'stock image' for the URL, but this is minimal value. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('download') and resource ('stock image') with destination ('to local folder'), making the purpose immediately understandable. However, it doesn't differentiate from the sibling 'search_images' tool, which would require explicit comparison to achieve a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus the sibling 'search_images' or any alternatives. The description implies usage for downloading stock images but doesn't specify prerequisites, constraints, or when not to use it, leaving the agent without contextual direction.

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

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYesSearch term for images
providerNoWhich provider to search (default: all configured)all
countNoNumber of images per provider (default: 5, max: 20)
orientationNoImage orientation filter

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states the basic action. It doesn't disclose behavioral traits like rate limits, authentication needs, pagination behavior, response format, or what happens when providers fail. For a search tool with no annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point. It's appropriately sized for a search tool, though it could be slightly more informative without losing conciseness. No wasted words or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a search tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns (image metadata, URLs, thumbnails?), how results are structured, or any limitations beyond the basic purpose. The agent would need to guess about the output format and behavioral characteristics.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 4 parameters. The description adds minimal value beyond the schema - it mentions 'available providers: pexels' which partially explains the provider parameter, but doesn't clarify the relationship between 'pexels' and the enum values or what 'all' means. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'search' and resource 'stock images across providers', with specific mention of 'pexels' as an available provider. It distinguishes from the sibling 'download_image' by focusing on search rather than download, though it doesn't explicitly contrast them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'download_image'. It mentions 'available providers: pexels' but doesn't explain when to choose specific providers or what 'all' means in practice. No usage context or exclusions are provided.

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.

  1. 2 tool updatesv1.0.0
    • First observeddownload_image
    • First observedsearch_images

TDQS

B3.1/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: one for searching images and one for downloading them. There is no overlap or ambiguity between these functions, making it easy for an agent to select the correct tool based on the task.

Naming Consistency5/5

Both tool names follow a consistent verb_noun pattern (search_images, download_image) with clear, descriptive verbs. The naming is uniform and predictable throughout the set.

Tool Count2/5

With only two tools, the server feels under-scoped for a stock image domain. A typical stock image service would benefit from additional operations like filtering results, viewing image details, or managing downloads, making this set too minimal for effective agent workflows.

Completeness2/5

The tool surface is severely incomplete for stock image operations. It lacks basic CRUD-like functions such as viewing image metadata, filtering searches, or handling multiple providers beyond Pexels. This will likely cause agent failures when trying to perform common tasks in this domain.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers