Unsplash MCP Server
Enables searching and downloading photos from Unsplash via the Unsplash API, with support for pagination, orientation filtering, and multiple resolutions.
README
Unsplash MCP Server
This project implements a Model Context Protocol (MCP) server that provides tools for interacting with the Unsplash API, allowing users to search for and download photos.
(Note: Replace
@shariqriazz with the correct username/namespace if needed)
Git Repository: https://github.com/shariqriazz/upsplash-mcp-server (Please update if this is not the correct URL)
Features
- Provides MCP tools to interact with the Unsplash API.
- Search for photos based on queries, pagination, and orientation.
- Download photos at specified resolutions (raw, full, regular, small).
- Requires an Unsplash Access Key configured via environment variables.
- Downloads photos to a local
unsplash/directory within the workspace.
Tools Provided
-
search_photos: Searches for photos on Unsplash.- Input Schema:
{ "type": "object", "properties": { "query": { "type": "string", "description": "The search term(s)." }, "page": { "type": "number", "description": "Page number (default: 1).", "default": 1 }, "per_page": { "type": "number", "description": "Items per page (default: 10, max: 30).", "default": 10, "maximum": 30 }, "orientation": { "type": "string", "enum": ["landscape", "portrait", "squarish"], "description": "Filter by orientation." } }, "required": ["query"] } - Output: Returns JSON data containing search results and a formatted text summary with image links.
- Input Schema:
-
download_photo: Downloads an Unsplash photo to the workspace'sunsplash/folder after triggering the download tracking event.- Input Schema:
{ "type": "object", "properties": { "photo_id": { "type": "string", "description": "The ID of the photo to download." }, "resolution": { "type": "string", "enum": ["raw", "full", "regular", "small"], "description": "Desired resolution (default: raw).", "default": "raw" }, "filename": { "type": "string", "description": "Optional filename (e.g., my-image.jpg). Defaults to sanitized description or {photo_id}.jpg." } }, "required": ["photo_id"] } - Output: Returns a success message with the path to the downloaded file.
- Input Schema:
(Note: Schemas are illustrative. The server exposes the exact schemas via MCP.)
Prerequisites
- Node.js (v18+ recommended)
- Bun (
npm install -g bun) - Unsplash Account and API Access Key (https://unsplash.com/developers)
Setup & Installation
- Clone the Repository:
git clone https://github.com/shariqriazz/upsplash-mcp-server.git # Update URL if needed cd upsplash-mcp-server - Install Dependencies:
bun install - Configure Environment:
- Create a
.envfile in the project root (or copy.env.exampleif provided). - Add your Unsplash Access Key:
UNSPLASH_ACCESS_KEY="YOUR_UNSPLASH_ACCESS_KEY"
- Create a
- Build the Server:
This compiles the TypeScript code tobun run buildbuild/index.js.
Usage (Standalone / NPX)
Standalone (Local Build):
You can run the compiled server directly using bun or node. Ensure the UNSPLASH_ACCESS_KEY environment variable is set in your shell or .env file.
# Ensure UNSPLASH_ACCESS_KEY is set
bun run build/index.js
# OR
node build/index.js
Using NPX (If Published to npm):
If this package is published to npm (e.g., as unsplash-mcp-server), you could run it directly using npx.
# Ensure UNSPLASH_ACCESS_KEY is set in your environment
npx -y unsplash-mcp-server
Note: This requires the package to be published on npm under the specified name.
Running with Cline
-
Configure MCP Settings: Add or update the configuration in your Cline MCP settings file (e.g.,
.roo/mcp.jsonor global settings). You have two primary options:Option A: Using Bun/Node (Direct Path - Recommended for Local Development)
This method uses
bun(ornode) to run the compiled script directly from your local project directory.{ "mcpServers": { "unsplash-mcp-server": { "command": "bun", // Or "node" "args": [ // Use the absolute path to the compiled index.js in your project "/path/to/your/upsplash-mcp-server/build/index.js" ], "env": { // Required: Ensure this matches your .env or is set here "UNSPLASH_ACCESS_KEY": "YOUR_UNSPLASH_ACCESS_KEY" // Replace with your actual key }, "disabled": false, "alwaysAllow": [ "search_photos", "download_photo" // "trigger_download" // Include if this tool exists and is separate ], "timeout": 3600 // Optional: Timeout in seconds (e.g., 1 hour) } // Add other servers here... } }- Important: Replace
/path/to/your/upsplash-mcp-server/build/index.jswith the correct absolute path on your system. - Replace
"YOUR_UNSPLASH_ACCESS_KEY"with your actual key. Remove comments from the actual JSON file.
Option B: Using NPX (Requires Package Published to npm)
This method uses
npxto automatically download and run the server package from the npm registry. This is convenient if you don't want to clone the repository locally or prefer using the published version.{ "mcpServers": { "unsplash-mcp-server": { "command": "npx", "args": [ "-y", // Auto-confirm installation "unsplash-mcp-server" // Assumed npm package name - update if different ], "env": { // Required: Ensure this is set here or in your environment "UNSPLASH_ACCESS_KEY": "YOUR_UNSPLASH_ACCESS_KEY" // Replace with your actual key }, "disabled": false, "alwaysAllow": [ "search_photos", "download_photo" ], "timeout": 3600 // Optional: Timeout in seconds } // Add other servers here... } }- Ensure the
envblock contains the necessaryUNSPLASH_ACCESS_KEY. - Update
"unsplash-mcp-server"inargsif the published npm package name is different.
- Important: Replace
-
Restart/Reload Cline: Cline should detect the configuration change and start the server based on your chosen method.
-
Use Tools: You can now use the
search_photosanddownload_phototools via Cline.
Development
- Watch Mode:
bun run watch(Typically starts the server and restarts on file changes) - Linting:
bun run lint(Checks code for style and potential errors) - Formatting:
bun run format(Formats code according to project standards)
(Note: Assumes standard package.json scripts like watch, lint, format. Update if your scripts differ.)
License
This project is licensed under the MIT License - see the LICENSE file for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。