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 分