MCP Storybook Image Generator
Generate storybook images for children's stories using Google's Gemini AI.
MCP Storybook Image Generator
A professional-grade server that generates beautiful storybook images with matching children's stories using Google's Gemini AI.
π¬ Demo
π Features
- Storybook Image Generation: Creates high-quality images in various art styles for children's stories
- Automatic Story Creation: Generates engaging children's stories to match the images
- Multiple Art Styles: Choose from 3D cartoon, watercolor, pixel art, hand drawn, or claymation styles
- Instant Preview: Automatically opens generated images and stories in your browser
- Local Storage: Saves images and stories in an organized output directory
π οΈ Technical Stack
- Core Framework: Model Context Protocol (MCP) SDK
- AI Integration: Google Generative AI (Gemini)
- Runtime: Node.js v14+
- Language: TypeScript
- Package Manager: npm
π Prerequisites
- Node.js (v14 or higher)
- Google Gemini API key
- TypeScript
βοΈ Installation
- Install dependencies:
npm install
- Configure environment:
Create a
.env
file in the root directory:
GEMINI_API_KEY=your_api_key_here
- Build the project:
npm run build
π Using the CLI
You can use the storybook generator directly from the command line:
# Using npx (after publishing to npm)
npx mcp-storybook-image-generator --api-key your_api_key_here --save-to-desktop
# Or run locally
node build/cli.js --api-key your_api_key_here --save-to-desktop
Command Line Options
Option | Description |
---|---|
--api-key <key> | Set your Gemini API key |
--save-to-desktop | Save generated files to desktop |
--debug | Enable debug logging |
--help | Show help information |
π§ Configuring Claude Desktop with MCP Server
To integrate this server with Claude Desktop:
-
Locate the Claude Desktop Configuration File:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Linux:
~/.config/Claude/claude_desktop_config.json
- Windows:
-
Add the following configuration:
{
"mcpServers": {
"storybook-generator": {
"command": "npx",
"args": [
"-y",
"mcp-storybook-image-generator@latest",
"--api-key",
"your_gemini_api_key_here"
],
"env": {
"SAVE_TO_DESKTOP": "true",
"DEBUG": "false"
}
}
}
}
π Available Tool
Storybook Image Generator Tool
{
"name": "generate_storybook_image",
"description": "Generates a 3D style cartoon image with a children's story based on the given prompt",
"inputSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "The prompt describing the storybook scene to generate"
},
"fileName": {
"type": "string",
"description": "Base name for the output files (without extension)"
},
"artStyle": {
"type": "string",
"description": "The art style for the image (default: '3d cartoon')",
"enum": ["3d cartoon", "watercolor", "pixel art", "hand drawn", "claymation"]
}
},
"required": ["prompt", "fileName"]
}
}
π Example Usage
Storybook Generation Examples
// Generate a storybook with a 3D cartoon style
{
"name": "generate_storybook_image",
"arguments": {
"prompt": "A friendly dragon teaching kids how to fly",
"fileName": "dragon_flight_lesson",
"artStyle": "3d cartoon"
}
}
// Generate a storybook with a watercolor style
{
"name": "generate_storybook_image",
"arguments": {
"prompt": "A rabbit and turtle having a tea party in the forest",
"fileName": "forest_tea_party",
"artStyle": "watercolor"
}
}
// Generate a storybook with pixel art style
{
"name": "generate_storybook_image",
"arguments": {
"prompt": "A space adventure with a kid astronaut meeting friendly aliens",
"fileName": "space_adventure",
"artStyle": "pixel art"
}
}
βοΈ Configuration Options
Environment Variables
Variable | Description | Default |
---|---|---|
GEMINI_API_KEY | Google Gemini API key for AI generation | (Required) |
SAVE_TO_DESKTOP | Force saving to desktop directory | false |
DEBUG | Enable verbose debug logging | false |
π Output Files
For each storybook generation request, the server produces:
- PNG Image: The generated illustration matching your prompt in the requested art style
- Text File: The matching children's story in plain text format
- HTML Preview: A combined view showing both the image and story together
These files are saved to either:
- Your desktop in a folder called "storybook-images" (if
SAVE_TO_DESKTOP=true
) - The server's directory in a folder called "storybook-images"
π€ Contributing
Contributions, issues, and feature requests are welcome! Feel free to check issues page.
π License
This project is licensed under the MIT License - see the LICENSE file for details.
Related Servers
Laravel Codebase Introspection
Introspects Laravel codebases to provide structured information about views, routes, classes, and models using the mateffy/laravel-introspect package.
Adamik MCP Server
Interact with over 60 blockchain networks using any MCP client. Requires an Adamik API key.
Code Context MCP Server
Provides code context from local git repositories.
ADB MCP Server
Interact with Android devices using the Android Debug Bridge (ADB).
MCP Bridge
A proxy server that enables existing REST APIs to be used as Model Context Protocol (MCP) servers.
Octopus Deploy Official MCP Server
The Octopus MCP Server provides your AI assistant with powerful tools that allow it to inspect, query, and diagnose problems within your Octopus instance, transforming it into your ultimate DevOps wingmate.
xcodebuild
π Build iOS Xcode workspace/project and feed back errors to llm.
Last9
Seamlessly bring real-time production contextβlogs, metrics, and tracesβinto your local environment to auto-fix code faster.
Interactive Feedback MCP
Provides interactive user feedback and command execution for AI-assisted development.
Honeybadger
Interact with the Honeybadger API for error and uptime monitoring.