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. - 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 pho
Add this skill
npx mdskills install cevatkerim/unsplash-mcpWell-documented MCP server with useful Unsplash integration and built-in attribution compliance
1# Unsplash MCP Server23An MCP (Model Context Protocol) server for fetching photos from [Unsplash](https://unsplash.com) with **proper attribution**. Designed for LLMs building content pages that need properly credited images.45## Features67- **Search Photos** - Find photos by keyword with filters (color, orientation)8- **Random Photos** - Get random photos for variety in content9- **Download Tracking** - Compliant with Unsplash API guidelines10- **Full Attribution** - Every photo includes ready-to-use attribution text and HTML11- **LLM-Optimized** - Pre-formatted attribution strings for easy embedding1213## Why This Server?1415Unsplash requires proper attribution when using their photos. This server makes it easy by including:1617- `attribution_text`: Plain text like "Photo by John Doe on Unsplash"18- `attribution_html`: Full HTML with proper links for web pages1920```html21Photo by <a href="https://unsplash.com/@johndoe">John Doe</a> on <a href="https://unsplash.com">Unsplash</a>22```2324## Installation2526### Prerequisites2728- Python 3.11+29- An Unsplash API access key ([Get one here](https://unsplash.com/developers))3031### Quick Start3233```bash34# Clone the repository35git clone https://github.com/cevatkerim/unsplash-mcp.git36cd unsplash-mcp3738# Create virtual environment39python3 -m venv .venv40source .venv/bin/activate4142# Install dependencies43pip install fastmcp httpx python-dotenv4445# Set your API key46echo "UNSPLASH_ACCESS_KEY=your_key_here" > .env4748# Run the server49fastmcp run server.py50```5152## Configuration5354### Claude Code5556Add to your `~/.claude.json` (user-level) or project `.mcp.json`:5758```json59{60 "mcpServers": {61 "unsplash": {62 "type": "stdio",63 "command": "/path/to/unsplash-mcp/.venv/bin/fastmcp",64 "args": ["run", "/path/to/unsplash-mcp/server.py"],65 "env": {66 "UNSPLASH_ACCESS_KEY": "your_access_key_here"67 }68 }69 }70}71```7273### Cursor7475Add to your Cursor MCP settings:7677```json78{79 "mcpServers": {80 "unsplash": {81 "command": "/path/to/unsplash-mcp/.venv/bin/fastmcp",82 "args": ["run", "/path/to/unsplash-mcp/server.py"],83 "env": {84 "UNSPLASH_ACCESS_KEY": "your_access_key_here"85 }86 }87 }88}89```9091### Windsurf / Cline9293Add to your MCP configuration:9495```json96{97 "unsplash": {98 "command": "/path/to/unsplash-mcp/.venv/bin/fastmcp",99 "args": ["run", "/path/to/unsplash-mcp/server.py"],100 "env": {101 "UNSPLASH_ACCESS_KEY": "your_access_key_here"102 }103 }104}105```106107## Tools108109### `search_photos`110111Search for photos by keyword with optional filters.112113**Parameters:**114| Parameter | Type | Default | Description |115|-----------|------|---------|-------------|116| `query` | string | required | Search keyword(s) |117| `page` | int | 1 | Page number |118| `per_page` | int | 10 | Results per page (1-30) |119| `order_by` | string | "relevant" | Sort: "relevant" or "latest" |120| `color` | string | null | Color filter (see below) |121| `orientation` | string | null | "landscape", "portrait", "squarish" |122| `content_filter` | string | "low" | Safety: "low" or "high" |123124**Color options:** `black_and_white`, `black`, `white`, `yellow`, `orange`, `red`, `purple`, `magenta`, `green`, `teal`, `blue`125126**Example:**127```128search_photos("mountain sunset", per_page=5, orientation="landscape")129```130131### `get_random_photos`132133Get random photos, optionally filtered by keyword.134135**Parameters:**136| Parameter | Type | Default | Description |137|-----------|------|---------|-------------|138| `query` | string | null | Optional keyword filter |139| `count` | int | 1 | Number of photos (1-30) |140| `orientation` | string | null | "landscape", "portrait", "squarish" |141| `content_filter` | string | "low" | Safety: "low" or "high" |142143**Example:**144```145get_random_photos(query="nature", count=3, orientation="landscape")146```147148### `track_download`149150Track a photo download (required by Unsplash API guidelines).151152**Parameters:**153| Parameter | Type | Description |154|-----------|------|-------------|155| `photo_id` | string | Photo ID from search results |156157**Example:**158```159track_download("abc123xyz")160```161162## Response Format163164Each photo includes:165166```python167{168 "id": "abc123",169 "description": "A beautiful mountain landscape",170 "alt_description": "snow-capped mountains under blue sky",171 "urls": {172 "raw": "https://images.unsplash.com/...",173 "full": "https://images.unsplash.com/...",174 "regular": "https://images.unsplash.com/...", # Recommended for web175 "small": "https://images.unsplash.com/...",176 "thumb": "https://images.unsplash.com/..."177 },178 "width": 4000,179 "height": 3000,180 "color": "#a3c4f3", # Dominant color for placeholders181 "blur_hash": "LKO2?U%2Tw=w...", # For progressive loading182183 # Attribution (REQUIRED when using the image)184 "photographer_name": "John Doe",185 "photographer_username": "johndoe",186 "photographer_url": "https://unsplash.com/@johndoe?utm_source=...",187 "photo_url": "https://unsplash.com/photos/abc123?utm_source=...",188189 # Ready-to-use attribution190 "attribution_text": "Photo by John Doe on Unsplash",191 "attribution_html": "Photo by <a href=\"...\">John Doe</a> on <a href=\"...\">Unsplash</a>"192}193```194195## Usage Example196197When an LLM builds a content page:1981991. Search for relevant images:200 ```201 photos = search_photos("coffee shop interior", per_page=5)202 ```2032042. Select a photo and use it:205 ```html206 <img src="{photo.urls.regular}" alt="{photo.alt_description}">207 <p class="attribution">{photo.attribution_html}</p>208 ```2092103. If offering download, track it:211 ```212 download_url = track_download(photo.id)213 ```214215## Unsplash API Guidelines216217This server helps you comply with [Unsplash API guidelines](https://unsplash.com/api-terms):2182191. **Attribution** - Always credit the photographer and Unsplash (use `attribution_html`)2202. **Hotlinking** - Use the provided URLs directly (enables view tracking)2213. **Download tracking** - Call `track_download()` when users download images222223## Rate Limits224225- **Demo mode**: 50 requests/hour226- **Production**: 5,000 requests/hour (after approval)227228## License229230MIT License - See [LICENSE](LICENSE) file.231232## Contributing233234Contributions welcome! Please feel free to submit a Pull Request.235236## Support237238If you find this project useful, consider buying me a coffee!239240<a href="https://www.buymeacoffee.com/cevatkerim" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>241242## Acknowledgments243244- [Unsplash](https://unsplash.com) for providing an amazing free photo API245- [FastMCP](https://github.com/jlowin/fastmcp) for the MCP server framework246
Full transparency — inspect the skill content before installing.