Unsplash MCP 服务器是一个轻量级的开源中继服务器,专为编辑器和其他语言模型设计,用于与 Unsplash API 进行交互,能为各类应用提供便捷的照片搜索与获取功能。
本项目提供了两种安装方式,你可以根据自己的需求进行选择。
根据你的操作系统选择相应的版本:
操作系统 | 下载链接 |
---|---|
Windows | 下载 |
macOS | 下载 |
Linux 64 - bit | 下载 |
git clone https://github.com/okooo5km/unsplash-mcp-server.git
cd unsplash-mcp-server
go build .
UNSPLASH_ACCESS_KEY
:用于身份验证的 Unsplash API 访问密钥。请参考 Unsplash 开发文档 获取。创建一个名为 config.json
的文件,内容如下:
{
"transport": "stdio",
"port": 8080,
"api_key": "your_unsplash_api_key_here"
}
{
"query": "mountain landscape",
"per_page": 5,
"color": "blue",
"orientation": "landscape"
}
{
"photoId": "Dwu85P9SOIk"
}
{
"count": 3,
"query": "coffee",
"orientation": "portrait"
}
支持以下命令行选项:
-h, --help
:显示服务器的帮助信息。-v, --version
:显示服务器版本号。-t, --transport
:设置传输类型(默认值:"stdio")
stdio
:直接与语言模型集成的标准输入输出模式。sse
:基于 HTTP 的 Server - Sent Events 模式。-p, --port
:指定 SSE 模式的监听端口(默认值:8080)。在 Cursor 编辑器的 settings.json
中添加:
{
"mcpServers": {
"unsplash": {
"command": "unsplash-mcp-server",
"env": {
"UNSPLASH_ACCESS_KEY": "your_access_key_here"
}
}
}
}
⚠️ 重要提示
在 Chatwise 中添加环境变量时,请不要使用引号包裹值(修复了 #1 问题)
如果你觉得这个项目对你有帮助,请考虑支持它的开发:
unsplash - mcp - server - go 根据 MIT 许可证发布。这意味着你可以自由地使用、修改和分发此软件,同时保留版权声明和许可声明。