Get the FREE Ultimate OpenClaw Setup Guide →

pexels

A Pexels MCP Server for Images and Videos searching

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio garylab-pexels-mcp-server uvx pexels-mcp-server \
  --env PEXELS_API_KEY="<Your Pexels API key>"

How to use

This MCP server exposes the Pexels API via the Model Context Protocol, allowing MCP clients to search and retrieve photos, videos, and collections through the Pexels service. Available tools include photos_search, photos_curated, photo_get, videos_search, videos_popular, video_get, collections_featured, and collections_media. Clients configure an MCP server named pexels and then issue MCP actions that map to these tools, receiving results in the MCP data format. The server expects a Pexels API key to be supplied via environment variables (PEXELS_API_KEY). The recommended setup uses uv (uvx) to install and run the server automatically, but you can also run the server locally with Python by invoking the pexels_mcp_server module.

How to install

Prerequisites:

  • Python 3.8+ or uv (recommended) installed on your system
  • Access to a Pexels API key (required for actual results)

Installation options:

Option A: Using uv (recommended)

  1. Install uv if you haven’t already:
  2. Run the MCP server via uvx (no global install required):
    • This example assumes you will store the API key in an environment variable when running the server: uvx pexels-mcp-server

Option B: Install as a Python package and run with -m

  1. Install the package from PyPI: pip install pexels-mcp-server
  2. Run the server directly: python3 -m pexels_mcp_server

Option C: Global pip install (alternative)

  1. Install globally: pip install pexels-mcp-server
  2. Run the server: python3 -m pexels_mcp_server

Configuration:

  • Ensure you provide PEXELS_API_KEY in the environment where the server runs, e.g., export PEXELS_API_KEY=<Your Pexels API key>

Note: The server requires a valid Pexels API key to query the Pexels API and return results to clients.

Additional notes

Tips and common issues:

  • Ensure the PEXELS_API_KEY environment variable is set in the environment where the MCP server runs; without it, requests to Pexels may fail.
  • When using uv, the inspector tool can help debug MCP integrations: for uvx installations, you can run the inspector with npx @modelcontextprotocol/inspector uvx pexels-mcp-server.
  • If you encounter module import issues, verify that you’re running the server from the correct Python environment (venv) or that uv is managing the runtime correctly.
  • The server exposes multiple tools; ensure your MCP client calls the correct tool name (e.g., photos_search, video_get) and pass appropriate parameters as MCP data payloads.
  • For local development, you can clone the repository and run the server from source to test changes before publishing updates.

Related MCP Servers

Sponsor this space

Reach thousands of developers