
Pexels
io.github.developer-ishan由 GitHub 帳號 developer-ishan 發布v1.0.2更新於 Oct 24, 2026
MCP server for searching Pexels stock photos, videos, and curated collections.
概覽
讓助理搜尋 Pexels 的免費圖庫照片、影片與精選合輯,並把免權利金素材帶進工作流程。
- 可以做什麼
- 將 Pexels API 包裝成九個工具:照片搜尋、精選照片動態與依編號取得單張照片;影片搜尋、熱門影片與依編號取得單支影片;以及精選合輯、已驗證使用者自己的合輯與合輯內的素材。回應是 Pexels 原始 JSON,並附加 _rateLimit 欄位,包含 limit、remaining 與 reset,方便助理自行限流。結果會附上攝影師或攝影者的署名。
- 適用情境
- 適合助理需要真實圖庫圖片或影片的情境:為簡報與文件配圖、為部落格或社群貼文建議縮圖、製作情緒板、尋找背景影片片段,或為程式開發工作產生佔位圖片。如果只需要照片且已接上通用圖片伺服器,就不必再加。
- 執行需求
- 透過 npx(npm 套件 mcp-pexels)以 stdio 在本機執行,需要 Node.js 20 或以上版本。需要免費的 Pexels API 金鑰,透過環境變數 PEXELS_API_KEY 提供,並需要連線到 Pexels HTTPS API 的網路。僅支援桌面版 MCP 用戶端;網頁版不支援 stdio 伺服器。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Pexels,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
mcp-pexels — Pexels MCP server for Claude, Cursor, and other AI agents
[npm version] [npm downloads] [CI] [license: MIT] [Node ≥20] [MCP compatible]
A Model Context Protocol server that exposes the Pexels API — free stock photos, videos, and curated collections — as MCP tools that any compatible AI client (Claude Desktop, Claude Code, Cursor, Cline, Continue, etc.) can call directly from a chat.
📦 npm: mcp-pexels · 🏷 Latest release: v1.0.0 · 💻 Source: developer-ishan/mcp-pexels
Photos & videos provided by Pexels.
Drop-in config
Paste into your MCP client's config, restart, and the nine pexels_* tools are live. Get a free key at https://www.pexels.com/api/.
Table of contents
- What can you build with this?
- Capabilities — nine tools
- Connect to your MCP client
- Example prompts
- How it compares
- FAQ
- Requirements
- Development
- Releasing
- Contributing
- Attribution & License
What can you build with this?
Once mcp-pexels is connected to an AI client, the agent can pull royalty-free photos and videos straight into its workflow. A few concrete uses:
- Slide-deck and document illustration — "Find me a landscape photo of mountains at sunset for slide 3" → the agent searches Pexels, picks one, and embeds it.
- Blog post / social media drafting — "Suggest three thumbnail options for an article about remote work" → returns three Pexels URLs with photographer credit.
- Background research for video editing — "Show me popular drone footage under 30 seconds in 4K" → uses
pexels_popular_videoswith size and duration filters. - Mood boards — "Build me a mood board of warm-toned coffee shop photos" → searches with
color: "orange". - Coding agents — generate CSS/HTML with realistic placeholder imagery instead of
lorem-pixelboxes. - Curated collections — pull a specific Pexels collection (e.g. company-owned shots tagged on Pexels) into the agent's context.
Because every response includes a _rateLimit object, the agent can self-throttle and respect the Pexels free-tier quota (200 req/hour, 20 000/month).
Capabilities — nine tools
Each tool response is the raw Pexels JSON merged with a top-level _rateLimit field exposing limit, remaining, and reset (UNIX timestamp).
See docs/tools/ for per-tool parameter tables and example payloads.
Connect to your MCP client
All paths below use npx -y mcp-pexels — no global install required. Replace your_key_here with a real Pexels API key.
Claude Desktop
Option 1 — one-click .mcpb install (recommended). Download the latest mcp-pexels-*.mcpb from the Releases page, double-click the file, paste your Pexels API key when Claude Desktop prompts, and click Install.
Option 2 — manual JSON config. Edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Restart Claude Desktop.
Claude Code
Or edit ~/.claude.json directly and add the same mcpServers block as above.
Cursor
Edit ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):
Cline (VS Code)
Open the Cline extension settings → MCP Servers → Edit Settings. Add:
Continue.dev
In ~/.continue/config.json:
Generic / other clients
If your client supports stdio MCP servers it just needs command, args, and env. Use the same shape as Cursor / Claude Desktop above. For inspector / debugging:
This opens a browser UI where you can call each tool interactively.
Example prompts
Once connected, try prompts like:
- "Find me five landscape photos of mountains at golden hour. Make sure they're at least full HD."
- "Get me popular Pexels videos shorter than 15 seconds, 1080p or higher, of city traffic."
- "Pull photo id 2014422 and tell me the photographer."
- "List the featured Pexels collections — I want one I can browse for cooking photos."
- "Search videos of 'forest' in portrait orientation; pick the highest-quality HD file for me."
- "Show me Pexels photos with predominantly orange tones suitable for a fall-themed newsletter header."
The agent will pick the appropriate tool, send the right parameters, and include photographer/videographer credit as part of its answer.
How it compares
If you only need photos and you already have a generic image MCP server wired up, that may be enough. If you want first-class video and collection support with rate-limit awareness, this is purpose-built for it.
FAQ
How do I get a Pexels API key?
Sign up at https://www.pexels.com/api/ — keys are issued instantly and the free tier allows 200 requests/hour and 20 000 requests/month.
Does this cost anything?
No. The Pexels API is free, the npm package is free (MIT), and mcp-pexels itself does not call any paid service.
Will this work offline?
No — the server is a thin wrapper over the Pexels HTTPS API and requires network access.
Can I use Pexels content commercially?
Yes, per the Pexels license, but you must attribute the platform and (when possible) the photographer. See Attribution.
Does it work with Claude.ai (browser)?
Claude.ai's web product doesn't yet support stdio MCP servers — only Claude Desktop, Claude Code, and the API do. Anthropic is rolling out browser MCP support, so this should change.
Is there a hosted / SaaS version?
No. Run it locally via npx. Because Pexels API keys are per-user, hosting a shared instance doesn't make sense.
How do I update to a newer version?
npx always fetches the latest published version. If you've installed globally, run npm update -g mcp-pexels.
Can I add more Pexels endpoints?
The Pexels API surface is fully implemented (9/9 endpoints as of Pexels API v1). New endpoints will be added via PR — see Contributing.
Does it work with @modelcontextprotocol/inspector?
Yes:
How is rate limiting handled?
Every tool response includes a _rateLimit object with limit, remaining, and reset (UNIX timestamp). The agent can read this and self-throttle. If Pexels returns 429, the server surfaces it as a PexelsApiError so the agent sees the failure.
Where does my API key go?
It is read from the PEXELS_API_KEY env var on the local process. It never leaves your machine except in Authorization headers to api.pexels.com. Nothing is logged.
Requirements
- Node.js ≥ 20 (uses native
fetchand--env-file) - A free Pexels API key — request one here
Development
Project layout
Testing approach
Tests construct a PexelsClient with a vi.fn() fetchImpl returned by makeMockClient(responses). No real HTTP is performed. Each tool is exercised for:
- Happy path — URL serialization and
Authorizationheader. - Error mapping — non-2xx →
PexelsApiErrorwithstatusandbody. - Zod validation — required params, enum membership, integer bounds.
Releasing
This repo uses a tag-driven release workflow (.github/workflows/release.yml):
- Bump the version:
npm version patch(orminor/major) — creates a commit and tag. - Push:
git push && git push --tags. - The workflow runs tests, builds, publishes to npm with provenance using the
NPM_TOKENrepository secret, builds the.mcpbbundle vianpm run pack:mcpb, and creates a GitHub release with auto-generated notes that includes the bundle as a downloadable asset.
See CHANGELOG.md for version history.
Contributing
Issues and pull requests welcome. See CONTRIBUTING.md for the development workflow and SECURITY.md to report a vulnerability privately.
If you ship mcp-pexels inside a tool or product, open a PR adding it to the "Used by" list in CONTRIBUTING.md.
Listed on / submit to
- Smithery — auto-discovered via
smithery.yaml. - mcp.so — community directory.
- awesome-mcp-servers — curated GitHub list.
- modelcontextprotocol/servers — Anthropic's official directory.
See docs/MARKETPLACES.md for the submission cheatsheet.
Attribution & License
When you use Pexels content, please follow the Pexels API guidelines:
- Show a prominent link to Pexels — e.g. "Photos provided by Pexels".
- Credit photographers/videographers when possible — e.g. "Photo by John Doe on Pexels".
The mcp-pexels package itself is released under the MIT License.
來源:README.md,提交 218c9a8
工具
0版本歷史
1- v1.0.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分