@pollinations_ai/mcp
v2.0.2
Published
Model Context Protocol (MCP) server for pollinations.ai - image, text, audio & video generation
Readme
pollinations.ai MCP Server v2.0
A Model Context Protocol (MCP) server for pollinations.ai that enables AI assistants to generate images, videos, text, and audio.
What's New in v2.0
- New API endpoint: Uses
gen.pollinations.ai- the unified pollinations.ai gateway - Authentication: Simple API key system (pk*/sk* keys) replaces OAuth
- Video generation: New
generateVideotool with veo, seedance, seedance-pro - Chat completions: OpenAI-compatible
chatCompletiontool with function calling - Dynamic models: Models fetched from API - always up to date, no hardcoding!
- SDK upgrade: Updated to MCP SDK 1.25.1 with latest protocol support
Quick Start
# Run directly with npx (no installation required)
npx @pollinations_ai/mcpOr install globally:
npm install -g @pollinations_ai/mcp
pollinations-mcpAuthentication
Get your API key at pollinations.ai
Key Types:
pk_(Publishable): Client-safe, rate-limited (1 pollen per IP per hour)sk_(Secret): Server-side only, no rate limits, can spend Pollen
Set your key via environment variable or the setApiKey tool:
# Environment variable
export POLLINATIONS_API_KEY=pk_your_key_here
npx @pollinations_ai/mcpAvailable Tools
Image & Video Generation
| Tool | Description |
| ------------------ | -------------------------------------------- |
| generateImageUrl | Generate an image URL from text prompt |
| generateImage | Generate image and return base64 data |
| generateVideo | Generate video (veo, seedance, seedance-pro) |
| listImageModels | List available models (dynamic) |
Image parameters:
prompt(required): Text descriptionmodel: flux, turbo, gptimage, kontext, seedream, seedream-pro, nanobanana, nanobanana-pro, zimagewidth,height: Image dimensions (default: 1024)seed: Reproducible resultsenhance: Improve promptnegative_prompt: What to avoidquality: low, medium, high, hdimage: Reference image URL for image-to-imagetransparent: Transparent background
Video parameters:
model: veo (text-to-video), seedance, seedance-pro (image-to-video)duration: Video length in secondsaspectRatio: 16:9, 9:16, etc.audio: Enable audio (veo only)
Text Generation
| Tool | Description |
| ---------------- | ---------------------------------------- |
| generateText | Simple text generation |
| chatCompletion | OpenAI-compatible chat with tool calling |
| listTextModels | List available models (dynamic) |
Text models include: openai, openai-fast, openai-large, gemini, gemini-fast, gemini-large, claude, claude-fast, claude-large, deepseek, grok, mistral, qwen-coder, and more!
Chat completion features:
- Multi-turn conversations
- Function/tool calling
- JSON response format
- Audio output (with openai-audio model)
Audio Generation
| Tool | Description |
| ----------------- | ------------------------- |
| respondAudio | AI responds with speech |
| sayText | Text-to-speech (verbatim) |
| listAudioVoices | List available voices |
Voices: alloy, echo, fable, onyx, nova, shimmer, coral, verse, ballad, ash, sage, amuch, dan
Formats: mp3, wav, flac, opus, pcm16
Authentication
| Tool | Description |
| ------------- | ------------------------ |
| setApiKey | Set API key for requests |
| getKeyInfo | Check current key status |
| clearApiKey | Remove stored key |
Claude Desktop Integration
npx @pollinations_ai/mcp install-claude-mcpOr manually add to your Claude Desktop config:
{
"mcpServers": {
"pollinations": {
"command": "npx",
"args": ["@pollinations_ai/mcp"],
"env": {
"POLLINATIONS_API_KEY": "pk_your_key_here"
}
}
}
}Examples
Generate an image
Generate an image of a sunset over mountains using the flux modelGenerate a video
Create a 6-second video of waves crashing on a beach using veoChat with function calling
Use chatCompletion to have a conversation about the weather, with the ability to call a weather APIText-to-speech
Say "Hello, welcome to pollinations.ai!" using the nova voiceSystem Requirements
- Node.js: Version 18.0.0 or higher
API Reference
All requests go through https://gen.pollinations.ai
| Endpoint | Description |
| --------------------------- | -------------------- |
| GET /image/{prompt} | Generate image/video |
| GET /text/{prompt} | Generate text |
| POST /v1/chat/completions | Chat completions |
| GET /image/models | List image models |
| GET /text/models | List text models |
Full API docs: enter.pollinations.ai/api/docs
Migration from v1.x
Breaking Changes
- Authentication: OAuth removed → Use API keys (pk*/sk*)
- Removed tools:
startAuth,exchangeToken,refreshToken,getDomains,updateDomains - New tools:
generateVideo,chatCompletion,setApiKey,getKeyInfo,clearApiKey - API endpoint: Now uses
gen.pollinations.ai
Upgrade Steps
- Get API key from pollinations.ai
- Update:
npm update @pollinations_ai/mcp - Set your key: Use
setApiKeytool orPOLLINATIONS_API_KEYenv var
License
MIT
