{
  "markdown": "# MCP Asset Generation Server\n\n<img width=\"1645\" height=\"1034\" alt=\"Screenshot 2025-11-09 at 9 15 04 AM\" src=\"https://github.com/user-attachments/assets/d2bc7cda-8a09-4588-b3c8-7f430cfde2ee\" />\n\nA Model Context Protocol (MCP) server for generating various types of assets including images, videos, audio, and 3D models for game development.\n\nThree.js sample scene in [demo video](https://www.youtube.com/watch?v=KSVpJFqF5hg) located at [flux159/three-generator](https://github.com/Flux159/three-generator).\n\n## Features\n\n- **Image Generation**: Support for multiple providers (OpenAI DALL-E, Google Gemini, Fal.ai)\n- **Video Generation**: Coming soon\n- **Audio Generation**: Coming soon  \n- **3D Model Generation**: Generate 3D models using FAL.ai Trellis and Hunyuan3D 2.0\n- **Game Development Focus**: Optimized for creating game assets\n\n## Installation\n\n```bash\n# Clone the repository\ngit clone <repository-url>\ncd mcp-game-asset-gen\n\n# Install dependencies\nnpm install\n\n# Build the project\nnpm run build\n```\n\n## Development\n\n```bash\n# Run in development mode with hot reload\nnpm run dev\n\n# Run tests\nnpm test\n\n# Run tests with UI\nnpm run test:ui\n\n# Type checking\nnpm run typecheck\n\n# Linting\nnpm run lint\n```\n\n## Usage\n\nThe server provides tools and prompts for asset generation through the MCP protocol.\n\n### Available Tools\n\n#### Image Generation\n- `openai_generate_image`: Generate images using OpenAI's image generation API\n  - Parameters:\n    - `prompt` (required): Detailed description of the image to generate\n    - `outputPath` (required): Path where the generated image should be saved\n    - `inputImagePath` (optional): Path to input image for editing/variation\n    - `size` (optional): Image dimensions ('1024x1024', '1792x1024', '1024x1792')\n    - `quality` (optional): Image quality level ('standard', 'hd')\n    - `style` (optional): Image style preference ('vivid', 'natural')\n    - `n` (optional): Number of images to generate (1-10)\n\n- `gemini_generate_image`: Generate images using Google's Gemini native image generation (supports 2.5 Flash and 3 Pro models)\n  - Parameters:\n    - `prompt` (required): Description of the image to generate\n    - `outputPath` (required): Path where the generated image should be saved\n    - `inputImagePaths` (optional): Array of paths to input images for variation/combination\n    - `model` (optional): Gemini model to use ('gemini-2.5-flash-image', 'gemini-3-pro-image-preview', default: gemini-3-pro-image-preview)\n\n- `falai_generate_image`: Generate high-quality images using FAL.ai's Qwen image generation model\n  - Parameters:\n    - `prompt` (required): Detailed prompt for image generation\n    - `outputPath` (required): Path where the generated image should be saved\n    - `image_size` (optional): Image size preset ('square_hd', 'square', 'portrait_4_3', 'portrait_16_9', 'landscape_4_3', 'landscape_16_9')\n    - `num_inference_steps` (optional): Number of inference steps (1-50)\n    - `guidance_scale` (optional): How closely to follow the prompt (1-20)\n\n- `falai_edit_image`: Edit images using FAL.ai's Qwen image editing model\n  - Parameters:\n    - `prompt` (required): Detailed prompt describing the desired edits\n    - `inputImagePath` (required): Path to input image to be edited\n    - `outputPath` (required): Path where the edited image should be saved\n    - `image_size` (optional): Image size preset\n    - `num_inference_steps` (optional): Number of inference steps (1-50)\n    - `guidance_scale` (optional): How closely to follow the prompt (1-20)\n\n#### Game Asset Generation\n- `generate_character_sheet`: Generate character sheets from text descriptions or reference images\n  - Parameters:\n    - `characterDescription` (required): Detailed description of the character\n    - `outputPath` (required): Path where the character sheet should be saved\n    - `referenceImagePaths` (optional): Array of reference image paths (character, outfit, etc.)\n    - `model` (optional): Model to use for generation ('openai', 'gemini', 'falai', default: gemini - uses gemini-3-pro-image-preview)\n    - `style` (optional): Art style for the character sheet (e.g., anime, realistic, cartoon)\n    - `includeExpressions` (optional): Include multiple facial expressions\n    - `includePoses` (optional): Include multiple poses/angles\n\n- `generate_character_variation`: Generate character variations by combining reference images\n  - Parameters:\n    - `prompt` (required): Description of the variation to create\n    - `outputPath` (required): Path where the variation should be saved\n    - `referenceImagePaths` (required): Array of reference image paths to combine\n    - `model` (optional): Model to use for generation ('openai', 'gemini', 'falai', default: gemini - uses gemini-3-pro-image-preview)\n\n- `generate_pixel_art_character`: Generate pixel art characters with specific dimensions for retro games\n  - Parameters:\n    - `characterDescription` (required): Description of the pixel art character\n    - `outputPath` (required): Path where the pixel art should be saved\n    - `pixelDimensions` (required): Target pixel dimensions ('8x8', '16x16', '32x32', '48x48', '64x64', '96x96')\n    - `spriteSheet` (optional): Generate sprite sheet with animations\n    - `model` (optional): Model to use (default: falai)\n    - `colors` (optional): Color palette size (4-256 colors)\n    - `transparentBackground` (optional): Generate pixel art with transparent background for game sprites\n    - `backgroundColor` (optional): Background color to make transparent ('white', 'black', 'auto', default: white)\n\n- `generate_texture`: Generate seamless textures for 3D environments and materials\n  - Parameters:\n    - `textureDescription` (required): Description of the texture (e.g., grass field, brick wall, wood planks, sprite object)\n    - `outputPath` (required): Path where the texture should be saved\n    - `textureSize` (optional): Texture resolution ('512x512', '1024x1024', '2048x2048', default: 1024x1024)\n    - `seamless` (optional): Generate seamless/tileable texture\n    - `model` (optional): Model to use (default: falai)\n    - `materialType` (optional): Type of texture map ('diffuse', 'normal', 'roughness', 'displacement')\n    - `transparentBackground` (optional): Generate texture with transparent background for sprites/decals\n    - `backgroundColor` (optional): Background color to make transparent ('white', 'black', 'auto', default: white)\n    - `transparencyTolerance` (optional): Color variation tolerance for transparency (0-255, default: 30)\n\n- `generate_object_sheet`: Generate multi-viewpoint reference sheets for 3D modeling\n  - Parameters:\n    - `objectDescription` (required): Description of the 3D object\n    - `outputBasePath` (required): Base path for output files (will append _front.png, _side.png, etc.)\n    - `viewpoints` (optional): Viewpoints to generate ('front', 'back', 'left', 'right', 'top', 'bottom', 'perspective')\n    - `model` (optional): Model to use (default: gemini - uses gemini-3-pro-image-preview)\n    - `style` (optional): Art style (e.g., technical drawing, concept art)\n\n#### 3D Model Generation\n- `image_to_3d`: Generate 3D models from images using advanced AI models with automatic reference image generation\n  - Parameters:\n    - `outputPath` (required): Path where the generated 3D model should be saved (.glb or .gltf)\n    - `prompt` (optional): Description of the 3D model to generate (used for automatic reference image generation)\n    - `inputImagePaths` (optional): Array of paths to input images or base64 URIs. If not provided, reference images will be generated automatically\n    - `model` (optional): 3D generation model ('hunyuan3d', 'trellis', 'hunyuan-world', default: hunyuan3d)\n    - `variant` (optional): Model variant ('single', 'multi', 'single-turbo', 'multi-turbo', default: auto-selected)\n    - `format` (optional): Output format ('glb', 'gltf', default: glb for web/game compatibility)\n    - `textured_mesh` (optional): Generate textured mesh (Hunyuan3D only, 3x cost, default: true)\n    - `autoGenerateReferences` (optional): Automatically generate reference images from prompt if no input images provided (default: true)\n    - `referenceModel` (optional): Model to use for automatic reference image generation ('openai', 'gemini', 'falai', default: gemini - uses gemini-3-pro-image-preview)\n    - `referenceViews` (optional): Views to generate for reference images (default: [\"front\", \"back\", \"top\"])\n    - `cleanupReferences` (optional): Clean up automatically generated reference images after 3D generation (default: true)\n\n### Available Prompts\n\n- `asset_generation`: Generate various types of assets for game development\n  - Parameters:\n    - `asset_type` (required): Type of asset ('image', 'video', 'audio', '3d')\n    - `style` (optional): Art style or theme\n\n## Configuration\n\nYou'll need to configure API keys for the various providers:\n\n```bash\n# Environment variables\nexport OPENAI_API_KEY=\"your-openai-key\"\nexport GEMINI_API_KEY=\"your-gemini-key\"\nexport FAL_AI_API_KEY=\"your-fal-key\"\n```\n\n### Tool Filtering (Optional)\n\nTo reduce context usage, you can restrict which tools are available:\n\n```bash\n# Only expose specific tools\nexport ALLOWED_TOOLS=\"openai_generate_image,gemini_generate_image,generate_texture\"\n\n# Available tools:\n# - openai_generate_image\n# - gemini_generate_image  \n# - falai_generate_image\n# - falai_edit_image\n# - generate_character_sheet\n# - generate_character_variation\n# - generate_pixel_art_character (with transparent background support)\n# - generate_texture (with transparent background support for sprites/decals)\n# - generate_object_sheet\n# - image_to_3d (unified 3D generation with automatic reference images)\n\n## Transparent Background Generation\n\nThe server supports generating images with transparent backgrounds, perfect for game sprites and decals. This uses a two-step process with native JavaScript:\n\n1. Generate the image with a solid white/black background\n2. Convert the solid background to transparent alpha using native JavaScript processing\n\n### Features\n\n- **Native JavaScript**: No external dependencies required\n- **Auto-detection**: Automatically detects white or black backgrounds\n- **Adjustable tolerance**: Control how much color variation to allow\n- **PNG support**: Works with PNG images for transparency\n\n### Examples\n\n```bash\n# Generate transparent sprite texture\ngenerate_texture \\\n  --textureDescription \"magic fireball effect\" \\\n  --outputPath \"fireball_sprite.png\" \\\n  --transparentBackground true \\\n  --backgroundColor \"black\" \\\n  --materialType \"diffuse\"\n\n# Generate pixel art character with transparent background\ngenerate_pixel_art_character \\\n  --characterDescription \"knight with sword\" \\\n  --outputPath \"knight_sprite.png\" \\\n  --pixelDimensions \"32x32\" \\\n  --transparentBackground true \\\n  --colors 16\n\n# Generate 3D model with automatic reference images\nimage_to_3d \\\n  --prompt \"fantasy sword with ornate handle\" \\\n  --outputPath \"sword_model.glb\" \\\n  --model \"hunyuan3d\" \\\n  --autoGenerateReferences true\n\n# Generate character sheet with multiple poses\ngenerate_character_sheet \\\n  --characterDescription \"female warrior with armor\" \\\n  --outputPath \"warrior_sheet.png\" \\\n  --model \"gemini\" \\\n  --style \"realistic fantasy\" \\\n  --includeExpressions true \\\n  --includePoses true\n```\n```\n\n## Project Structure\n\n```\nmcp-game-asset-gen/\n├── src/\n│   ├── index.ts          # Main server file\n│   └── server.test.ts    # Tests\n├── package.json\n├── tsconfig.json\n├── vitest.config.ts\n└── README.md\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Run the test suite\n6. Submit a pull request\n\n## License\n\nMIT\n",
  "bytes": 11682,
  "sha": "8344c3df56b9c09d5ce930f89294f6b2af288029cdb3ade8ead5ba628cb2dcc7",
  "repo_slug": "flux159/mcp-game-asset-gen",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_flux159_mcp_game_asset_gen_90f13c4a/readme"
}