Unsplash MCP Server
Provides tools for searching and retrieving photos from Unsplash, including random photo selection, with color/orientation filters, built-in attribution text/HTML, and download tracking for API compliance.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Unsplash MCP Server find 3 random photos of street food"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Unsplash MCP Server
An MCP (Model Context Protocol) server for fetching photos from Unsplash with proper attribution. Designed for LLMs building content pages that need properly credited images.
Features
Search Photos - Find photos by keyword with filters (color, orientation)
Random Photos - Get random photos for variety in content
Download Tracking - Compliant with Unsplash API guidelines
Full Attribution - Every photo includes ready-to-use attribution text and HTML
LLM-Optimized - Pre-formatted attribution strings for easy embedding
Related MCP server: Unsplash MCP Server
Why This Server?
Unsplash requires proper attribution when using their photos. This server makes it easy by including:
attribution_text: Plain text like "Photo by John Doe on Unsplash"attribution_html: Full HTML with proper links for web pages
Photo by <a href="https://unsplash.com/@johndoe">John Doe</a> on <a href="https://unsplash.com">Unsplash</a>Installation
Prerequisites
Python 3.11+
An Unsplash API access key (Get one here)
Quick Start
# Clone the repository
git clone https://github.com/cevatkerim/unsplash-mcp.git
cd unsplash-mcp
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install fastmcp httpx python-dotenv
# Set your API key
echo "UNSPLASH_ACCESS_KEY=your_key_here" > .env
# Run the server
fastmcp run server.pyConfiguration
Claude Code
Add to your ~/.claude.json (user-level) or project .mcp.json:
{
"mcpServers": {
"unsplash": {
"type": "stdio",
"command": "/path/to/unsplash-mcp/.venv/bin/fastmcp",
"args": ["run", "/path/to/unsplash-mcp/server.py"],
"env": {
"UNSPLASH_ACCESS_KEY": "your_access_key_here"
}
}
}
}Cursor
Add to your Cursor MCP settings:
{
"mcpServers": {
"unsplash": {
"command": "/path/to/unsplash-mcp/.venv/bin/fastmcp",
"args": ["run", "/path/to/unsplash-mcp/server.py"],
"env": {
"UNSPLASH_ACCESS_KEY": "your_access_key_here"
}
}
}
}Windsurf / Cline
Add to your MCP configuration:
{
"unsplash": {
"command": "/path/to/unsplash-mcp/.venv/bin/fastmcp",
"args": ["run", "/path/to/unsplash-mcp/server.py"],
"env": {
"UNSPLASH_ACCESS_KEY": "your_access_key_here"
}
}
}Tools
search_photos
Search for photos by keyword with optional filters.
Parameters:
Parameter | Type | Default | Description |
| string | required | Search keyword(s) |
| int | 1 | Page number |
| int | 10 | Results per page (1-30) |
| string | "relevant" | Sort: "relevant" or "latest" |
| string | null | Color filter (see below) |
| string | null | "landscape", "portrait", "squarish" |
| string | "low" | Safety: "low" or "high" |
Color options: black_and_white, black, white, yellow, orange, red, purple, magenta, green, teal, blue
Example:
search_photos("mountain sunset", per_page=5, orientation="landscape")get_random_photos
Get random photos, optionally filtered by keyword.
Parameters:
Parameter | Type | Default | Description |
| string | null | Optional keyword filter |
| int | 1 | Number of photos (1-30) |
| string | null | "landscape", "portrait", "squarish" |
| string | "low" | Safety: "low" or "high" |
Example:
get_random_photos(query="nature", count=3, orientation="landscape")track_download
Track a photo download (required by Unsplash API guidelines).
Parameters:
Parameter | Type | Description |
| string | Photo ID from search results |
Example:
track_download("abc123xyz")Response Format
Each photo includes:
{
"id": "abc123",
"description": "A beautiful mountain landscape",
"alt_description": "snow-capped mountains under blue sky",
"urls": {
"raw": "https://images.unsplash.com/...",
"full": "https://images.unsplash.com/...",
"regular": "https://images.unsplash.com/...", # Recommended for web
"small": "https://images.unsplash.com/...",
"thumb": "https://images.unsplash.com/..."
},
"width": 4000,
"height": 3000,
"color": "#a3c4f3", # Dominant color for placeholders
"blur_hash": "LKO2?U%2Tw=w...", # For progressive loading
# Attribution (REQUIRED when using the image)
"photographer_name": "John Doe",
"photographer_username": "johndoe",
"photographer_url": "https://unsplash.com/@johndoe?utm_source=...",
"photo_url": "https://unsplash.com/photos/abc123?utm_source=...",
# Ready-to-use attribution
"attribution_text": "Photo by John Doe on Unsplash",
"attribution_html": "Photo by <a href=\"...\">John Doe</a> on <a href=\"...\">Unsplash</a>"
}Usage Example
When an LLM builds a content page:
Search for relevant images:
photos = search_photos("coffee shop interior", per_page=5)Select a photo and use it:
<img src="{photo.urls.regular}" alt="{photo.alt_description}"> <p class="attribution">{photo.attribution_html}</p>If offering download, track it:
download_url = track_download(photo.id)
Unsplash API Guidelines
This server helps you comply with Unsplash API guidelines:
Attribution - Always credit the photographer and Unsplash (use
attribution_html)Hotlinking - Use the provided URLs directly (enables view tracking)
Download tracking - Call
track_download()when users download images
Rate Limits
Demo mode: 50 requests/hour
Production: 5,000 requests/hour (after approval)
License
MIT License - See LICENSE file.
Contributing
Contributions welcome! Please feel free to submit a Pull Request.
Support
If you find this project useful, consider buying me a coffee!
Acknowledgments
Available Tools
3 toolsget_random_photosGet Random PhotosA
Get random photos from Unsplash, optionally filtered by keyword.
Use this tool when you need variety or don't have a specific image in mind. Great for hero images, backgrounds, or when you want to avoid repetitive results.
Inputs: count, query, orientation, content_filter. Returns: result
search_photosSearch PhotosA
Search for photos on Unsplash by keyword.
Use this tool when you need to find photos for a specific topic or theme. Each result includes full attribution data that MUST be displayed when using the image (required by Unsplash API guidelines).
Inputs: query (required), page, color, order_by, +3 more. Returns: result
track_downloadTrack DownloadA
Track a photo download (REQUIRED by Unsplash API guidelines).
You MUST call this function when a user downloads or saves a photo. This is required by Unsplash's API guidelines to properly credit photographers and track usage statistics.
Call this AFTER the user confirms they want to download/use the image, not when just displaying search results.
Inputs: photo_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
search_photos and get_random_photos both retrieve photos and can both accept keywords, creating some potential overlap. However, their descriptions clearly distinguish deterministic search from random/variety-oriented retrieval, and track_download is a separate action.
All tools use snake_case and begin with a verb, giving a mostly predictable pattern. get_random_photos is slightly more compound than the others, but the convention remains readable and consistent.
Three tools is well-scoped for an Unsplash integration focused on photo discovery and required download tracking. Each tool has a clear, non-redundant role.
The set covers search, random discovery, and required download tracking, which are core workflows. However, it lacks a get_photo_by_id or equivalent operation for retrieving a specific photo directly, which is a notable gap for agents working with known photo identifiers.
Maintenance
Related MCP Connectors
Search photos and video moments by visual meaning, people, dates, and folders across local libraries, Apple Photos, and OneDrive. Manage collections, groups, favorites, people, and duplicate review. Synced metadata remains searchable while the desktop is offline; local and Apple Photos media access needs the owning device online with remote access enabled. OneDrive media can be accessed directly from the cloud. OAuth or Bearer API keys. Paid Cloud Access required; hosted visual search uses prepaid credits. Text-in-image search is semantic matching, not guaranteed exact OCR. Setup: https://organizewith.ai/en/guides/connect-ai-assistants
Run AI-powered analysis on images including moderation, captioning, tagging, and more.
Search attributed image prompts, retrieve full templates, and browse GPT Image Hub categories.
Search over 1.85 million captioned images using text, a reference image, or both. Upload a JPEG, PNG, or WebP image as base64, or provide a public HTTPS image URL. Find similar images from a Lightdrift asset ID and retrieve hosted file URLs, source licenses, and attribution. Connect with OAuth or an API key. Searches cost $0.005 ($5 per 1,000); image details are free. Setup: https://docs.lightdrift.ai/guides/images-mcp
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceProvides access to the Unsplash API, enabling AI assistants to search and retrieve high-quality photos, browse collections, view photographer profiles, and get photo statistics with advanced filtering options.148 npmMIT
- AlicenseBqualityDmaintenanceEnables users to search for high-quality photos on Unsplash with support for advanced filtering by orientation and content safety. It provides formatted photo metadata and images in either base64-encoded format or as JSON with URLs via stdio transport.131 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to search, recommend, and deliver professional stock photos from Unsplash with intelligent context awareness and automatic attribution management.39 npm64MIT
- AlicenseNot gradedqualityDmaintenanceEnables searching and downloading photos from Unsplash via the Unsplash API, with support for pagination, orientation filtering, and multiple resolutions.148 npm1MIT