The Unsplash MCP Server provides a Model Context Protocol implementation allowing Large Language Models (LLMs) to search and retrieve photos from Unsplash. This server enables integration with LLMs through tools like search_photos
, get_photo
, and random_photo
to leverage Unsplash's extensive photo collection.
Search for photos on Unsplash with various parameters:
query
(string, required): Search keywordpage
(number, optional): Page number (1-based), default: 1per_page
(number, optional): Results per page (1-30), default: 10order_by
(string, optional): Sort method (relevant or latest), default: "relevant"color
(string, optional): Color filter (black_and_white, black, white, yellow, orange, red, purple, magenta, green, teal, blue)orientation
(string, optional): Orientation filter (landscape, portrait, squarish)Get detailed information about a specific photo:
photoId
(string, required): The photo ID to retrieveGet one or more random photos with filters:
count
(number, optional): Number of photos to return (Default: 1; Max: 30)collections
(string, optional): Public collection ID('s), comma-separated if multipletopics
(string, optional): Public topic ID('s), comma-separated if multipleusername
(string, optional): Limit selection to a specific userquery
(string, optional): Limit selection to photos matching a search termorientation
(string, optional): Filter by photo orientation (landscape, portrait, squarish)content_filter
(string, optional): Limit results by content safety (low, high)featured
(boolean, optional): Limit selection to featured photosDownload the latest pre-built binary for your platform from the GitHub Releases page.
# Download the arm64 version
curl -L https://github.com/okooo5km/unsplash-mcp-server-go/releases/latest/download/unsplash-mcp-server-macos-arm64.zip -o unsplash-mcp-server.zip
unzip unsplash-mcp-server.zip
chmod +x unsplash-mcp-server
# Remove quarantine attribute to avoid security warnings
xattr -d com.apple.quarantine unsplash-mcp-server
# Install to your local bin directory
mkdir -p ~/.local/bin
mv unsplash-mcp-server ~/.local/bin/
rm unsplash-mcp-server.zip
# Download the x86_64 version
curl -L https://github.com/okooo5km/unsplash-mcp-server-go/releases/latest/download/unsplash-mcp-server-macos-x86_64.zip -o unsplash-mcp-server.zip
unzip unsplash-mcp-server.zip
chmod +x unsplash-mcp-server
# Remove quarantine attribute to avoid security warnings
xattr -d com.apple.quarantine unsplash-mcp-server
# Install to your local bin directory
mkdir -p ~/.local/bin
mv unsplash-mcp-server ~/.local/bin/
rm unsplash-mcp-server.zip
# Download the amd64 version
curl -L https://github.com/okooo5km/unsplash-mcp-server-go/releases/latest/download/unsplash-mcp-server-linux-amd64.tar.gz -o unsplash-mcp-server.tar.gz
tar -xzf unsplash-mcp-server.tar.gz
chmod +x unsplash-mcp-server
# Install to your local bin directory
mkdir -p ~/.local/bin
mv unsplash-mcp-server ~/.local/bin/
rm unsplash-mcp-server.tar.gz
unsplash-mcp-server.exe
to a location in your PATHClone the repository:
git clone https://github.com/okooo5km/unsplash-mcp-server-go.git
cd unsplash-mcp-server-go
Build the project:
# Using Make (recommended)
make
# Or using Go directly
go build -o unsplash-mcp-server
Install the binary:
mkdir -p ~/.local/bin
cp unsplash-mcp-server ~/.local/bin/
Make sure ~/.local/bin
is in your PATH by adding to your shell configuration file:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc # or ~/.bashrc
source ~/.zshrc # or source ~/.bashrc
export UNSPLASH_ACCESS_KEY="your-access-key-here"
Add to your Claude settings:
"mcpServers": {
"unsplash": {
"command": "unsplash-mcp-server",
"env": {
"UNSPLASH_ACCESS_KEY": "your-access-key-here"
}
}
}
Add to your Cursor editor's settings.json
:
{
"mcpServers": {
"unsplash": {
"command": "unsplash-mcp-server",
"env": {
"UNSPLASH_ACCESS_KEY": "your-access-key-here"
}
}
}
}
The server supports these command line arguments:
-h, --help
: Display help information-v, --version
: Display the version number-t, --transport <string>
: Transport type (default: "stdio")
stdio
: Standard input/output modesse
: Server-Sent Events mode-p, --port <int>
: Port to use in SSE mode (default: 8080)Example usage:
# Start server with default settings (stdio mode)
unsplash-mcp-server
# Start server in SSE mode on the default port
unsplash-mcp-server --transport sse
# Start server in SSE mode on a custom port
unsplash-mcp-server --transport sse --port 9090
{
"query": "mountain landscape",
"per_page": 5,
"color": "blue",
"orientation": "landscape"
}
{
"photoId": "Dwu85P9SOIk"
}
{
"count": 3,
"query": "coffee",
"orientation": "portrait"
}
You can use this system prompt to help LLMs utilize the server effectively:
You have access to Unsplash photo search tools through MCP. You can:
1. Search for photos using specific keywords, colors, or orientations:
- Use the search_photos tool to find images on any topic
- Filter by color or orientation as needed
- You can page through results and control how many appear per page
2. Get detailed information about specific photos:
- Use get_photo with a photo ID to retrieve comprehensive details
- This includes EXIF data, location info, and photographer details
3. Fetch random photos with customizable filters:
- Use random_photo tool to get surprise images based on criteria
- Filter random selections by topic, collection, username, etc.
When the user asks for images, use these tools to find relevant Unsplash photos.
Include photo URLs in your responses so users can view the images.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.