# MCPollinations Project Overview π¨β¨
*Last Updated: September 26, 2025*
## Project Identity
**MCPollinations** is a comprehensive Model Context Protocol (MCP) server that enables AI assistants to generate multimodal content through the Pollinations APIs. It serves as a bridge between AI applications and advanced generative AI capabilities for images, text, and audio.
- **Project Name**: MCPollinations
- **Package Name**: `@pinkpixel/mcpollinations`
- **Current Version**: 1.3.0
- **Maintainer**: Pink Pixel (pinkpixel.dev)
- **License**: MIT
- **Repository**: https://github.com/pinkpixel-dev/mcpollinations
## Purpose & Vision
MCPollinations democratizes access to multimodal AI generation by providing:
- πΌοΈ **Professional Image Generation** - Create high-quality images from text prompts
- π¨ **Advanced Image Editing** - Modify existing images with natural language instructions
- π **Intelligent Text Generation** - Generate contextual text responses with fine-tuned parameters
- π΅ **Voice Synthesis** - Convert text to natural-sounding speech with multiple voice options
- π§ **MCP Protocol Compliance** - Seamless integration with AI applications like Claude Desktop
- ποΈ **Flexible Configuration** - Customizable parameters and optional authentication for enhanced features
## Architecture Overview
MCPollinations follows a **service-oriented architecture** with a **thin proxy design**, providing minimal abstraction over the Pollinations API while adding valuable MCP protocol compliance and enhanced functionality.
### Core Components
```
MCPollinations/
βββ pollinations-mcp-server.js # π Main MCP server entry point
βββ src/
β βββ index.js # π¦ Service exports and API client
β βββ schemas.js # π§ Centralized MCP tool definitions
β βββ services/ # π― Modular service architecture
β βββ imageService.js # π¨ Image generation & editing
β βββ imageSchema.js # π Image tool schemas
β βββ audioService.js # π΅ Audio generation
β βββ audioSchema.js # π Audio tool schemas
β βββ textService.js # π Text generation
β βββ textSchema.js # π Text tool schemas
βββ generate-mcp-config.js # βοΈ Interactive configuration generator
βββ tests/ # π§ͺ Testing suite
βββ test-mcp-client.js # Basic MCP functionality test
βββ test-image-save.js # Image saving test
βββ test-list-tools.js # Tool enumeration test
```
### Design Principles
1. **Service-Schema Pairing**: Each service module has a corresponding schema module ensuring consistency between implementation and MCP API contract
2. **Thin Proxy Design**: Minimal abstraction over Pollinations API while adding MCP compliance and enhanced features
3. **Modular Architecture**: Clear separation of concerns between image, text, and audio services
4. **Configuration-Driven**: Comprehensive configuration system supporting various deployment patterns
5. **Error-First Design**: Robust error handling with MCP-compliant error responses
## Technical Specifications
### Runtime Requirements
- **Node.js**: Version 14.0.0+ (16.0.0+ recommended for best performance)
- **AbortController**: Built-in polyfill for Node.js < 16
- **ES Modules**: Project uses `"type": "module"`
### Key Dependencies
- `@modelcontextprotocol/sdk`: MCP protocol implementation
- `node-fetch`: HTTP client for API requests
- `play-sound`: Audio playback functionality
- `node-abort-controller`: AbortController polyfill
### Authentication Support
- Optional token-based auth for enhanced API access
- Environment variables supported:
- `token`, `referrer` (preferred for MCP `env`)
- `POLLINATIONS_TOKEN`, `POLLINATIONS_REFERRER` (also accepted)
- Graceful fallback to free tier if unset
## Capabilities & Tools
MCPollinations provides **9 specialized MCP tools** across three categories:
### π¨ Image Generation Tools (5 tools)
1. **`generateImageUrl`** - Generate image URLs from text prompts
- Models: flux (default), turbo, kontext, nanobanana, seedream
- Customizable dimensions, seeds, enhancement options
2. **`generateImage`** - Generate images with file saving
- Returns base64 data AND saves to file (PNG default)
- Unique filename generation prevents overwrites
- Supports PNG, JPEG, JPG, WebP formats
3. **`editImage`** β *New in v1.2.0*
- Edit existing images with natural language instructions
- Perfect for: removing objects, adding elements, changing backgrounds
- Supports models: kontext (default), nanobanana, seedream
4. **`generateImageFromReference`** β *New in v1.2.0*
- Generate new images using existing images as reference
- Perfect for: style transfer, artistic interpretations, format changes
- Supports models: kontext (default), nanobanana, seedream
5. **`listImageModels`** - Enumerate available image generation models
### π Text Generation Tools (2 tools)
6. **`respondText`** - Advanced text generation with fine-tuning parameters
- Models: openai (default), and others via `listTextModels`
- Parameters: temperature (randomness), top_p (diversity), system prompts
- Privacy-first: always includes `private=true`
7. **`listTextModels`** - Dynamic model listing from Pollinations API
### π΅ Audio Generation Tools (2 tools)
8. **`respondAudio`** - Text-to-speech generation
- 13 available voices: alloy, echo, fable, onyx, nova, shimmer, coral, verse, ballad, ash, sage, amuch, dan
- Customizable voice instructions for character/style
- Returns base64 audio data
9. **`listAudioVoices`** - Enumerate all available voice options
## File Management & Storage
### Default Behavior
- **Auto-Save**: Images are automatically saved to disk by default
- **Output Directory**: `./mcpollinations-output` (configurable)
- **Format Support**: PNG (default), JPEG, JPG, WebP
- **Unique Naming**: Automatic collision avoidance with timestamp and random suffixes
### Filename Generation Strategy
```javascript
// Default pattern
`${sanitized_prompt}_${timestamp}_${random_suffix}.${format}`
// Custom filename collision handling
`${custom_name}.png` β `${custom_name}_1.png` β `${custom_name}_2.png`
```
### Cross-Platform Considerations
- **Relative Paths**: Default for portability
- **Windows Guidance**: Absolute paths recommended for reliability
- **Directory Creation**: Automatic recursive directory creation
## Configuration & Integration
### Installation Methods
1. **Direct Usage** (No installation required)
```bash
npx @pinkpixel/mcpollinations
```
2. **Global Installation**
```bash
npm install -g @pinkpixel/mcpollinations
mcpollinations
```
3. **Smithery Integration** (Claude Desktop)
```bash
npx -y @smithery/cli install @pinkpixel-dev/mcpollinations --client claude
```
4. **Repository Clone** (Development)
```bash
git clone https://github.com/pinkpixel-dev/mcpollinations.git
```
### Configuration Generator
The interactive configuration generator (`generate-mcp-config.js`) outputs an `env`-only MCP config and provides:
- βοΈ Custom output directory (`OUTPUT_DIR`)
- π Optional authentication (`token`, `referrer`)
- ποΈ Default parameters for image/text/audio via env keys
- π Platform-specific path guidance
### MCP Client Integration
MCPollinations integrates seamlessly with MCP-compatible clients:
```json
{
"mcpServers": {
"mcpollinations": {
"command": "npx",
"args": ["-y", "@pinkpixel/mcpollinations"],
"env": {
"token": "optional-token",
"referrer": "optional-referrer",
"OUTPUT_DIR": "./mcpollinations-output"
}
}
}
}
```
## Development Workflow
### Quick Development Commands
```bash
# Start the MCP server
npm start
# Generate MCP configuration interactively
npm run generate-config
# Run tests
npm test # Basic MCP client test
npm run test:image-save # Test image saving functionality
npm run test:list-tools # Test tool listing
# Install globally for system-wide use
npm install -g .
```
### Development Tools & Testing
- **MCP Inspector**: Compatible for interactive testing and debugging
- **Test Suite**: Comprehensive testing for core functionality
- **Error Handling**: Robust error reporting with detailed messages
- **Logging**: Structured logging for debugging and monitoring
### Adding New Tools
1. Create service function in appropriate `src/services/*Service.js` file
2. Define schema in corresponding `src/services/*Schema.js` file
3. Export schema from `src/schemas.js`
4. Add tool handler in `pollinations-mcp-server.js` CallToolRequestSchema handler
5. Update default configuration in `generate-mcp-config.js`
## Project Status & Evolution
### Current Version: 1.3.0 (September 2025)
**Recent Breaking Changes:**
- π« **Removed `gptimage` model** - No longer supported by Pollinations API
- π« **Removed transparent background support** - Feature discontinued
- β
**Updated image-to-image operations** - Now use `kontext` model as default
### Version History Highlights
- **v1.2.0** (July 2025): Added image-to-image generation tools
- **v1.1.3** (July 2025): Enhanced text generation with fine-tuning parameters
- **v1.1.2** (July 2025): Optional authentication support added
- **v1.0.7** (April 2025): Major update with file saving and comprehensive improvements
- **v1.0.6** (April 2025): Node.js compatibility improvements
- **v1.0.5** (April 2025): Initial public release
### Ecosystem Integration
- β
**Smithery**: Official listing and automated installation
- β
**MCP Clients**: Full compatibility with Claude Desktop and other MCP clients
- β
**CI/CD**: GitHub Actions for automated testing and publishing
- β
**Docker**: Containerization support for deployment flexibility
- β
**NPM**: Published package for easy distribution
## Quality Assurance & Standards
### Code Quality
- π **Semantic Versioning**: Strict adherence to SemVer principles
- π **Comprehensive Documentation**: README, CHANGELOG, CONTRIBUTING guides
- π§ͺ **Testing Suite**: Automated tests for core functionality
- π **Error Handling**: Robust error management with detailed reporting
### Security & Privacy
- π **Optional Authentication**: Token-based enhanced access
- π‘οΈ **Privacy-First**: Default `private=true` parameters
- β‘ **Rate Limiting**: Graceful handling of API rate limits
- π **Secure Defaults**: Safe parameter defaults for content filtering
### Development Standards
- π **MIT License**: Open source with permissive licensing
- π **Cross-Platform**: Linux, Windows, macOS compatibility
- π¦ **Dependency Management**: Minimal, well-maintained dependencies
- π **Backward Compatibility**: Careful handling of breaking changes with migration guides
## Future Considerations
While no formal roadmap exists, potential areas for future development include:
- π **Enhanced Model Support**: Integration with new Pollinations models as they become available
- ποΈ **Advanced Configuration**: More granular control over generation parameters
- π **Usage Analytics**: Optional usage tracking for optimization insights
- π **Multi-Language Support**: Internationalization for broader adoption
- π§ **Plugin Architecture**: Extensibility for custom functionality
---
*Made with β€οΈ by Pink Pixel*
*"Dream it, Pixel it" β¨*