pollinations
🎨 Pollinations MCP Server - Connect AI agents to Pollinations.ai for image & text generation via Model Context Protocol with SSE support
claude mcp add --transport stdio jpbester-pollinations-mcp-server node server.js \ --env PORT="3000" \ --env API_KEY="your-secret-api-key (optional; enable Bearer auth in MCP client)" \ --env NODE_ENV="production" \ --env LOG_LEVEL="info" \ --env ALLOWED_ORIGINS="https://your-n8n-instance.com" \ --env RATE_LIMIT_WINDOW_MS="900000" \ --env RATE_LIMIT_MAX_REQUESTS="100"
How to use
This MCP server exposes tools to integrate Pollinations.ai into n8n workflows via the MCP protocol. It supports image generation through Pollinations image models, and text generation across multiple language models, while also allowing model discovery. Use the SSE endpoint at /sse to stream responses to MCP clients (such as n8n's MCP Client Tool). You can ask your AI agent to trigger generate_image for visuals, generate_text for written content, or list_models to surface available image and text generation options. Authentication is optional and can be enabled via API_KEY; when enabled, clients should send a Bearer token. The server also includes health and test endpoints to verify connectivity and status.
How to install
Prerequisites:
- Node.js 18+ and npm installed
- Git installed
- Optional: Docker (if you prefer containerized deployment)
Install steps:
-
Clone the repository git clone https://github.com/jpbester/pollinations-mcp-server.git cd pollinations-mcp-server
-
Install dependencies npm install
-
Configure environment (example using a .env file or environment variables)
Basic configuration (adjust for your deployment)
export NODE_ENV=production export PORT=3000 export LOG_LEVEL=info export ALLOWED_ORIGINS=https://your-n8n-instance.com
Optional authentication
export API_KEY=your-secure-api-key export RATE_LIMIT_WINDOW_MS=900000 export RATE_LIMIT_MAX_REQUESTS=100
-
Start the server npm start
For development with auto-reload: npm run dev
Containerized (Docker) deployment (if you prefer):
Build and run your container
docker build -t pollinations-mcp-server . docker run -p 3000:3000 --name pollinations-mcp-server pollinations-mcp-server
Access the server at: http://localhost:3000
Additional notes
Tips and common considerations:
- SSE endpoints: Use /sse for streaming MCP messages to n8n. Ensure your client maintains the SSE connection for real-time updates.
- Security: If you enable API_KEY, configure the MCP Client Tool in n8n to send a Bearer token. Define ALLOWED_ORIGINS to restrict CORS as needed.
- Endpoints: Use /health for health checks, /sse for streaming MCP messages, /message for MCP messages, and /mcp for unified MCP interactions.
- Environment variables: Use PORT to set the listening port; NODE_ENV controls logging and behavior; LOG_LEVEL adjusts verbosity.
- Docker: The README suggests a typical image name pollinations-mcp, but customize as needed for your registry. Expose port 3000 if that is the server port.
- Troubleshooting: Check docker logs or npm logs if the server fails to start; verify that environment variables are loaded correctly in your runtime environment.
Related MCP Servers
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.