Skip to main content
Glama
sruckh
by sruckh

MCP Image Generator

A Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.

Features

  • Generate high-quality images from text prompts

  • Support for multiple anime and artistic styles:

    • Ghibli Style

    • Pixar Style

    • Pokemon Style

    • Genshin Impact Style

    • Cyberpunk Style

    • One Piece Style

    • Attack on Titan Style

    • Shinkai Makoto Style

    • Sailor Moon Style

    • Evangelion Style

    • Disney Princess Style

    • Kyoto Animation Style

    • Dreamworks Animation Style

    • Marvel Studios Style

    • DC Comics Style

    • Kawaii Pastel Style

    • Simpsons Style

    • Dragon Ball Style

    • Demon Slayer Style

    • Warner Bros Animation Style

    • Dark Fantasy Style

    • And many more Japanese anime styles

  • Multiple image size options:

    • Square (512x512)

    • Square HD (1024x1024)

    • Portrait 4:3 (768x1024)

    • Portrait 16:9 (576x1024)

    • Landscape 4:3 (1024x768)

    • Landscape 16:9 (1024x576)

  • Generate multiple images in one request (up to 4)

  • Image upscaling (4x resolution enhancement)

  • Image search and replace functionality

  • Built-in NSFW content detection

Related MCP server: fal-mcp

Installation

  1. Clone the repository:

git clone [repository-url]
cd aiimagemultistyle
  1. Install dependencies:

npm install
  1. Configure environment variables: Create a .env file with the following content:

FALAI_API_KEY=your_fal_ai_key_here

Usage

MCP Server Configuration

To use the MCP Image Generator server, add it to your mcpServers configuration:

{
  "mcpServers": {
    "image-generator": {
      "command": "npx",
      "args": ["-y", "aiimagemultistyle"]
    }
  }
}

You can also specify additional configuration options:

{
  "mcpServers": {
    "image-generator": {
      "command": "npx",
      "args": [
        "-y",
        "aiimagemultistyle",
        "--mode=rest",
        "--port=9593",
        "--endpoint=/rest"
      ],
      "env": {
        "FALAI_API_KEY": "your_fal_ai_key_here"
      }
    }
  }
}

Starting the Server

The server can run in two modes:

  1. STDIO mode (default):

npm start
  1. REST mode:

npm start -- --mode=rest --port=9593 --endpoint=/rest

API Reference

Generate Image

Request Format:

{
  "name": "generate_image",
  "arguments": {
    "prompt": "A beautiful sunset over mountains",
    "style": "ghibli-style",
    "num_images": 1,
    "size": "square_hd"
  }
}

Parameters:

  • prompt (required): Text description of the image to generate

  • style (optional): Image style (default: "ghibli-style")

    • Available styles: See the Features section above for the complete list

  • num_images (optional): Number of images to generate (1-4, default: 1)

  • size (optional): Image size (default: "square_hd")

    • Available sizes: "square", "square_hd", "portrait_4_3", "portrait_16_9", "landscape_4_3", "landscape_16_9"

Upscale Image

Request Format:

{
  "name": "upscale_image",
  "arguments": {
    "image_url": "https://example.com/image.jpg"
  }
}

Parameters:

  • image_url (required): URL of the image to upscale

Search and Replace

Request Format:

{
  "name": "search-and-replace",
  "arguments": {
    "image_url": "https://example.com/image.jpg",
    "mask_url": "https://example.com/mask.jpg",
    "prompt": "Description of the replacement"
  }
}

Parameters:

  • image_url (required): URL of the image to edit

  • mask_url (required): URL of the mask image (black areas preserved, white areas inpainted)

  • prompt (required): Description of the replacement content

Development

  • npm run build: Build the project

  • npm run watch: Watch mode for development

  • npm run inspector: Run MCP inspector

Error Handling

The server provides detailed error messages for common issues:

  • Missing API key

  • Invalid prompt

  • Invalid style or size parameters

  • API request failures

  • NSFW content detection

