Get the FREE Ultimate OpenClaw Setup Guide →

pollinations

🎨 Pollinations MCP Server - Connect AI agents to Pollinations.ai for image & text generation via Model Context Protocol with SSE support

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository git clone https://github.com/jpbester/pollinations-mcp-server.git cd pollinations-mcp-server

  2. Install dependencies npm install

  3. 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

  4. 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

Sponsor this space

Reach thousands of developers ↗