本工具主要为 AI 代理提供支持,借助强大的搜索引擎,可快速精准地搜索到合适的图片。同时,它还具备自动下载与分类功能,能根据项目类型将图像智能分类到指定文件夹,并且支持批量处理多个图像请求,还可自动从 URL 中提取关键属性,确保信息完整。
npm install
创建一个 .env 文件并添加以下内容:
UNSPLASH_ACCESS_KEY=你的Unsplash API密钥
运行以下命令启动开发服务器:
npm run dev
使用 search 命令搜索并下载图像:
npx unsplash-smart-mcp-server search --query "your search term" --output ~/Downloads/stock-photos --projectType next
使用 get_attributions 命令获取图片的属性信息:
npx unsplash-smart-mcp-server get-attributions --format json --projectPath your_project_path
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| query | string | 搜索关键词 | - |
| output | string | 下载目录 | ~/Downloads/stock-photos |
| projectType | string | 项目类型(next, react, vue, angular) | - |
| category | string | 图片分类 | - |
| downloadMode | string | 下载模式(download, urls_only) | urls_only |
| 参数 | 类型 | 描述 | 默认值 |
|---|---|---|---|
| format | string | 输出格式(json, html, react) | json |
| projectPath | string | 项目路径 | - |
| outputPath | string | 输出路径 | - |
确保服务器在指定端口上运行。
验证你的 Unsplash API 密钥是否正确设置。
尝试更广泛的搜索词或检查你的搜索查询。
使用 downloadMode: 'urls_only' 并手动执行下载命令。
MIT License
欢迎贡献!请随意提交拉取请求。
npm install。.env 文件并添加你的 Unsplash API 密钥。npm run dev。npm test。
为你的 AI 代理赋能,每次都能找到完美的图像。
由 ❤️ 开发,专为开发者和 AI 爱好者打造。