License

MIT

Available Tools

3 tools
generate_imageC

Generate images using fal.ai with various styles and options.

ParametersJSON Schema
NameRequiredDescriptionDefault
sizeNoImage sizesquare_hd
styleNoImage styleghibli-style
promptYesThe prompt to generate the image from
num_imagesNoNumber of images to generate (1-4)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It only mentions generating images with styles and options, but does not disclose any behavioral traits such as generation time, costs, safety, or potential destructive actions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that is front-loaded with purpose. It is concise, but could pack more useful detail without becoming verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is minimal for a generation tool with no output schema. It omits information about output type, generation time, rate limits, and differentiation from sibling tools. Given the tool's complexity and lack of annotations, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with all parameters having descriptions. The tool description adds only a generic statement about 'various styles and options', providing little extra meaning beyond the schema. Baseline is 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'generate' and resource 'images using fal.ai', with 'various styles and options' adding context. However, it does not differentiate from sibling tools like upscale_image, which also deals with images.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool vs alternatives. There is no mention of context, prerequisites, or exclusions. The description lacks any usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search-and-replaceB

Replace objects or elements in an image using text descriptions.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptNoThe prompt to use for generating the image. Be as descriptive as possible for best results.
mask_urlNoInput mask for inpaint mode. Black areas will be preserved, white areas will be inpainted.
image_urlYesInput image for img2img or inpaint mode

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It describes a mutation (replacement) but does not detail whether the operation is destructive, how the rest of the image is handled, or what the output format is. The mention of 'inpaint mode' in the mask_url schema description is not echoed in the tool description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that conveys the core purpose without filler. However, it could benefit from additional context without becoming verbose, so slightly below perfect.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of three parameters with full schema descriptions and no output schema, the description is adequate but lacks information about expected output, behavior when using mask, or any side effects. It leaves some gaps for an agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The tool description adds no additional meaning beyond what the schema already provides for each parameter (prompt, mask_url, image_url).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Replace objects or elements in an image using text descriptions.' It identifies the verb (replace), resource (objects/elements in an image), and method (text descriptions), distinguishing it from sibling tools which generate or upscale images.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for replacing objects, but does not provide explicit guidance on when to use this tool versus alternatives like generate_image or upscale_image, nor does it mention any prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

upscale_imageB

Enhance image resolution by 4x using fal.ai upscaling.

ParametersJSON Schema
NameRequiredDescriptionDefault
image_urlYesThe URL of the image to upscale

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description only mentions the upscaling factor but does not disclose potential side effects, rate limits, output format, or whether the operation is destructive. This leaves the agent uninformed about behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no filler, very concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with one parameter, but the description omits critical details such as what the output is (URL? base64?) and any limitations. With no output schema, the description should specify the return format to enable correct handling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has full coverage for the single parameter. The description adds no extra information about the parameter beyond the schema definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (enhance), the resource (image), the scaling factor (4x), and the service (fal.ai). It distinguishes from siblings which are image generation and text replacement.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives like generate_image. No mention of prerequisites or context like image URL must be valid.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedgenerate_image
    • First observedsearch-and-replace
    • First observedupscale_image

TDQS

B3.3/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a clearly distinct operation: generating new images, editing objects in existing images, and upscaling resolution. There is no overlap in purpose, so an agent can reliably distinguish them.

Naming Consistency4/5

Two tools (generate_image, upscale_image) follow a consistent verb_noun pattern, but search-and-replace uses a hyphenated phrase, breaking the pattern. The inconsistency is minor and does not impede understanding.

Tool Count3/5

With 3 tools, the server is borderline small for a comprehensive image service, but it covers core tasks (generation, editing, enhancement). The count feels slightly thin but not unreasonable.

Completeness3/5

The tools cover generation, editing, and upscaling, but lack common operations like cropping, resizing, or style transfer. The editing tool is limited to object replacement, leaving gaps for general image manipulation.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers