Stocky
Searches Pexels for royalty-free stock photos and retrieves rich metadata (dimensions, photographer, tags, every available image size), with support for orientation, colour and per-page filters, plus the ability to fetch details for a specific Pexels image and download it at a chosen size (thumbnail to original).
Searches Unsplash for royalty-free stock photography concurrently with Pexels, returning dimensions, photographer, tags and all image sizes with relevance/latest sorting and orientation/colour filters; also services image-detail lookups and size-specific downloads while reporting downloads to Unsplash's mandatory tracking endpoint and generating UTM-tagged attribution.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
StockyFind beautiful royalty-free stock images ๐ธ
Stocky is an MCP server that lets an AI assistant search, inspect and download royalty-free stock photography from Pexels and Unsplash.
๐ Version 2.0 โ already using Stocky? Read this
Your MCP client config keeps working. If it points at
stocky_mcp.py, that file is still there and still starts the server. Nothing breaks on upgrade.But
pip install -r requirements.txtwill fail โ that file is gone, and so issetup.py. From a source checkout, install withuv syncorpip install -e .instead. See Upgrading from 1.x for the two-minute version, or the CHANGELOG for everything.The headline changes:
pycurlis gone (so no more C build errors), searches actually run concurrently, failed providers now report why instead of returning nothing, and Python 3.10+ is required.
โจ Features
๐ Multi-provider search โ queries Pexels and Unsplash concurrently
๐ Rich metadata โ dimensions, photographer, tags and every image size
โ๏ธ Licence-aware โ generates the attribution each provider requires, and reports Unsplash downloads as their API guidelines demand
โฑ๏ธ Search caching โ a short TTL cache keeps repeat queries off your quota
๐ก๏ธ Honest errors โ a failing provider is reported, not silently returned as "no results"
๐ฏ Filters โ orientation, colour and sort, validated per provider

