Image Resolver

io.github.ahmaddioxide由 GitHub 帳號 ahmaddioxide 發布v0.2.0更新於 Oct 24, 2026

MCP server for context-aware royalty-free image search from Pexels and Unsplash

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理從 Pexels 和 Unsplash 搜尋免權利金圖片,並回傳附署名資訊的結構化結果。

可以做什麼
依自然語言查詢搜尋免權利金圖片,支援數量、頁碼與方向參數,並把 Pexels 與 Unsplash 的結果合併成含連結、尺寸、攝影師與標籤的結構化清單。把自由文字轉換成精簡的圖片搜尋詞。為查詢回傳單張最佳圖片,或平行執行多個搜尋。為指定攝影師與來源產生符合平台要求的署名文字。
適用情境
適合讓助理為部落格首圖、應用程式主視覺、樣機或設計草稿尋找圖庫或免權利金照片,並直接取得可用的署名文字。若你已有或願意申請免費的 Pexels 或 Unsplash API 金鑰,最為合適。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 18 或更新版本。至少需要一組 API 金鑰:PEXELS_API_KEY 或 UNSPLASH_ACCESS_KEY,以環境變數提供。需要能連線到 Pexels 與 Unsplash 的 API。
安裝前請注意
需要在 MCP 用戶端設定中保存第三方 API 金鑰,避免放入共用檔案。搜尋詞會傳送給 Pexels 與 Unsplash。操作本身為唯讀,但圖片使用須遵守兩家平台條款,包括明顯連結與攝影師署名,可用署名工具產生。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Image Resolver,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MCP Image Resolver Server

An MCP (Model Context Protocol) server that provides royalty-free image search for AI hosts like Cursor, Claude Desktop, VS Code, Windsurf, and more. Ask your AI assistant to find images by natural language—it uses the search_images tool and returns structured results from Pexels and Unsplash.

Features

  • search_images — Search for royalty-free images (supports limit, page, orientation)
  • extract_image_query — Transform free-form text into an image search query
  • get_best_image — Return a single best image for a query
  • search_images_batch — Run multiple searches in parallel
  • resolve_image_attribution — Generate provider-compliant attribution text
  • Pexels & Unsplash — Multi-provider support (free tier for both)
  • Unified response — Structured results with url, source, dimensions, photographer, tags
  • Works everywhere — Any MCP client that supports stdio servers

Requirements

Quick Start (No Installation Required)

No cloning or building needed. Just add this config to your MCP client and it runs via npx automatically:

json
{  "mcpServers": {    "image-resolver": {      "command": "npx",      "args": ["-y", "@ahmaddioxide/mcp-image-resolver"],      "env": {        "PEXELS_API_KEY": "your-pexels-api-key",        "UNSPLASH_ACCESS_KEY": "your-unsplash-access-key"      }    }  }}

At least one API key is required. Both are free — get them here:

Architecture (High-Level)

┌─────────────────────────────────────────────────────────────────────────────┐│                           MCP Client (Cursor, Claude, VS Code, etc.)        ││                                     │                                       ││                            stdio (stdin/stdout)                             │└─────────────────────────────────────┼───────────────────────────────────────┘                                      │                                      ▼┌─────────────────────────────────────────────────────────────────────────────┐│                         MCP Image Resolver Server                           ││  ┌─────────────────────────────────────────────────────────────────────┐   ││  │  index.ts          MCP server entry, registers tools, stdio transport│   ││  └─────────────────────────────────────────────────────────────────────┘   ││                                      │                                      ││                                      ▼                                      ││  ┌─────────────────────────────────────────────────────────────────────┐   ││  │  tools/search-images.ts   Tool handler: search_images(query)         │   ││  └─────────────────────────────────────────────────────────────────────┘   ││                                      │                                      ││                                      ▼                                      ││  ┌──────────────────────┐  ┌──────────────────────┐                        ││  │  providers/pexels.ts  │  │ providers/unsplash.ts │                        ││  │  Pexels API adapter   │  │ Unsplash API adapter  │──▶ ImageResult schema  ││  └──────────────────────┘  └──────────────────────┘                        ││               │                        │                                    ││               └────────────────────────┴────▶ utils/normalize.ts            │└─────────────────────────────────────┼───────────────────────────────────────┘                                      │                    ┌─────────────────┴─────────────────┐                    ▼                                   ▼┌──────────────────────────────┐    ┌──────────────────────────────────────────┐│  Pexels API                  │    │  Unsplash API                             ││  api.pexels.com              │    │  api.unsplash.com                         │└──────────────────────────────┘    └──────────────────────────────────────────┘

Flow: MCP client → stdio → index.ts (registers tools) → search-images.ts → Pexels and Unsplash providers (when keys are set). Results are merged (Pexels first, then Unsplash) and normalized to the unified ImageResult schema.

