一个基于Pixabay图片搜索的 Model Context Protocol (MCP) 服务器,借助该服务端,用户能够便捷地访问Pixabay图片API,实现图片搜索等功能。
英文版
这是一个基于TypeScript的MCP服务器,提供访问Pixabay图片API的功能。它通过以下方式演示了核心MCP概念:
Pixabay - MCP服务端是一个强大的工具,可帮助你轻松访问Pixabay图片API。在使用前,你需要完成一系列的配置与安装步骤。
search_pixabay_images:用于在Pixabay上搜索图片。
PIXABAY_API_KEY。安装项目所需的依赖:
npm install
构建服务器:
npm run build
npm run watch
# 在Windows上
set PIXABAY_API_KEY=your_api_key_here
# 在macOS/Linux上
export PIXABAY_API_KEY=your_api_key_here
~/Library/Application Support/Claude/claude_desktop_config.json
在Windows上:%APPDATA%/Claude/claude_desktop_config.json{
"mcpServers": {
"pixabay-mcp": {
"command": "/path/to/pixabay-mcp/build/index.js",
"env": {
"PIXABAY_API_KEY": "your_api_key_here"
}
}
}
}
由于MCP服务器通过stdio通信,调试可能具有挑战性。我们推荐使用MCP Inspector,它作为一个包脚本提供:
npm run inspector
Inspector将提供一个访问浏览器中的调试工具的URL。