MCP Hub
Back to servers

recraft-mcp-server

MCP server for AI image generation, transformation, and style management via the Recraft API. 16 tools for text-to-image, inpainting, vectorization, upscaling, and more.

GitHub
Stars
8
Forks
6
Updated
Mar 15, 2026

recraft-mcp

MCP server for AI image generation, transformation, and style management via the Recraft API

npm version npm downloads license CI TypeScript Node.js Smithery

Install with NPX in VS Code Install with Docker in VS Code


16 tools for image generation, processing, and style management — all accessible through the Model Context Protocol.

  • Generate — Text-to-image, image-to-image, inpainting, background replacement & generation
  • Process — Background removal, region erasing, vectorization (SVG), crisp & creative upscaling
  • Styles — Create custom styles from reference images, list/get/delete styles
  • Account — Check remaining credits and user info (included in styles toolset)
  • Configurable — Filter toolsets, adjust cache TTL, control retries

Prerequisites

Installation

Claude Desktop

Add to your config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "recraft": {
      "command": "npx",
      "args": ["-y", "recraft-mcp"],
      "env": {
        "RECRAFT_API_TOKEN": "your-api-token"
      }
    }
  }
}

VS Code

Add to .vscode/mcp.json in your workspace (or use the one-click install buttons above):

{
  "servers": {
    "recraft": {
      "command": "npx",
      "args": ["-y", "recraft-mcp"],
      "env": {
        "RECRAFT_API_TOKEN": "your-api-token"
      }
    }
  }
}

Claude Code

claude mcp add recraft-mcp -e RECRAFT_API_TOKEN=your-api-token -- npx -y recraft-mcp

Cursor

Add to Cursor's MCP settings (~/.cursor/mcp.json):

{
  "mcpServers": {
    "recraft": {
      "command": "npx",
      "args": ["-y", "recraft-mcp"],
      "env": {
        "RECRAFT_API_TOKEN": "your-api-token"
      }
    }
  }
}

Windsurf

Add to Windsurf's MCP config (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "recraft": {
      "command": "npx",
      "args": ["-y", "recraft-mcp"],
      "env": {
        "RECRAFT_API_TOKEN": "your-api-token"
      }
    }
  }
}

Docker

docker run --rm -i -e RECRAFT_API_TOKEN="your-api-token" ghcr.io/bartwaardenburg/recraft-mcp-server:latest

Use Docker in any MCP client by replacing the command:

{
  "mcpServers": {
    "recraft": {
      "command": "docker",
      "args": [
        "run", "--rm", "-i",
        "-e", "RECRAFT_API_TOKEN=your-api-token",
        "ghcr.io/bartwaardenburg/recraft-mcp-server:latest"
      ]
    }
  }
}

Smithery

npx -y @smithery/cli install recraft-mcp --client claude

Tools

Generation

ToolDescription
generate_imageGenerate images from a text prompt with style, size, and artistic controls
image_to_imageTransform an existing image based on a text prompt with adjustable strength
inpaint_imageFill in masked regions of an image based on a text prompt
replace_backgroundReplace the background while preserving the foreground subject
generate_backgroundGenerate a background for masked areas of an image

Processing

ToolDescription
remove_backgroundRemove the background, leaving transparency
erase_regionSeamlessly erase a masked region from an image
vectorize_imageConvert raster images to scalable SVG vectors
crisp_upscaleUpscale with sharp detail preservation
creative_upscaleUpscale with creative enhancement and added detail

Styles & Account

ToolDescription
create_styleCreate a custom style from 1-5 reference images
get_styleGet details of a custom style by ID
list_stylesList all custom styles
list_basic_stylesList available curated styles
delete_styleDelete a custom style
get_current_userGet user info and remaining credits

Tool Annotations

All tools include MCP tool annotations to help clients understand their behavior:

ToolRead-onlyOpen-world
generate_imageYes
image_to_imageYes
inpaint_imageYes
replace_backgroundYes
generate_backgroundYes
remove_backgroundYes
erase_regionYes
vectorize_imageYes
crisp_upscaleYes
creative_upscaleYes
create_styleYes
get_styleYesYes
list_stylesYesYes
list_basic_stylesYesYes
delete_styleYes
get_current_userYesYes
Detailed Parameter Reference

generate_image

ParameterTypeRequiredDescription
promptstringYesText description (max 1000 chars V2/V3, 10000 V4)
modelenumrecraftv3 (default), recraftv4, recraftv4_vector, recraftv2, recraft20b, refm1
styleenumrealistic_image (default), digital_illustration, vector_illustration, icon, logo_raster
substylestringSubstyle refinement (e.g. b_and_w, pixel_art, watercolor)
style_iduuidCustom style ID (mutually exclusive with style/substyle)
sizeenumImage dimensions, e.g. 1024x1024 (default), 1365x1024, 1536x1024, etc.
nintegerNumber of images to generate (1-6, default 1)
negative_promptstringWhat to avoid in the image
artistic_levelinteger0 (simple) to 5 (dynamic)
no_textbooleanPrevent text in the image
image_formatenumwebp or png
random_seedintegerSeed for reproducible results

