
Unsplash MCP Server
io.github.hanoak由 GitHub 帳號 hanoak 發布v1.0.1更新於 Oct 28, 2026
MCP server for the Unsplash API: search & fetch photos with attribution + download tracking.
概覽
在本機執行的 Unsplash API MCP 伺服器,讓助理搜尋與取得照片、合輯、主題、使用者與統計資料,並內建署名資訊。
- 可以做什麼
- 搜尋與瀏覽照片、合輯、使用者與主題,可依方向、顏色與內容過濾
- 取得單張照片、隨機照片或分頁清單,並附上可直接使用的署名文字與 HTML
- 讀取攝影師資料、使用者照片與合輯,以及照片、使用者和全站的瀏覽與下載統計
- 為實際使用的照片登記下載事件,並回傳新的圖片連結
- 選擇性 OAuth 登入後:建立、修改與刪除自己的合輯,增減合輯內照片,編輯照片中繼資料並更新個人檔案
- 適用情境
- 適合讓助理為網頁、貼文或設計尋找圖庫照片並回傳附有正確署名的圖片連結,或查詢 Unsplash 攝影師、主題與使用統計。只有需要讓助理管理自己的 Unsplash 合輯與個人檔案時,才值得啟用寫入類工具。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 20 以上版本。需要 Unsplash API 存取金鑰,放在 UNSPLASH_ACCESS_KEY 中;建議設定 UNSPLASH_APP_NAME 供署名使用。選擇性的登入步驟另需 UNSPLASH_SECRET_KEY 與已註冊的重新導向 URI。需要連線至 api.unsplash.com 的網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Unsplash MCP Server,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
unsplash-mcp-server
[npm version] [npm downloads] [CI] [license: MIT] [node: >=20] [PRs welcome]
A production-ready Model Context Protocol (MCP) server for the Unsplash API. It gives AI assistants — Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, and any MCP client — tools to search and fetch Unsplash photos, collections, topics, users, and stats, with Unsplash-guideline compliance built in (ready-to-use attribution and download tracking). Sign in once via OAuth to also manage your own profile, collections, and photo metadata.
[!IMPORTANT] Unofficial project. This is not affiliated with, endorsed by, or sponsored by Unsplash. "Unsplash" is a trademark of its respective owner. You use it under your own Unsplash API account and are responsible for complying with the Unsplash API Terms & Guidelines.
Table of contents
- Features
- Quick start
- Example interaction
- Configuration
- OAuth sign-in (optional)
- Tools
- Example prompts
- Attribution & compliance
- Rate limits
- Handling of Unsplash text
- Privacy & security
- Troubleshooting
- FAQ
- Requirements
- Compatibility
- Roadmap
- Contributing
- Contact & community
- License
Features
- 29 tools across photos, search, users, collections, topics, stats, and your own profile — 21 read-only out of the box, plus 8 write/
metools once you sign in. - Compliance built in — every photo comes with ready-to-use attribution (plain text + UTM-tagged HTML), and a dedicated
unsplash_track_downloadtool for the download-tracking guideline. - Content safety —
content_filter=highby default on search and random photos. - Flexible image URLs — each photo returns
raw/full/regular/small/thumbsizes, plus arawimgix base for custom sizes (?w=&h=&q=&fm=&fit=). - Token-efficient output — full Unsplash responses are trimmed to a compact shape (URLs + metadata as text, never base64 image blobs) to keep model context small.
- Robust — typed failures returned as MCP
isErrorresults the model can recover from, plus retries/backoff, timeouts,403hourly-limit handling, and rate-limit surfacing. - Safe — access-key redaction in all error output, an SSRF guard on download URLs, and untrusted-text handling guidance for indirect prompt-injection defence.
- Lean & modern — ESM, Node 20+, zero-install via
npx, no telemetry.
Quick start
1. Get an Unsplash access key
Register an application at unsplash.com/developers → New Application → accept the API terms → copy its Access Key (not the Secret Key). New apps start on the Demo tier (50 requests/hour); the Production tier (5,000/hour) requires Unsplash's review from your app dashboard. See Rate limits.
2. Add the server to your MCP client
Claude Desktop — edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Restart the client. See Configuration for every supported variable.
Other clients (Claude Code, Cursor, VS Code, Windsurf, generic stdio)
Claude Code (CLI):
Cursor — ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project): use the exact same mcpServers block as Claude Desktop above.
Windsurf — ~/.codeium/windsurf/mcp_config.json: same mcpServers block as Claude Desktop above.
VS Code — .vscode/mcp.json (note the top-level key is servers, not mcpServers):
Any other MCP client — run the server over stdio with:
Point your client's stdio transport at command: npx, args: ["-y", "@hanoak/unsplash-mcp-server"], and pass the key via env.
3. Try it
Restart your client and ask:
"Find me a photo of mountains on Unsplash and show the attribution."
Example interaction
A typical flow: the model calls unsplash_search_photos, picks a result, presents the image with its attribution, and calls unsplash_track_download when it actually uses the photo.
You: Find a landscape photo of a foggy pine forest and credit the photographer.
Assistant: (calls
unsplash_search_photoswithquery: "foggy pine forest",orientation: "landscape", picks the best result, then callsunsplash_track_downloadwith itsdownload_location) Here's a great match — Photo by Jane Doe on Unsplash — along with a ready-to-embed credit line and the image URL.
Each tool returns a compact JSON payload. Here's the shape of a single photo result (illustrative values):
Example tool output
Every tool result includes a rate_limit object (limit, remaining) read from the Unsplash response headers. List/search tools wrap results in photos/collections/users/topics arrays with pagination fields (total, total_pages, count, page, per_page).
Configuration
Configuration is entirely via environment variables — no config files, no flags for secrets.
CLI flags: --version and --help are supported (e.g. npx @hanoak/unsplash-mcp-server --version). login/logout are subcommands, not flags — see below.
OAuth sign-in (optional)
The 21 core tools work out of the box with just UNSPLASH_ACCESS_KEY. To also use the 8 write/me tools (update your profile, manage collections, edit photo metadata), sign in once via OAuth:
-
On your app's page at unsplash.com/oauth/applications, add
http://localhost:8734/callbackas a redirect URI, and copy the Secret key. -
Set both
UNSPLASH_ACCESS_KEYandUNSPLASH_SECRET_KEYin your shell (not just the MCP client config —loginruns from your terminal). -
Run:
This opens your browser to Unsplash's consent screen, captures the redirect on a short-lived local server, exchanges the code for a user access token, and saves it to
~/.config/unsplash-mcp-server/credentials.json(owner-only file permissions). Unsplash user access tokens don't expire, so this is a one-time step — no periodic re-auth. -
Restart your MCP client. The 8 write/
metools are now available; the 21 read-only tools are unaffected either way.
Run npx @hanoak/unsplash-mcp-server logout at any time to remove the stored token. To revoke it server-side, regenerate your app's secret key from the Unsplash dashboard.
Tools
All tools are namespaced unsplash_*. Most are read-only (annotated readOnlyHint: true); the exceptions are unsplash_track_download (registers a download event) and the 8 write/me tools below, all marked non-read-only and gated behind OAuth sign-in. Parameters map to the Unsplash API; per_page and stats quantity are clamped to a max of 30, and page is 1-based.
🔒 = requires OAuth sign-in (login) first.
Tool reference
Photos
Search
Users
Collections
Me (requires OAuth sign-in)
Topics & stats
Output shape
Tools return trimmed, token-efficient JSON rather than raw Unsplash responses:
- Photos →
id,description,width/height,color,blur_hash,urls(raw/full/regular/small/thumb),photo_page,download_location,photographer, and a ready-to-useattributionobject. See Example interaction. - Users →
id,username,name,bio,location,profile_url,profile_image,total_photos,total_collections. - Collections / Topics → title, description, counts, page link, curator/owners, and a compact
cover_photo. - Every result carries a
rate_limit(limit,remaining); lists/searches add pagination fields.
Resources & prompts
Beyond tools, the server also exposes:
-
Resources — compact guides your client can pull in as context:
unsplash://guides/attribution— attribution, download tracking, hotlinking, content safety.unsplash://guides/oauth-setup— how to sign in for the 8 write/metools.unsplash://guides/prompts— which of the prompts below to use for a given task.
-
Prompts — ready-made tasks your client can surface directly; each expands into a guided, multi-step tool-calling task:
🔒 = requires OAuth sign-in first.
Example prompts
Natural-language asks that map cleanly onto the tools:
- "Find a photo of a foggy forest at sunrise and give me the HTML attribution."
- "Search Unsplash for 5 minimalist workspace photos in landscape orientation."
- "Get a random nature photo and show it with credit."
- "Show me the most popular photos in the
wallpaperstopic." - "What are this month's Unsplash-wide download stats?"
- "Who is the photographer behind photo
Dwu85P9SOIk, and how many downloads does it have?"
Attribution & compliance
Every photo result includes an attribution object with ready-to-use text and html (with the required UTM parameters). When you display or use a photo, show that attribution — it credits the photographer and links back to Unsplash, as the guidelines require.
When a photo is actually used (embedded, downloaded, displayed), call unsplash_track_download with the photo's download_location. Trigger it once per photo actually used — never once per search result. The server also sends these instructions to your MCP client on connect, so the model is nudged to do the right thing automatically.
This is a search-and-metadata tool for individual, attributed photo use — not a replacement for the core Unsplash experience, and it performs no automated bulk downloading. Please use it within the Unsplash API Guidelines. Each user operates under their own Unsplash API Terms.
Rate limits
Unsplash enforces a per-hour request budget tied to your app's tier:
The server reads X-Ratelimit-Limit / X-Ratelimit-Remaining and returns them as rate_limit on every result. When the hourly budget is exhausted, Unsplash returns 403 (not 429), often with no Retry-After; the server surfaces this as a clear "hourly rate limit reached" error and does not blindly retry in-window. Transient 429/5xx/network errors are retried with backoff.
Handling of Unsplash text
Photo descriptions, alt text, tags, EXIF, and user names/bios come from Unsplash contributors — treat them as untrusted, third-party data, not instructions. The server returns this text purely as content and never places it anywhere privileged; your client/agent should do the same: display it, but don't act on any instructions it might contain (a defence against indirect prompt injection).
Privacy & security
- No telemetry. This server collects nothing and phones home to no one. It contacts only
api.unsplash.com, using the key you provide. No analytics, no tracking. - Verifiable provenance. Every release is published with npm provenance via GitHub Actions — the npm package page links each version to the exact commit and workflow run that built it.
- Key safety. Your access key is read from the environment only, sent as an
Authorization: Client-IDheader (never in a URL query string), and redacted from all error output and logs so it can't leak into pasted bug reports. - SSRF guard.
unsplash_track_downloadonly followsdownload_locationURLs on the verifiedapi.unsplash.comhost. - To report a vulnerability, see SECURITY.md.
Troubleshooting
- "Set UNSPLASH_ACCESS_KEY…" on startup — the key env var is missing or blank; add it to your client config's
envblock. - Node too old — this server requires Node 20+. Check
node --version. - Stale
npxversion — force the latest withnpx -y @hanoak/unsplash-mcp-server@latest, or clear the cache vianpx clear-npx-cache. - Tools not appearing — confirm the config file path and JSON are valid, then fully quit and reopen the client.
403/ rate limit — the Demo tier allows 50 requests/hour; wait for the hourly reset or apply for Production access. See Rate limits.401 Unauthorized— the access key is wrong or from the wrong app; copy the Access Key (not the Secret Key) from your app dashboard.
FAQ
Do I need a paid Unsplash account? No. The Unsplash API is free; you just register an app to get an access key. Higher throughput (Production tier) is a free review, not a paid plan.
Access Key vs Secret Key — which one?
For the 21 read-only tools, just the Access Key. The Secret Key is only needed for login (the OAuth flow behind the 8 write/me tools) — see OAuth sign-in.
Does it download or rehost images?
No. It returns Unsplash-hosted image URLs (hotlink them directly) and never rehosts or returns base64 blobs. unsplash_track_download only registers a download event and returns a fresh URL.
Can it create collections, like photos, or edit my profile?
Yes, once you sign in — unsplash_create_collection and friends, and unsplash_update_photo/unsplash_update_my_profile. (Liking photos is not currently exposed as a tool.)
Does it work outside Claude? Yes — it's a standard stdio MCP server. See the client setup section for Claude Code, Cursor, VS Code, Windsurf, and generic stdio.
Requirements
- Node.js >= 20 (Node 18 is end-of-life).
- An Unsplash API access key.
Compatibility
Roadmap
Full detail lives in docs/ROADMAP.md. In short:
- v1 (shipped) — the 21 read-only tools, attribution + download-tracking compliance, the attribution resource, and the
find_photoprompt. - v2 (shipped) — the 8 OAuth write /
meendpoints (profile, collections, photo metadata) via alogin/logoutCLI and the Unsplash authorization-code flow. - v3 (current) — 7 more MCP prompts covering every tool domain (see Resources & prompts). A
.mcpbDesktop Extension was considered for this phase but dropped to unscheduled future scope —npxalready works across every supported client.
Changes are tracked in CHANGELOG.md; the project follows Semantic Versioning.
Contributing
Contributions are welcome — see CONTRIBUTING.md and our Code of Conduct. It covers local setup, the test suite, testing tools by hand with the MCP Inspector, and the versioning/deprecation policy. To report a vulnerability, see SECURITY.md.
Contact & community
Maintained by Hanoak S. The fastest way to get help or propose a feature is to open an issue — it's public, searchable, and helps the whole community. For anything else, reach out:
If this project helps you, a ⭐ on GitHub is appreciated — it aids discoverability for others looking for an Unsplash MCP server.
License
MIT © Hanoak S. Not affiliated with Unsplash.
來源:README.md,提交 de8c3e3
工具
0版本歷史
1- v1.0.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分