Home / MCP / Pixabay MCP Server
Provides Pixabay image and video search via an MCP server with runtime validation and safe, structured results.
Configuration
View docs{
"mcpServers": {
"pixabay_mcp": {
"command": "npx",
"args": [
"pixabay-mcp@latest"
],
"env": {
"PIXABAY_API_KEY": "your_api_key_here",
"PIXABAY_TIMEOUT_MS": "10000",
"PIXABAY_RETRY": "0"
}
}
}
}Pixabay MCP Server exposes Pixabay image and video search tools over stdio, enabling AI assistants to fetch media safely with runtime validation and structured results. It supports image and video queries through the official Pixabay API, enforces sane parameter ranges, and logs errors without leaking keys for secure downstream automation.
You run the Pixabay MCP Server as an MCP endpoint and connect your MCP client to it. Your client can query images or videos using the provided tools, receive human‑readable results now and planned structured payloads later, and rely on safe defaults like protected keys and input validation. Use it to integrate Pixabay media search directly into your automation workflows.
Core tools you can invoke are: - search_pixabay_images: find images by a string query with optional filters like image_type, orientation, and per_page. - search_pixabay_videos: find videos by a string query with optional filters like video_type, orientation, per_page, min_duration, and max_duration.
Choose a deployment method that fits your setup.
Option 1: Run via npx
```
```json
{
"mcpServers": {
"pixabay-mcp": {
"command": "npx",
"args": ["pixabay-mcp@latest"],
"env": {
"PIXABAY_API_KEY": "your_api_key_here"
}
}
}
}Option 2: Local installation and direct run
```
```
```
json
{
"mcpServers": {
"pixabay-mcp": {
"type": "stdio",
"name": "pixabay_mcp",
"command": "/path/to/pixabay-mcp/build/index.js",
"args": [],
"env": {
"PIXABAY_API_KEY": "your_api_key_here"
}
}
}
}Practical steps to set up locally: - Install dependencies and build the project (if you clone the repository). - Provide your Pixabay API key in the configuration. - Start the MCP server using one of the options above and connect your MCP client to it.
Environment variables you need to configure: - PIXABAY_API_KEY: Your Pixabay API key (required for both image and video endpoints). It is never echoed back in errors or logs. - PIXABAY_TIMEOUT_MS: Optional; timeout in milliseconds for requests (default 10000). - PIXABAY_RETRY: Optional; number of retry attempts for transient errors (default 0).
Notes: - Safe search is enabled by default. - Keys are never echoed back in structured errors or logs.
Current usage returns a human‑readable text block. Planned updates (Roadmap v0.4+) add a structured JSON payload with hits, durations, and URLs for downstream automation.
Found 120 images for "cat":
- cat, pet, animal (User: Alice): https://.../medium1.jpg
- kitten, cute (User: Bob): https://.../medium2.jpg
```
```jsonc
{
"content": [
{ "type": "text", "text": "Found 120 images for \"cat\":\n- ..." },
{
"type": "json",
"data": {
"query": "cat",
"totalHits": 120,
"page": 1,
"perPage": 20,
"hits": [
{ "id": 123, "tags": ["cat","animal"], "user": "Alice", "previewURL": "...", "webformatURL": "...", "largeImageURL": "..." }
]
}
}
]
}- Do not expose your Pixabay API key in logs or error messages. The server is designed to avoid echoing keys in errors or structured outputs. - If you encounter connection issues, verify that PIXABAY_API_KEY is correctly set and that your MCP client is configured to connect to the running stdio server. - Use the MCP Inspector for debugging when available to inspect message exchanges and timing.
Planned improvements include structured JSON payloads, enhanced timeout handling, and improved modularity for future multi‑source integrations.
Search images with required query and optional filters like image_type, orientation, and per_page; returns a human-readable block now and a planned structured JSON array of hits.
Search videos with required query and optional filters like video_type, orientation, per_page, min_duration, and max_duration; returns a human-readable block and planned structured payload.