Beautiful stock photography at your fingertips Example image used for demonstration purposes
Stunning landscapes available through multiple providers
Photo by Simon Berger on Unsplash
Related MCP server: Unsplash MCP Server
๐ Quick start
1. Get API keys
Both are free:
Provider | Where | Notes |
Pexels ๐ท | 200 requests/hour by default | |
Unsplash ๐ | 50/hour in demo mode, 1000/hour once your app is approved |
You only need one โ Stocky runs with whichever providers are configured.
2. Add it to your MCP client
The recommended configuration needs no installation at all:
{
"mcpServers": {
"stocky": {
"command": "uvx",
"args": ["stocky-mcp"],
"env": {
"PEXELS_API_KEY": "your_pexels_key",
"UNSPLASH_ACCESS_KEY": "your_unsplash_key"
}
}
}
}Installed with pip or uv:
uv tool install stocky-mcp # or: pipx install stocky-mcp{
"mcpServers": {
"stocky": {
"command": "stocky-mcp",
"env": { "PEXELS_API_KEY": "your_pexels_key" }
}
}
}From a source checkout โ still supported so existing configurations keep working:
{
"mcpServers": {
"stocky": {
"command": "python",
"args": ["/path/to/stocky/stocky_mcp.py"],
"env": { "PEXELS_API_KEY": "your_pexels_key" }
}
}
}Stocky reads its configuration from the environment its client starts it in.
It does not load a .env file of its own, so keys must go in the env block
above.
โ๏ธ Configuration
Variable | Default | Purpose |
| โ | Enables the Pexels provider |
| โ | Enables the Unsplash provider |
|
| Include attribution details in every result |
|
| Search cache lifetime in seconds. |
|
| Per-request timeout in seconds |
|
| Refuse downloads larger than this (25 MiB) |
| โ | If set, confine all downloads to this directory |
|
|
|
|
| User-Agent sent to providers |
STOCKY_DOWNLOAD_ROOT is worth setting. Download paths come from
model-generated tool calls, and this confines writes to one directory. Stocky
always refuses a non-image file extension, and validates that image URLs from a
provider are public HTTP(S) addresses before fetching them, but a download root
is the strongest control available.
๐ Usage
Stocky exposes three MCP tools. You don't call them directly โ your client invokes them when you ask in natural language.
Search stock photos for a misty pine forest at dawn.
Find 30 landscape-orientation mountain photos from Pexels.
Download
pexels_123456at medium size to ~/Pictures/mountain.jpg
๐ ๏ธ Tools
search_stock_images
Parameter | Type | Default | Notes |
| str | required | Search terms |
| list | all configured |
|
| int |
| Clamped per provider: Pexels 80, Unsplash 30 |
| int |
| 1-based |
| str |
|
|
| str | โ |
|
| str | โ | A colour name; Pexels also accepts hex codes |
| bool | โ | Overrides |
Returns results grouped by provider, plus total_results and โ if any
provider failed โ an errors map explaining which and why.
An invalid orientation or color is dropped rather than forwarded: Pexels
silently ignores bad filters and still returns 200, which would otherwise hide
the mistake, while Unsplash rejects them outright with HTTP 400.
get_image_details
Parameter | Type | Default | Notes |
| str | required | Prefixed id, e.g. |
| bool | โ | Overrides |
download_image
Parameter | Type | Default | Notes |
| str | required | Prefixed id |
| str |
|
|
| str | โ | Omit to receive base64 data instead |
If a provider doesn't offer the requested size, the closest available one is used rather than failing.
Resource
stock-images://help โ a usage guide the assistant can read on demand.
โ๏ธ Licence and attribution
Images are free to use, but both providers require attribution as a condition of API access. This is not optional, and the previous version of this document was wrong to imply otherwise for Pexels.
Pexels requires a prominent link back to Pexels wherever API results are shown, and asks that you credit the photographer where possible.
Unsplash requires that you credit both the photographer and Unsplash, with UTM parameters on the links, and that images are hotlinked from the URLs the API returns rather than re-hosted.
Set ENABLE_ATTRIBUTION_LINKS=true and each result gains an attribution
block with ready-made text and html in the correct format for its provider.
Note on
download_image. Saving Unsplash bytes to disk or returning them base64-encoded is in tension with Unsplash's hotlinking requirement. Stocky fires the mandatory download-report endpoint whenever you download an Unsplash image, but if you are displaying images in an application, use the hotlinked URLs from the search results instead of downloading them.
Read the full terms: Pexels ยท Unsplash
โฌ๏ธ Upgrading from 1.x
Version 2.0 restructured the project. Existing MCP client configurations keep
working โ the root stocky_mcp.py is deliberately retained as a launcher โ
but installation changed, and a few behaviours are intentionally different.
What you need to do
If you run it via uvx or an installed console script, nothing. Upgrade
and carry on.
If you run it from a source checkout, reinstall. requirements.txt,
setup.py and setup.cfg were replaced by pyproject.toml:
git pull
uv sync # or: pip install -e .pip install -r requirements.txt now fails โ the file no longer exists.
Check your Python version. 2.0 requires Python 3.10+. The old
setup.py claimed 3.8 support, but the mcp SDK has always required 3.10, so
that claim was never actually satisfiable.
Consider switching to uvx. It needs nothing installed and avoids the
whole class of "which interpreter did my editor launch?" startup failures:
{
"mcpServers": {
"stocky": {
"command": "uvx",
"args": ["stocky-mcp"],
"env": { "PEXELS_API_KEY": "your_pexels_key" }
}
}
}What changed underneath
Change | Why it matters to you |
| No C extension to compile, so no more build failures on install. |
Searches now run concurrently | The old code was |
Failed providers report why | Previously an invalid API key returned an empty list, identical to a search that genuinely matched nothing. |
| Unsplash silently falls back to 10 above its maximum of 30, so asking for 50 used to return fewer images than asking for 30. |
Attribution generated for you | Both providers require it as a condition of API access. Set |
New configuration options | Caching, timeouts, download size caps and a download root โ see Configuration. |
The one thing that might affect your code
Only if you parse Stocky's responses programmatically. A search that fails
now returns an errors map naming the provider and the reason, where it used
to return an empty result list:
{
"query": "mountains",
"results": { "pexels": [], "unsplash": [ /* ... */ ] },
"errors": { "pexels": "pexels rejected the API key (HTTP 401)..." }
}If you treated "empty" as "no matches", check for errors too โ otherwise a
broken key looks like a query with no results. This is the fix, not a
regression, but it is a visible change.
Nothing else in the tool surface changed: search_stock_images,
get_image_details and download_image take the same arguments they always
did, so existing prompts and workflows are unaffected.
๐งโ๐ป Development
git clone https://github.com/joelio/stocky.git
cd stocky
uv sync --group devuv run pytest -m "not integration" # unit tests, no network
uv run pytest -m integration # needs real API keys
uv run ruff check . && uv run ruff format --check .
uv run mypySee CONTRIBUTING.md for more.
๐ Troubleshooting
Client reports a timeout on startup
Almost always a launch problem rather than a Stocky bug. GUI-launched clients
often have a minimal PATH, so uvx or a virtualenv python may not be
found โ use an absolute path, or uvx with uv installed system-wide. You can
reproduce the handshake yourself:
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}' \
| stocky-mcpA JSON response means the server is fine. Note that stdout carries the protocol, so Stocky sends all logging to stderr โ anything else printed there would corrupt the stream.
"No image providers are configured"
No keys reached the server. They must be in the env block of your client
config; names are case-sensitive.
A provider returns an error
Check errors in the response. Auth failures, rate limits and timeouts are
now reported explicitly rather than looking like an empty result set.
Pexels seems to accept an invalid key It does. Pexels returns 200 for a malformed key, so a typo can look like it works. If results seem wrong, verify the key directly.
Rate limits
Provider | Limit | On exhaustion |
Pexels | 200/hour (default, per key) | HTTP 429 |
Unsplash | 50/hour demo, 1000/hour production | HTTP 403 with |
๐ค Contributing
Contributions are welcome โ see CONTRIBUTING.md. For major changes, please open an issue first to discuss the approach.
๐ Acknowledgments
Built with the Model Context Protocol
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
This server cannot be deployed
Maintenance
Related MCP Connectors
Search photos and video moments by visual meaning, people, dates, and folders across local libraries, Apple Photos, and OneDrive. Manage collections, groups, favorites, people, and duplicate review. Synced metadata remains searchable while the desktop is offline; local and Apple Photos media access needs the owning device online with remote access enabled. OneDrive media can be accessed directly from the cloud. OAuth or Bearer API keys. Paid Cloud Access required; hosted visual search uses prepaid credits. Text-in-image search is semantic matching, not guaranteed exact OCR. Setup: https://organizewith.ai/en/guides/connect-ai-assistants
Find free-to-use stock photos by words, by image or by similarity; every result names its licence.
Search and license documentary photos. AI agents pay on their own with a prepaid wallet key.
Search CC0 photos and build placeholder image URLs at exact sizes with Lorem Picsum.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables searching and retrieving high-quality stock photos from Pexels with advanced filtering options including orientation, size, color, and localization support.MIT
- AlicenseAqualityBmaintenanceProvides access to the Unsplash API, enabling AI assistants to search and retrieve high-quality photos, browse collections, view photographer profiles, and get photo statistics with advanced filtering options.10MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to search, recommend, and deliver professional stock photos from Unsplash with intelligent context awareness and automatic attribution management.17 npm64MIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables searching and retrieving free photos and videos from Pexels using natural language queries, with support for filters like orientation, size, color, and duration.MIT