Stock Images MCP

io.github.jeanpfsv2.0.0更新於 Oct 7, 2026

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

已驗證STDIO僅桌面Files & StorageMedia & Design

概覽

AI 產生的概覽

讓助理在 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 的網路。
安裝前請注意
需要把第三方 API 金鑰(PEXELS_API_KEY、PIXABAY_API_KEY、UNSPLASH_API_KEY)寫入 MCP 設定,請妥善保護該檔案。download_image 會寫入檔案到磁碟,但會拒絕逃逸下載目錄的路徑,只儲存不超過 50 MiB 的圖片回應,且不覆寫既有檔案。圖片仍受各供應商授權條款約束,需依規定標註攝影者並檢視條款。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Stock Images MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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):

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

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

From source

bash
git clone https://github.com/jeanpfs/stock-images-mcp.gitcd stock-images-mcpnpm ci && npm run buildPEXELS_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

bash
npm cinpm run lint && npm run format:check && npm run typecheck && npm test

See CONTRIBUTING.md and SECURITY.md.

License

MIT

來源:README.md,提交 c1f214b

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v2.0.0最新Oct 7, 2026