image_to_image

ParameterTypeRequiredDescription
imagestringYesSource image (URL or base64). Max 5MB, <16MP, max 4096px per side
promptstringYesDescription of desired changes
strengthnumberYesChange magnitude: 0.0 (minimal) to 1.0 (maximum)
modelenumModel to use
styleenumStyle category (not supported for V4)
substylestringSubstyle refinement
style_iduuidCustom style ID
nintegerNumber of outputs (1-6)
negative_promptstringWhat to avoid
image_formatenumwebp or png
random_seedintegerSeed for reproducibility

inpaint_image

ParameterTypeRequiredDescription
imagestringYesSource image (URL or base64)
maskstringYesGrayscale PNG mask (white = inpaint, black = preserve)
promptstringYesWhat to generate in the masked area
model, style, substyle, style_id, n, negative_prompt, image_format, random_seedSame as generate_image

replace_background

ParameterTypeRequiredDescription
imagestringYesSource image (URL or base64)
promptstringYesDescription of the new background
model, style, substyle, style_id, n, negative_prompt, image_format, random_seedSame as generate_image

generate_background

ParameterTypeRequiredDescription
imagestringYesSource image (URL or base64)
maskstringYesMask defining the background area
promptstringYesDescription of the background to generate
model, style, substyle, style_id, n, negative_prompt, image_format, random_seedSame as generate_image

remove_background

ParameterTypeRequiredDescription
imagestringYesImage (URL or base64)
image_formatenumwebp or png

erase_region

ParameterTypeRequiredDescription
imagestringYesSource image (URL or base64)
maskstringYesGrayscale mask (white = erase, black = preserve)
image_formatenumwebp or png

vectorize_image

ParameterTypeRequiredDescription
imagestringYesImage to vectorize (URL or base64)

crisp_upscale

ParameterTypeRequiredDescription
imagestringYesImage to upscale (URL or base64). Max 5MB, <4MP
image_formatenumwebp or png

creative_upscale

ParameterTypeRequiredDescription
imagestringYesImage to upscale (URL or base64). Max 5MB, <16MP
image_formatenumwebp or png

create_style

ParameterTypeRequiredDescription
imagesstring[]Yes1-5 reference images (URLs or base64)
styleenumYesBase style category

get_style

ParameterTypeRequiredDescription
style_iduuidYesStyle ID to retrieve

delete_style

ParameterTypeRequiredDescription
style_iduuidYesStyle ID to delete

list_styles, list_basic_styles, get_current_user

No parameters required.

Configuration

Environment VariableDescriptionDefault
RECRAFT_API_TOKENRequired. Your Recraft API token
RECRAFT_TOOLSETSComma-separated toolsets to enable: generation, processing, stylesAll
RECRAFT_CACHE_TTLCache TTL in seconds (0 to disable)120
RECRAFT_MAX_RETRIESMax retry attempts on rate limit (429)3

Toolset Filtering

Reduce the number of tools exposed to the LLM by enabling only what you need:

# Only image generation
RECRAFT_TOOLSETS=generation

# Generation + processing, no style management
RECRAFT_TOOLSETS=generation,processing

Supported Models

ModelDescription
recraftv3Recraft V3 (default)
recraftv4Recraft V4 (latest raster)
recraftv4_vectorRecraft V4 Vector (SVG output)
recraftv2Recraft V2
recraft20bRecraft 20B (legacy)
refm1RefM1

Note: V4 models do not support the style parameter — use the prompt to control style.

Supported Styles

StyleSubstyles
realistic_image (default)b_and_w, enterprise, hard_flash, hdr, motion_blur, natural_light, studio_portrait
digital_illustrationpixel_art, hand_drawn, grain, infantile_sketch, 2d_art_poster, handmade_3d, engraving, comic_book
vector_illustrationbold_stroke, chemistry, colored_stencil, contour_pop_art, flat_2, line_art, line_circuit
iconbroken_line, colored_outline, colored_shapes, doodle_fill, doodle_offset_fill, offset_fill, outline
logo_raster

Image Input

Tools that accept images (image_to_image, inpaint_image, remove_background, etc.) support:

  • URL — Any publicly accessible HTTP(S) URL
  • Base64 — Raw base64-encoded image data

Security

  • API token — Your RECRAFT_API_TOKEN is sent only to the Recraft API (https://external.api.recraft.ai). It is never logged or stored beyond the process lifetime.
  • Image data — Images are sent to Recraft's servers for processing. No image data is cached on disk.
  • Network access — This server makes outbound HTTPS requests to external.api.recraft.ai and registry.npmjs.org (for update checks).

See SECURITY.md for reporting vulnerabilities.

Development

pnpm install         # Install dependencies
pnpm dev             # Run with tsx (hot reload)
pnpm build           # Compile TypeScript
pnpm test            # Run tests
pnpm typecheck       # Type check

See CONTRIBUTING.md for guidelines.

License

MIT

Reviews

No reviews yet

Sign in to write a review