Get the FREE Ultimate OpenClaw Setup Guide →

pexels

MCP server from CaullenOmdahl/pexels-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio caullenomdahl-pexels-mcp-server node server.js \
  --env PEXELS_API_KEY="your_pexels_api_key"

How to use

This MCP server provides access to the Pexels API, exposing tools to search and retrieve photos, videos, and collections from Pexels. Clients can call photo tools such as searchPhotos, downloadPhoto, getCuratedPhotos, and getPhoto to discover and fetch imagery, as well as video tools like searchVideos, getPopularVideos, getVideo, and downloadVideo for motion content. Collection tools include getFeaturedCollections and getCollectionMedia to explore curated groups of media. Each operation returns metadata including IDs, URLs, and attribution details, along with the current API rate limit status. Resources are exposed as URIs (pexels-photo://{id}, pexels-video://{id}, pexels-collection://{id}) to enable direct referencing in workflows and tools.

To use the server, provide your Pexels API key in the environment (PEXELS_API_KEY) when starting the server. Tools can then be invoked by your AI agent or client, and downloaded assets can be retrieved using the supplied direct links. The server emphasizes proper attribution per Pexels requirements, and error messages include rate-limit status and guidance for common issues.

How to install

Prerequisites:

  • Node.js 18 or higher
  • PNPM or npm
  • Access to a Pexels API key

Installation steps:

  1. Clone the repository git clone https://github.com/caullenomdahl/pexels-mcp-server.git cd pexels-mcp-server

  2. Install dependencies

    • If using PNPM: pnpm install
    • If using npm: npm install
  3. Build the project (if applicable) pnpm build

    or with npm

    npm run build

  4. Run in development mode (set your API key) PEXELS_API_KEY=your_api_key pnpm dev

    or with npm

    PEXELS_API_KEY=your_api_key npm run dev

Note: Replace your_api_key with your actual Pexels API key. The server expects the key in the PEXELS_API_KEY environment variable at runtime.

Additional notes

Environment and configuration tips:

  • The server requires a valid Pexels API key (set via PEXELS_API_KEY).
  • For deployment, ensure the key is injected through your hosting environment or deployment configuration (e.g., Smithery settings).
  • If you encounter rate-limit issues, monitor the rate-limit fields returned with API responses and implement backoff in your client.
  • The server exposes URI resources (pexels-photo://, pexels-video://, pexels-collection://) for easy referencing in tools and pipelines.
  • When using downloadPhoto or downloadVideo, leverage your local download capabilities (curl, Invoke-WebRequest, etc.) to fetch the asset from the provided direct link.
  • If you modify or expand tools, update the corresponding documentation to reflect new capabilities and required parameters.

Related MCP Servers

Sponsor this space

Reach thousands of developers