unsplash-mcp
Provides tools for searching and retrieving photos from Unsplash with proper attribution, including search with filters (color, orientation), random photos, and download tracking, all compliant with Unsplash API guidelines.
Click on "Install 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-mcpsearch for photos of mountain landscapes"
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
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_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.
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Optional keyword to filter random photos (e.g. "nature", "technology") | |
| count | No | Number of random photos to return, 1-30 (default: 1) | |
| orientation | No | Filter by orientation - landscape, portrait, squarish | |
| content_filter | No | Safety filter - "low" (default) or "high" (stricter) | low |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description bears full burden. Mentions random nature and optional filters but lacks details on side effects, rate limits, or auth requirements. Adequate for a simple read tool but could be more informative.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with core function. Every sentence adds value: purpose, usage guidance, and differentiation. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists, so return values are covered. Description explains randomness, optional keyword, and suitable use cases. Lacks details on error handling or count limits, but overall sufficient for intended use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. Description only adds that query is a keyword filter; other parameters (count, orientation, content_filter) are left to schema. No additional meaningful context beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states verb 'Get random photos' and resource 'from Unsplash', with optional keyword filter. Distinguishes from sibling 'search_photos' by emphasizing variety and lack of specific intent.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly suggests use cases (hero images, backgrounds) and when to use (variety, no specific image). Implicitly contrasts with search_photos for specific needs, though no direct 'do not use when' clause.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_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).
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search keyword(s), e.g. "mountain landscape", "coffee shop interior" | |
| page | No | Page number for pagination (default: 1) | |
| per_page | No | Number of results per page, 1-30 (default: 10) | |
| order_by | No | Sort order - "relevant" (best match) or "latest" (newest first) | relevant |
| color | No | Filter by color - black_and_white, black, white, yellow, orange, red, purple, magenta, green, teal, blue | |
| orientation | No | Filter by orientation - landscape, portrait, squarish | |
| content_filter | No | Safety filter - "low" (default) or "high" (stricter) | low |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It adds one behavioral requirement: 'full attribution data that MUST be displayed.' However, it does not disclose other behaviors such as rate limits, pagination behavior, or error handling. The attribution info is useful but insufficient for full transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: two sentences, no wasted words. The first sentence states the purpose, and the second provides usage context and a crucial requirement. It is front-loaded and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that an output schema exists, the description does not need to explain return values. It covers the main purpose and a key usage requirement (attribution). However, with 7 parameters and no annotations, it could briefly mention pagination or sorting behavior (already in schema but not highlighted). Still, it is reasonably complete for a search tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds no additional parameter semantics beyond what is in the schema. Baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Search for photos on Unsplash by keyword,' which is a specific verb+resource. It is easily distinguishable from sibling tools like get_random_photos (random selection) and track_download (tracking), even though no explicit differentiation is provided.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: 'Use this tool when you need to find photos for a specific topic or theme.' It also mentions the attribution requirement. However, it does not explicitly state when not to use this tool or how it compares to siblings, which would improve guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
track_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.
| Name | Required | Description | Default |
|---|---|---|---|
| photo_id | Yes | The photo ID from a previous search_photos or get_random_photos result |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of behavioral disclosure. It explains that the tool is mandatory for API compliance and tracks usage statistics, but does not detail side effects (e.g., whether it mutates state), rate limits, authorization needs, or return behavior. The requirement 'MUST call' is clear, but additional context on what exactly happens when called (e.g., API call logging) is lacking.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is highly concise with four sentences, each adding distinct value: requirement statement, when to call, why required, and when not to call. No redundancies or unnecessary details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool is simple (1 required parameter, output schema present), the description adequately covers usage context, necessity, and timing. It does not explain return values, but the presence of an output schema mitigates that need. Minor gap: no mention of error handling or idempotency, but overall complete for the tool's purpose.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds no additional meaning to the 'photo_id' parameter beyond what the schema already provides ('The photo ID from a previous search_photos or get_random_photos result'). The description merely references this parameter context without enriching it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: tracking photo downloads as required by Unsplash API guidelines. It specifies the action ('track a photo download'), the resource (photo), and distinguishes from sibling tools like search_photos and get_random_photos by noting when to call it ('AFTER the user confirms they want to download/use the image') and when not to ('not when just displaying search results').
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly provides usage context: it must be called when a user downloads or saves a photo, and is required by Unsplash guidelines. It also states when NOT to use it ('not when just displaying search results'). However, it does not explicitly name alternative tools or explain why search tools are inappropriate for tracking, missing an opportunity for full sibling differentiation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v1.0.0- First observed
get_random_photos - First observed
search_photos - First observed
track_download
TDQS
Each tool has a clearly distinct purpose: random photos, keyword search, and download tracking. There is no overlap or confusion.
All tools follow a consistent verb_noun pattern (get_random_photos, search_photos, track_download), making it easy to predict their function.
Three tools is appropriate for the scope: retrieving photos (random or search) and tracking downloads. Not excessive or insufficient.
The set covers the core workflow of finding and downloading photos with required attribution tracking. Minor gap: no tool for retrieving a specific photo by ID, but the random and search tools cover most use cases.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
Capability registry for the agentic economy. Semantic search over verified MCP server listings.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server for the Unsplash API that enables searching, downloading, and inserting high-quality images with automatic photographer attribution into local projects.321MIT
- AlicenseAqualityCmaintenanceMCP server that enables searching and downloading Unsplash photos and collections.4MIT
- AlicenseAqualityFmaintenanceAn MCP server that enables AI assistants to search for royalty-free images from Pexels and Unsplash using natural language, returning structured results with metadata.559MIT
- AlicenseAqualityAmaintenanceProduction-ready Model Context Protocol (MCP) server for the Unsplash API — search photos, fetch details, and stay compliant with Unsplash attribution & download-tracking guidelines. Unofficial; not affiliated with or endorsed by Unsplash.29881MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cevatkerim/unsplash-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server