Client Setup

Cursor

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

json
{  "mcpServers": {    "image-resolver": {      "command": "npx",      "args": ["-y", "@ahmaddioxide/mcp-image-resolver"],      "env": {        "PEXELS_API_KEY": "your-pexels-api-key",        "UNSPLASH_ACCESS_KEY": "your-unsplash-access-key"      }    }  }}

Restart Cursor after config changes.

Claude Desktop

Add to your Claude config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Via Settings: Developer → Edit Config

json
{  "mcpServers": {    "image-resolver": {      "command": "npx",      "args": ["-y", "@ahmaddioxide/mcp-image-resolver"],      "env": {        "PEXELS_API_KEY": "your-pexels-api-key",        "UNSPLASH_ACCESS_KEY": "your-unsplash-access-key"      }    }  }}

Restart Claude Desktop completely after saving.

VS Code

Add to .vscode/mcp.json (workspace) or your user profile mcp.json:

json
{  "servers": {    "image-resolver": {      "type": "stdio",      "command": "npx",      "args": ["-y", "@ahmaddioxide/mcp-image-resolver"],      "env": {        "PEXELS_API_KEY": "your-pexels-api-key",        "UNSPLASH_ACCESS_KEY": "your-unsplash-access-key"      }    }  }}

Note: VS Code uses servers (not mcpServers) and requires "type": "stdio".

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

json
{  "mcpServers": {    "image-resolver": {      "command": "npx",      "args": ["-y", "@ahmaddioxide/mcp-image-resolver"],      "env": {        "PEXELS_API_KEY": "your-pexels-api-key",        "UNSPLASH_ACCESS_KEY": "your-unsplash-access-key"      }    }  }}

Refresh the MCP config after changes.

Other MCP Clients

Any client that supports stdio MCP servers (Amp, Continue.dev, Amazon Q, etc.) can use this server:

  • Command: npx
  • Args: ["-y", "@ahmaddioxide/mcp-image-resolver"]
  • Env: { "PEXELS_API_KEY": "your-key", "UNSPLASH_ACCESS_KEY": "your-key" } (at least one required)

Usage

Once configured, ask your AI assistant to find images in natural language. It will call the search_images tool automatically.

Example prompts:

  • "Find royalty-free images of a sunset mosque"
  • "Search for zen yoga images suitable for a wellness app"
  • "Get some minimalist office workspace photos"
  • "Find images for a cooking blog header"

The tool returns image URLs and metadata. Use the links to view or download images.

Tool Schema

ToolParamsDescription
search_imagesquery, limit?, page?, orientation?Search images from Pexels and Unsplash
extract_image_querycontextExtract search terms from free-form text
get_best_imagequery, orientation?Return a single best image
search_images_batchqueries, limit?Run multiple searches in parallel
resolve_image_attributionphotographer, source, url?Generate attribution text

Response: JSON with results array of { url, source, width, height, photographer, tags }. Each result includes source ("Pexels" or "Unsplash") for attribution.

Note: When both providers are configured, results are merged with Pexels first, then Unsplash. Use limit: 20 or higher to see results from both providers in a single search.

Testing

Example prompts to verify the tools:

  • "Search for mountain landscape with limit 20 and show me which results came from Pexels vs Unsplash."
  • "Use extract_image_query on: I need a hero image for a meditation app with mountains."
  • "Use search_images_batch for 'sunset mosque', 'pakistani flag', and 'zen yoga'."
  • "Get a single best image for coffee shop and generate attribution for it."

Development

To contribute or run locally, clone the repo and build from source:

bash
git clone https://github.com/ahmaddioxide/image-resolver-mcp.gitcd image-resolver-mcpnpm installcp .env.example .env# Add PEXELS_API_KEY and/or UNSPLASH_ACCESS_KEY to .envnpm run build

Or run in development mode without building, using tsx:

json
{  "mcpServers": {    "image-resolver": {      "command": "npx",      "args": ["tsx", "/path/to/image-resolver-mcp/src/index.ts"],      "env": {        "PEXELS_API_KEY": "your-pexels-api-key",        "UNSPLASH_ACCESS_KEY": "your-unsplash-access-key"      }    }  }}

Attribution

Images are sourced from Pexels and Unsplash. Per their API terms:

  • Provide prominent links to Pexels and Unsplash
  • Credit photographers: "Photo by [Name] on Pexels" / "Photo by [Name] on Unsplash"
  • Response metadata includes photographer and source; use resolve_image_attribution for compliant text

Contributing

Contributions are welcome. Please read CONTRIBUTING.md for guidelines and CODE_OF_CONDUCT.md for community standards. See SECURITY.md for vulnerability reporting.

License

MIT — see LICENSE.

來源:README.md,提交 e3ddd9f

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分