
Stock Images MCP
io.github.jeanpfsv2.0.0更新于 Oct 7, 2026
Search and download free stock images from Pexels, Unsplash, and Pixabay.
概览
让助手在 Pexels、Unsplash 和 Pixabay 上搜索免费图库图片,并把选中的图片保存到本地文件夹。
- 功能
- 提供两个工具:search_images 可查询单个或全部已配置的图库服务商,返回 id、provider、url、thumbnail、description、author、authorUrl、downloadUrl、width、height 等字段,并在部分服务商失败时按服务商报告错误。download_image 从允许的服务商主机下载图片到本地下载目录,可指定子文件夹和文件名。
- 适用场景
- 适合助手需要为文档、网站或设计稿获取真实且已授权的图库照片,并直接下载而不是仅作描述的场景。也便于一次查询比较多个图片服务商的结果。
- 运行要求
- 通过 npx 以 stdio 在本地运行(需 Node.js 20+),也可用 Docker。至少需要一个服务商 API 密钥:PEXELS_API_KEY、PIXABAY_API_KEY 或 UNSPLASH_API_KEY;下载 Unsplash 图片必须提供 UNSPLASH_API_KEY。可选 STOCK_IMAGES_DOWNLOAD_DIR 指定下载目录(默认 ./downloads)。需要访问各服务商 API 的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Stock Images MCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
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
Setup
Get API keys (at least one required)
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):
Requires Node.js 20+.
Docker
From source
Tools
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
See CONTRIBUTING.md and SECURITY.md.
License
MIT
来源:README.md,提交 c1f214b
工具
0版本历史
1- v2.0.0最新Oct 7, 2026

