Pink Pixel/MCPollinations
Built by Metorial, the integration platform for agentic AI.
Pink Pixel/MCPollinations
Server Summary
Generate image URLs from text prompts
Generate images as base64-encoded data
Generate images in png, jpeg, jpg, or webp formats
Generate text responses from text prompts
Generate audio responses from text prompts
List available image and text generation models
A Model Context Protocol (MCP) server that enables AI assistants to generate images, text, and audio through the Pollinations APIs
To install mcpollinations for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @pinkpixel-dev/mcpollinations --client claude
The easiest way to use the MCP server:
# Run directly with npx (no installation required)
npx @pinkpixel/mcpollinations
If you prefer to install it globally:
# Install globally
npm install -g @pinkpixel/mcpollinations
# Run the server
mcpollinations
# or
npx @pinkpixel/mcpollinations
Or clone the repository:
# Clone the git repository
git clone https://github.com/pinkpixel-dev/mcpollinations.git
# Run the server
mcpollinations
# or
npx @pinkpixel/mcpollinations
# or run directly
node /path/to/MCPollinations/pollinations-mcp-server.js
To integrate the server with applications that support the Model Context Protocol (MCP):
# If installed globally
npx @pinkpixel/mcpollinations generate-config
# Or run directly
node /path/to/MCPollinations/generate-mcp-config.js
Follow the prompts to customize your configuration or use the defaults.
C:\Users\YourName\Pictures\MCPollinations
) for more reliable file savingCopy the generated mcp.json
file to your application's MCP settings .json file.
Restart your application.
After integration, you can use commands like:
"Generate an image of a sunset over the ocean using MCPollinations"
MCPollinations supports optional authentication to provide access to more models and better rate limits. The server works perfectly without authentication (free tier), but users with API tokens can get enhanced access.
Method 1: Environment Variables (Recommended for security)
# Set environment variables before running the server
export POLLINATIONS_TOKEN="your-api-token"
export POLLINATIONS_REFERRER="https://your-domain.com"
# Then run the server
npx @pinkpixel/mcpollinations
Method 2: MCP Configuration File When generating your MCP configuration, you'll be prompted for optional authentication settings:
{
"mcpollinations": {
"auth": {
"token": "your-api-token",
"referrer": "https://your-domain.com"
}
}
}
token
(optional): Your Pollinations API token for enhanced accessreferrer
(optional): Your domain/application referrer URLBoth parameters are completely optional. Leave them empty or unset to use the free tier.
MCPollinations respects your MCP configuration settings as defaults. When you ask an AI assistant to generate content:
Example Instructions:
This ensures your preferences are always respected unless you specifically want different settings for a particular request.
If you encounter this error when running the MCP server:
ReferenceError: AbortController is not defined
This is usually caused by running on an older version of Node.js (below version 16.0.0). Try one of these solutions:
Update Node.js (recommended):
Use Global Installation
npm install -g @pinkpixel/mcpollinations
# Run with npx
npx @pinkpixel/mcpollinations
Install AbortController manually:
npm install node-abort-controller
To check your current Node.js version:
node --version
If it shows a version lower than 16.0.0, consider upgrading for best compatibility.
The MCP server provides the following tools:
generateImageUrl
- Generates an image URL from a text promptgenerateImage
- Generates an image, returns it as base64-encoded data, and saves it to a file by default (PNG format)editImage
- NEW! Edit or modify existing images based on text promptsgenerateImageFromReference
- NEW! Generate new images using existing images as referencelistImageModels
- Lists available models for image generationrespondText
- Responds with text to a prompt using text models (customizable parameters)respondAudio
- Generates an audio response to a text prompt (customizable voice parameter)listTextModels
- Lists available models for text generationlistAudioVoices
- Lists all available voices for audio generationThe respondText
tool supports several parameters for fine-tuning text generation:
model
: Choose from available text models (use listTextModels
to see current options)temperature
(0.0-2.0): Controls randomness in the output
top_p
(0.0-1.0): Controls diversity via nucleus sampling
system
: System prompt to guide the model's behavior and personality// Example options for respondText
const options = {
model: "openai", // Model selection
temperature: 0.7, // Balanced creativity
top_p: 0.9, // High diversity
system: "You are a helpful assistant that explains things clearly and concisely."
};
In your MCP configuration, you can set defaults:
{
"default_params": {
"text": {
"model": "openai",
"temperature": 0.7,
"top_p": 0.9,
"system": "You are a helpful coding assistant."
}
}
}
MCPollinations now supports powerful image-to-image generation with two specialized tools:
Perfect for modifying existing images:
Perfect for creating variations and new styles:
kontext
: Specialized model optimized for image-to-image tasks// Edit an existing image
const editResult = await editImage(
"change the background to a sunset beach",
"https://example.com/photo.jpg",
"kontext"
);
// Generate from reference
const referenceResult = await generateImageFromReference(
"make this into a watercolor painting",
"https://example.com/photo.jpg",
"kontext"
);
When using the generateImage
tool:
// Example options for generateImage
const options = {
// Model selection (defaults to 'flux')
model: "flux",
// Image dimensions
width: 1024,
height: 1024,
// Generation options
seed: 12345, // Specific seed for reproducibility (defaults to random)
enhance: true, // Enhance the prompt using an LLM before generating (defaults to true)
safe: false, // Content filtering (defaults to false)
// File saving options
saveToFile: true, // Set to false to skip saving to disk
outputPath: "/path/to/save/directory", // Custom save location
fileName: "my_custom_name", // Without extension
format: "png" // png, jpeg, jpg, or webp
};
When using Claude or another application with the MCP server:
Images are saved in the current working directory of where the MCP server is running, not where Claude or the client application is installed.
If you start the MCP server manually from a specific directory, images will be saved there by default.
If Claude Desktop launches the MCP server automatically, images will be saved in Claude Desktop's working directory (typically in an application data folder).
💡 Windows Users: For reliable file saving on Windows, use absolute paths in your MCP configuration instead of relative paths (e.g., C:\Users\YourName\Pictures\MCPollinations
instead of ./mcpollinations-output
). Relative paths may not resolve as expected depending on the working directory context.
outputPath
parameterThe MCP server ensures that generated images always have unique filenames and will never overwrite existing files:
Default filenames include:
Custom filenames are also protected:
sunset.png
, sunset_1.png
, sunset_2.png
, etc.This means you can safely generate multiple images with the same prompt or filename without worrying about overwriting previous images.
Even when saving to a file, the base64-encoded image data is always returned and can be used for:
If you want to use the package in your own projects:
# Install as a dependency
npm install @pinkpixel/mcpollinations
# Import in your code
import { generateImageUrl, generateImage, repsondText, respondAudio, listTextModels, listImageModels, listAudioVoices } from '@pinkpixel/mcpollinations';