npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

pexels-mcp-server

v1.0.0

Published

MCP server for handling model context protocol with Pexels API integration

Readme

Pexels MCP Server

A Model Context Protocol (MCP) server that provides access to the Pexels API, allowing AI models to search for and retrieve photos, videos, and collections from Pexels.

Features

  • Search for photos and videos by query, orientation, size, and color
  • Access curated and popular content from Pexels
  • Browse Pexels collections
  • Get detailed information about specific photos and videos
  • Access content via tools or direct URI resources

Requirements

Quick Start with npx

You can run this MCP server directly with npx without any installation:

npx pexels-mcp-server --api-key YOUR_PEXELS_API_KEY

Or set the API key as an environment variable:

PEXELS_API_KEY=YOUR_PEXELS_API_KEY npx pexels-mcp-server

Command Line Options

  • --api-key, -k <key>: Pexels API key (required)
  • --help, -h: Show help message

Usage Examples

# Using command line argument
npx pexels-mcp-server --api-key abc123def456

# Using environment variable
PEXELS_API_KEY=abc123def456 npx pexels-mcp-server

# Get help
npx pexels-mcp-server --help

Local Development

  1. Clone the repository
  2. Install dependencies
    pnpm install
  3. Build the project
    pnpm build
  4. Run in development mode
    PEXELS_API_KEY=your_api_key pnpm dev

API Usage

The server provides the following tools:

Photo Tools

  • searchPhotos: Search for photos by query (use descriptive keywords for relevant results, e.g., 'Thai hotel reception', 'red sports car driving', not just 'hotel' or 'car'; combine with parameters like orientation, size, color, and locale for refined results), with optional filters for orientation, size, color, locale (e.g., 'en-US', 'es-ES'), page, and results per page. Returns metadata including photo IDs and URLs, plus current API rate limit status.
  • downloadPhoto: Fetches a specific photo by its ID and desired size (optional, defaults to 'original'). Available sizes: 'original', 'large2x', 'large', 'medium', 'small', 'portrait', 'landscape', 'tiny'. Returns a direct download link for the requested image size, suggested filename (including size), and attribution information. The AI client should use its available local tools (like curl or PowerShell's Invoke-WebRequest) to download the photo using the provided link.
  • getCuratedPhotos: Retrieve a curated set of photos from Pexels, optionally paginated.
  • getPhoto: Retrieve detailed information about a specific photo by its ID.

Video Tools

  • searchVideos: Search for videos by query (use descriptive keywords for relevant results, e.g., 'drone footage beach sunset', 'time lapse city traffic', not just 'beach' or 'city'; combine with parameters like orientation and size for refined results), with optional filters for orientation, size, locale (e.g., 'en-US', 'es-ES'), page, and results per page. Returns metadata including video IDs and URLs, plus current API rate limit status.
  • getPopularVideos: Retrieve a list of popular videos from Pexels, with optional filters for dimensions, duration, page, and results per page.
  • getVideo: Retrieve detailed information about a specific video by its ID.
  • downloadVideo: Fetches a specific video by its ID and preferred quality (hd/sd). Returns a direct download link, suggested filename, and attribution information. The AI client should use its available local tools (like curl or PowerShell's Invoke-WebRequest) to download the video using the provided link.

Collection Tools

  • getFeaturedCollections: Retrieve a list of featured collections from Pexels, optionally paginated.
  • ~~getMyCollections~~: (Commented out in code) Requires OAuth 2.0 authentication, not supported by this server.
  • getCollectionMedia: Retrieve media items (photos or videos) from a specific collection by collection ID, with optional filters for type, sort order, page, and results per page.

Resources

The server provides the following URI-addressable resources:

  • pexels-photo://{id}: Access a specific photo by ID
  • pexels-video://{id}: Access a specific video by ID
  • pexels-collection://{id}: Access a specific collection by ID

Error Handling

The server attempts to provide informative error messages for common issues like invalid API keys, rate limits, or missing resources. Successful responses also include the current Pexels API rate limit status (remaining requests, reset time) in the output.

Attribution Requirements

When using the Pexels API, you must follow their attribution requirements:

  • Always show a prominent link to Pexels (e.g., "Photos provided by Pexels")
  • Always credit photographers (e.g., "Photo by John Doe on Pexels")

License

ISC