πΌοΈ Unsplash Smart MCP Server
AI-powered FastMCP server for intelligent stock photo search, download, and attribution management from Unsplash
drumnation
README
πΌοΈ Unsplash Smart MCP Server
Empower your AI agents with stunning visuals, zero hassle.
A powerful FastMCP server that enables AI agents to seamlessly search, recommend, and deliver professional stock photos from Unsplash with intelligent context awareness and automated attribution management.
π Why Choose This Unsplash Integration
In the landscape of visual content integration, our Unsplash Smart MCP Server stands out as the definitive solution for AI-powered image acquisition:
- π§ AI-Agent Optimized: Purpose-built for AI agents like Claude in Cursor, streamlining image requests with natural language
- π Context-Aware Image Selection: Interprets vague requests intelligently, delivering relevant images even from abstract prompts
- β‘ Single Tool Efficiency: Eliminates tool spam with a unified
stock_photo
tool that handles the entire image workflow - π Resource Optimization: URL-first approach conserves bandwidth and storage while maintaining flexibility
- β Automatic Attribution: Built-in compliance with Unsplash's Terms of Service with zero developer effort
- π Project-Aware Organization: Intelligently organizes images based on your project structure (Next.js, React, Vue, etc.)
- π§© Seamless Integration: Designed for minimal setup and maximum compatibility with your existing workflow
β¨ Features Beyond Comparison
For AI Agent Developers
- Smart Contextual Search: Find the perfect image through natural language requests
- Automatic Subject Selection: AI determines optimal image subjects from your purpose description
- Intent-Driven Results: Get images that match not just keywords, but the underlying intent
- Seamless Agent Integration: Works out-of-the-box with Claude in Cursor and other MCP-compatible agents
For Project Efficiency
- Two-Step Workflow: Get URLs for controlled downloads, avoiding permission issues and unnecessary storage
- Project-Aware File Management: Auto-organizes images based on framework conventions
- Intelligent Directory Creation: Creates appropriate folder structures based on your project type
- Progressive Enhancement: Works with any project size, from quick prototypes to enterprise applications
For Compliance Peace of Mind
- Complete Attribution Management:
- Local attribution database tracks all image usage
- Automatic embedding of photographer metadata in images (EXIF, IPTC, XMP)
- One-click generation of attribution pages in multiple formats
- Comprehensive API for attribution data
π οΈ Installation
Prerequisites
- Node.js 18.x or higher
- An Unsplash API access key (get one here)
Via Cursor (Recommended)
- Install the MCP server in Cursor:
claude mcp add unsplash https://github.com/drumnation/unsplash-smart-mcp-server.git
- Set up your Unsplash API key:
claude mcp config set unsplash UNSPLASH_ACCESS_KEY=your_api_key_here
Manual Configuration in Cursor
If the claude mcp add
command doesn't work for you, you can manually configure the MCP server in your Cursor settings:
-
Locate your Cursor MCP configuration file:
- macOS:
~/.cursor/mcp.json
- Windows:
%USERPROFILE%\.cursor\mcp.json
- Linux:
~/.cursor/mcp.json
- macOS:
-
Add the Unsplash MCP server configuration to the
servers
object in the file:
{
"servers": {
"unsplash": {
"command": "tsx",
"args": ["/path/to/unsplash-smart-mcp-server/src/server.ts"],
"env": {
"UNSPLASH_ACCESS_KEY": "your_api_key_here"
}
}
}
}
Replace /path/to/unsplash-smart-mcp-server
with the actual path where you cloned the repository, and your_api_key_here
with your actual Unsplash API key.
-
Save the file and restart Cursor for the changes to take effect.
-
Verify the integration by asking Claude in Cursor:
Find me an image of a mountain landscape
Claude should respond by using the Unsplash MCP server to search for and suggest mountain landscape images.
Via Smithery (Cloud Deployment)
You can also deploy this MCP server via Smithery for cloud-based access:
- Visit Smithery.ai and sign in
- Click "Add Server" and select "Import from GitHub"
- Enter the repository URL:
https://github.com/drumnation/unsplash-smart-mcp-server.git
- Fill out the form with:
- ID:
@drumnation/unsplash-smart-mcp-server
- Base Directory:
.
(just a period) - Local Only: Unchecked (not required)
- ID:
- Click "Create" to deploy the server
- Configure your Unsplash API key in the Smithery interface
Via Docker
You can also run the server using Docker:
- Clone the repository:
git clone https://github.com/drumnation/unsplash-smart-mcp-server.git
cd unsplash-smart-mcp-server
- Build the Docker image:
docker build -t unsplash-mcp-server .
- Run the container with your Unsplash API key:
docker run -i --rm -e UNSPLASH_ACCESS_KEY=your_api_key_here unsplash-mcp-server
- To use with Cursor or another MCP client, add the following to your MCP configuration:
{
"servers": {
"unsplash": {
"command": "docker",
"args": ["run", "-i", "--rm", "-e", "UNSPLASH_ACCESS_KEY=your_api_key_here", "unsplash-mcp-server"]
}
}
}
Manual Installation
- Clone the repository:
git clone https://github.com/drumnation/unsplash-smart-mcp-server.git
cd unsplash-smart-mcp-server
- Install dependencies:
npm install
- Create a
.env
file with your Unsplash API key:
UNSPLASH_ACCESS_KEY=your_api_key_here
- Build and start the server:
npm run build
npm start
π§© Integration with AI Agents
Step-by-Step Guide for Claude in Cursor
Our Unsplash Smart MCP Server is designed to make image acquisition through AI agents effortless and intuitive:
- Initiate a request: Simply ask Claude for an image in natural language
- AI interpretation: Claude understands your needs and calls the
stock_photo
tool with optimized parameters - Smart image selection: The server interprets context and finds the most relevant images
- Presentation of options: Claude presents you with the best matches and download commands
- Seamless download: Execute the suggested commands to place images exactly where you need them
- Automatic attribution: All attribution data is stored and can be accessed whenever needed
This process eliminates the traditional workflow of:
Searching Unsplash manuallyScrolling through hundreds of resultsDownloading images to random locationsMoving files to the correct project foldersManually tracking attribution dataCreating attribution pages
Example Prompts for AI Agents
Ask Claude in Cursor for images using natural language prompts like these:
"Find a professional image for a tech startup landing page hero section"
"I need a photo that represents innovation and creativity for my presentation"
"Get me a picture of a diverse team collaborating in a modern office environment"
"Find an abstract background that represents data and analytics"
"I need a photo of someone coding or debugging software for a blog post"
"Find an image that conveys artificial intelligence ethics for my research paper"
"Get a minimalist product photo with a white background for an e-commerce site"
"Find a landscape photo that evokes a sense of possibility and exploration"
"I need a photo showing user experience design for my UX portfolio"
"Find an image representing sustainable technology for an environmental tech article"
URL-First Approach: The Smart Choice
Our architecture uses a URL-first approach rather than direct image embedding for several critical reasons:
- Storage Efficiency: Prevents AI agents from unnecessarily storing large binary data in their context
- Bandwidth Conservation: Reduces data transfer between services, improving response times
- Placement Flexibility: Allows developers to download images exactly where they're needed
- Permission Management: Avoids filesystem permission issues in restricted environments
- Workflow Integration: Seamlessly integrates with existing development pipelines
This strategy enables AI agents to intelligently suggest the optimal download location based on project context, without being constrained by their own environment limitations.
Minimizing Tool Spam and API Calls
Unlike other solutions that require multiple tool calls for searching, filtering, downloading, and attributing images, our server:
- Unifies the entire image workflow into a single
stock_photo
tool - Optimizes result retrieval by requesting more images upfront to enable better filtering
- Eliminates ping-pong interactions between the agent and services
- Reduces agent token usage by streamlining request and response formats
This design significantly reduces the number of API calls and tool invocations, leading to faster results and lower operational costs.
π Automatic Attribution and Compliance
Unsplash Terms of Service: Effortless Compliance
Using images from Unsplash requires adherence to their Terms of Service. Our server handles this automatically:
- Attribution Data Capture: Every image download automatically stores photographer information
- Metadata Embedding: Photographer details are embedded directly into image files
- Attribution Database: A local database maintains a record of all image usage
- Attribution Generators: Built-in tools create HTML and React attribution components
- API Access: Simple endpoints to retrieve attribution data for any project
By using our Unsplash Smart MCP Server, you are automatically compliant with Unsplash's requirements without any additional effort.
Attribution Management System
The server includes a comprehensive attribution management system:
// Retrieve attribution data for your project
const attributions = await fetch('http://localhost:3000/api/unsplash', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
method: 'get_attributions',
params: {
format: 'json', // Options: json, html, react
projectPath: '/path/to/your/project'
}
})
}).then(res => res.json());
// attributions contains complete data about every image used
The API can generate three types of attribution files:
- JSON: Structured data for custom implementations
- HTML: Ready-to-use HTML page for website footer or credits section
- React: Drop-in React component for modern web applications
πΌ Developer Workflow Integration
Real-World Use Cases
Our Unsplash Smart MCP Server seamlessly integrates into your development workflow:
UI Development
- Instantly populate mockups with relevant placeholder images
- Maintain consistent image dimensions across components
- Organize images logically within your project structure
Documentation
- Enhance technical documentation with explanatory visuals
- Create visually appealing tutorials and guides
- Maintain proper attribution for all visual assets
Content Creation
- Quickly find images for blog posts and articles
- Generate visuals for social media content
- Access consistent imagery for product marketing
Application Development
- Populate e-commerce sites with product imagery
- Create visually rich user experiences
- Maintain separate image collections for different sections
Framework-Specific Organization
Images are automatically organized based on your project type:
Framework | Default Image Path | Alternate Paths |
---|---|---|
Next.js | /public/images/ |
/public/assets/images/ |
React | /src/assets/images/ |
/assets/images/ |
Vue | /src/assets/images/ |
/public/images/ |
Angular | /src/assets/images/ |
/assets/images/ |
Generic | /assets/images/ |
~/Downloads/stock-photos/ |
π₯ Competitive Differentiation
Why Choose Our Unsplash Integration?
Feature | Unsplash Smart MCP Server | Alternatives |
---|---|---|
AI Agent Integration | β Purpose-built for AI agent workflow | β Typically requires manual parameter setting |
Context Awareness | β Interprets vague requests intelligently | β Relies on exact keyword matching |
Tool Efficiency | β Single tool handles entire workflow | β Often requires multiple separate tools |
Attribution Management | β Comprehensive system with multiple formats | β Manual tracking or basic text output |
Project Organization | β Framework-aware folder structures | β Generic downloads to a single location |
Installation Complexity | β Simple one-line command | β Often requires multiple configuration steps |
Response Format | β AI-optimized with relevant context | β Generic JSON requiring further processing |
Download Flexibility | β URL-first with intelligent suggestions | β Either direct downloads or just URLs |
βοΈ Configuration
Environment Variables
Variable | Description | Default |
---|---|---|
UNSPLASH_ACCESS_KEY |
Your Unsplash API access key | - |
PORT |
Port for the server to listen on | 3000 |
HOST |
Host for the server | localhost |
ATTRIBUTION_DB_PATH |
Path to store attribution database | ~/.unsplash-mcp |
Tool Parameters
stock_photo
Parameter | Type | Description | Default |
---|---|---|---|
query |
string | What to search for (AI will choose if not specified) | - |
purpose |
string | Where the image will be used (e.g., hero, background) | - |
count |
number | Number of images to return | 1 |
orientation |
string | Preferred orientation (any, landscape, portrait, square) | any |
width |
number | Target width in pixels | - |
height |
number | Target height in pixels | - |
minWidth |
number | Minimum width for filtering results | - |
minHeight |
number | Minimum height for filtering results | - |
outputDir |
string | Directory to save photos | ~/Downloads/stock-photos |
projectType |
string | Project type for folder structure (next, react, vue, angular) | - |
category |
string | Category for organizing images (e.g., heroes, backgrounds) | - |
downloadMode |
string | Whether to download images or return URLs | urls_only |
get_attributions
Parameter | Type | Description | Default |
---|---|---|---|
format |
string | Output format (json, html, react) | json |
projectPath |
string | Filter attributions to a specific project path | - |
outputPath |
string | Where to save attribution files | - |
π§ Troubleshooting
Common Issues and Solutions
Issue | Solution |
---|---|
Connection Refused | Ensure the server is running on the configured port |
Authentication Error | Verify your Unsplash API key is correctly set |
No Images Found | Try broader search terms or check your search query |
Download Permission Issues | Use downloadMode: 'urls_only' and manual download commands |
Timeout Errors | The default MCP timeout is 60 seconds, which may be insufficient for downloading larger images or processing multiple images. For image-heavy operations: 1) Process fewer images per request, 2) Use smaller image dimensions, 3) Consider using urls_only mode instead of auto-download, 4) Check network connectivity |
Attribution Not Found | Verify the image was downloaded through the MCP server |
Unhandled MCP Errors | If you see "McpError: MCP error -32001: Request timed out" errors, your request is likely taking too long. Break it into smaller operations or use the URLs-only approach |
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Workflow
- Clone the repository
- Install dependencies with
npm install
- Create a
.env
file with your Unsplash API key - Run in development mode with
npm run dev
- Run tests with
npm test
πΊοΈ Roadmap
Here's what we're planning for future releases:
- Image Editing Capabilities: Basic resizing, cropping, and adjustment tools
- Advanced Search Filters: More granular control over image selection
- Batch Processing: Handle multiple image requests efficiently
- Custom Collections: Save and manage groups of images for projects
- Team Collaboration: Share attribution and image collections
- Usage Analytics: Track image usage across projects
- Additional Image Sources: Integration with other stock photo providers
- Improved Timeout Handling: Enhanced timeout configuration and recovery mechanisms
π License
MIT License
π Attribution Requirements
When using images from Unsplash, you must comply with the Unsplash License:
- Attribution is not required but appreciated
- You cannot sell unaltered copies of the photos
- You cannot compile photos from Unsplash to create a competing service
Our server's attribution system makes it easy to provide proper credit to photographers.
π Contact
For issues or questions, please open an issue on GitHub.
<p align="center"> <strong>Empower your AI agents with the perfect images, every time.</strong><br> Built with β€οΈ for developers and AI enthusiasts. </p>
Recommended Servers
Crypto Price & Market Analysis MCP Server
A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.
MCP PubMed Search
Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.
dbt Semantic Layer MCP Server
A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.
mixpanel
Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Sequential Thinking MCP Server
This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Nefino MCP Server
Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.
Vectorize
Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.
Mathematica Documentation MCP server
A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.
kb-mcp-server
An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded
Research MCP Server
The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.