Unsplash MCP Server

Unsplash MCP Server

site icon
2025.04.17 112
Python图片服务API集成内容生成
Unsplash MCP Server 是一个用于无缝集成 Unsplash 图片和搜索功能的简单 MCP 服务器。它适合希望将 Unsplash 功能集成到自己应用程序中的开发者使用。
View on GitHub

Overview

基本能力

产品定位

Unsplash MCP Server 主要用于搜索丰富、高质量的图片,为开发者提供 Unsplash 功能的集成解决方案。

核心功能

  • 高级图片搜索:可以搜索 Unsplash 的广泛照片库,支持以下过滤器:
  • 关键词相关性
  • 配色方案
  • 方向选项
  • 自定义排序和分页

适用场景

  • 开发者需要在应用程序中集成高质量图片搜索功能
  • 需要根据特定条件(如颜色、方向等)筛选图片的应用场景

工具列表

  • Search Photos:用于搜索 Unsplash 图片的工具,支持关键词、每页数量和方向等参数。

常见问题解答

  1. 如何获取 Unsplash Access Key?
  2. 创建开发者账户 Unsplash
  3. 注册新应用
  4. 从应用详情页面获取 Access Key
  5. 在配置步骤中使用此密钥

使用教程

使用依赖

需要先获取 Unsplash API Access Key(如上所述)。

安装教程

自动安装(通过 Smithery)

# Cursor IDE
npx -y @smithery/cli@latest install @hellokaton/unsplash-mcp-server --client cursor --key 7558c683-****-****

# Windsurf
npx -y @smithery/cli@latest install @hellokaton/unsplash-mcp-server --client windsurf --key 7558c683-****-****

# Cline
npx -y @smithery/cli@latest install @hellokaton/unsplash-mcp-server --client cline --key 7558c683-****-****

手动安装

# 克隆仓库
git clone https://github.com/hellokaton/unsplash-mcp-server.git

# 进入项目目录
cd unsplash-mcp-server

# 创建虚拟环境
uv venv

# 安装依赖
uv pip install .

调试方式

  1. 在 Cursor 编辑器的 settings.json 中添加配置:
{
  "mcpServers": {
    "unsplash": {
      "command": "uv",
      "args": ["run", "--with", "fastmcp", "fastmcp", "run", "./server.py"],
      "env": {
        "UNSPLASH_ACCESS_KEY": "${YOUR_ACCESS_KEY}"
      }
    }
  }
}
  1. 确保 uv 在系统 PATH 中,或使用绝对路径
  2. 调整 ./server.py 为服务器脚本的实际位置

许可证

该项目遵循 MIT 开源许可条款,请参阅 MIT 了解完整条款。