Provides access to Google's Gemini 2.5 Flash Image Preview for AI-powered image generation and editing through Kie.ai's Nano Banana service
Built as a Node.js application requiring Node.js 18+ runtime environment
Distributed and installed via npm package manager
Uses SQLite database for persistent task tracking and management of generation requests
Kie.ai MCP Server
An MCP (Model Context Protocol) server that provides access to Kie.ai's AI APIs including Nano Banana image generation/editing and Veo3 video generation.
Features
- Nano Banana Image Generation: Text-to-image generation using Google's Gemini 2.5 Flash Image Preview
- Nano Banana Image Editing: Natural language image editing with up to 5 input images
- Veo3 Video Generation: Professional-quality video generation with text-to-video and image-to-video capabilities
- 1080p Video Upgrade: Get high-definition versions of Veo3 videos
- Task Management: SQLite-based task tracking with status polling
- Smart Endpoint Routing: Automatic detection of task types for status checking
- Error Handling: Comprehensive error handling and validation
Prerequisites
- Node.js 18+
- Kie.ai API key from https://kie.ai/api-key
Installation
From NPM
From Source
Configuration
Environment Variables
MCP Configuration
Add to your Claude Desktop or MCP client configuration:
Or if installed globally:
Available Tools
1. generate_nano_banana
Generate images using Nano Banana.
Parameters:
prompt
(string, required): Text description of the image to generate
Example:
2. edit_nano_banana
Edit images using natural language prompts.
Parameters:
prompt
(string, required): Description of edits to makeimage_urls
(array, required): URLs of images to edit (max 5)
Example:
3. generate_veo3_video
Generate videos using Veo3.
Parameters:
prompt
(string, required): Video descriptionimageUrls
(array, optional): Image for image-to-video (max 1)model
(enum, optional): "veo3" or "veo3_fast" (default: "veo3")aspectRatio
(enum, optional): "16:9" or "9:16" (default: "16:9")seeds
(integer, optional): Random seed 10000-99999watermark
(string, optional): Watermark textenableFallback
(boolean, optional): Enable fallback mechanism
Example:
4. get_task_status
Check the status of a generation task.
Parameters:
task_id
(string, required): Task ID to check
5. list_tasks
List recent tasks with their status.
Parameters:
limit
(integer, optional): Max tasks to return (default: 20, max: 100)status
(string, optional): Filter by status ("pending", "processing", "completed", "failed")
6. get_veo3_1080p_video
Get 1080P high-definition version of a Veo3 video.
Parameters:
task_id
(string, required): Veo3 task ID to get 1080p video forindex
(integer, optional): Video index (for multiple video results)
Note: Not available for videos generated with fallback mode.
API Endpoints
The server interfaces with these Kie.ai API endpoints:
- Veo3 Video Generation:
POST /api/v1/veo/generate
✅ VALIDATED - Veo3 Video Status:
GET /api/v1/veo/record-info
✅ VALIDATED - Veo3 1080p Upgrade:
GET /api/v1/veo/get-1080p-video
✅ VALIDATED - Nano Banana Generation:
POST /api/v1/playground/createTask
✅ VALIDATED - Nano Banana Status:
GET /api/v1/playground/recordInfo
✅ VALIDATED
All endpoints have been tested and validated with live API responses.
Database Schema
The server uses SQLite to track tasks:
Usage Examples
Basic Image Generation
Video Generation with Options
Error Handling
The server handles these HTTP error codes from Kie.ai:
- 200: Success
- 400: Content policy violation / English prompts only
- 401: Unauthorized (invalid API key)
- 402: Insufficient credits
- 404: Resource not found
- 422: Validation error / record is null
- 429: Rate limited
- 451: Image access limits
- 455: Service maintenance
- 500: Server error / timeout
- 501: Generation failed
Development
Pricing
Based on Kie.ai documentation:
- Nano Banana: $0.020 per image (4 credits)
- Veo3 Quality: Higher cost tier
- Veo3 Fast: ~20% of Quality model pricing
See https://kie.ai/billing for detailed pricing.
Production Tips
- Database Location: Set
KIE_AI_DB_PATH
to a persistent location - API Key Security: Never commit API keys to version control
- Rate Limiting: Implement client-side rate limiting for high-volume usage
- Monitoring: Monitor task status and handle failed generations appropriately
- Storage: Consider automatic cleanup of old task records
Troubleshooting
Common Issues
"Unauthorized" errors
- Verify
KIE_AI_API_KEY
is set correctly - Check API key is valid at https://kie.ai/api-key
"Task not found" errors
- Tasks may expire after 14 days
- Check task ID format matches expected pattern
Generation failures
- Check content policy compliance
- Verify prompt is in English
- Ensure sufficient API credits
Support
For issues related to:
- MCP Server: Open an issue at https://github.com/andrewlwn77/kie-ai-mcp-server/issues
- Kie.ai API: Contact support@kie.ai or check https://docs.kie.ai/
- API Keys: Visit https://kie.ai/api-key
License
MIT License - see LICENSE file for details.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Changelog
v1.0.0
- Initial release
- Nano Banana image generation and editing
- Veo3 video generation
- 1080p video upgrade support
- SQLite task tracking
- Smart endpoint routing
- Comprehensive error handling
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI-powered image generation and editing with Nano Banana, plus professional video creation with Veo3, all through Kie.ai's APIs. Includes task tracking, status monitoring, and 1080p video upgrades.
Related MCP Servers
- AsecurityAlicenseAqualityA server that enables generating videos from static images using Vidu's AI models, with features for image-to-video conversion, task monitoring, and image uploading.Last updated -32MIT License
- -securityFlicense-qualityProvides tools to interact with RunwayML and Luma AI APIs for video and image generation, including text-to-video, image-to-video, prompt enhancement, and management of generations.Last updated -9
- -securityAlicense-qualityEnables video generation from text prompts or images using Google's Veo 3 API. Supports multiple models, audio generation, and various aspect ratios for creating high-quality videos.Last updated -MIT License
- -securityFlicense-qualityEnables AI assistants to generate high-quality images using OpenAI's DALL-E 3 model with configurable parameters like size, quality, and style. Generated images are automatically saved to the local filesystem with comprehensive error handling.Last updated -1