BR

bartwaardenburg/recraft-mcp-server

Developer tools
11 stars 5 forks Quality 88 Trend 32MIT

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.

Overview

recraft-mcp MCP server for AI image generation, transformation, and style management via the Recraft API This is an unofficial, community-maintained project and is not affiliated with or endorsed by Recraft. for image generation, processing, and style management — all accessible through the Model Context Protocol. - — Text-to-image, image-to-image, inpainting, background replacement & generation - — Background removal, region erasing, vectorization (SVG), crisp & creative upscaling - — Create custom styles from reference images, list/get/delete styles - — Check remaining credits and user info (included in styles toolset) - — Filter toolsets, adjust cache TTL, control retries - Node.js 20+ (or Docker) - A Recraft API token - macOS: ~/Library/Application Support/Claude/claude_desktop_config.json - Windows: %APPDATA%\Claude\claude_desktop_config.json Add to .vscode/mcp.json in your workspace (or use the one-click install buttons above): Add to Cursor's MCP settings (~/.cursor/mcp.

README

recraft-mcp

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

Note: This is an unofficial, community-maintained project and is not affiliated with or endorsed by Recraft.

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

Tool Description
generate_image Generate images from a text prompt with style, size, and artistic controls
image_to_image Transform an existing image based on a text prompt with adjustable strength
inpaint_image Fill in masked regions of an image based on a text prompt
replace_background Replace the background while preserving the foreground subject
generate_background Generate a background for masked areas of an image

Processing

Tool Description
remove_background Remove the background, leaving transparency
erase_region Seamlessly erase a masked region from an image
vectorize_image Convert raster images to scalable SVG vectors
crisp_upscale Upscale with sharp detail preservation
creative_upscale Upscale with creative enhancement and added detail

Styles & Account

Tool Description
create_style Create a custom style from 1-5 reference images
get_style Get details of a custom style by ID
list_styles List all custom styles
list_basic_styles List available curated styles
delete_style Delete a custom style
get_current_user Get user info and remaining credits

Tool Annotations

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

Tool Read-only Open-world
generate_image Yes
image_to_image Yes
inpaint_image Yes
replace_background Yes
generate_background Yes
remove_background Yes
erase_region Yes
vectorize_image Yes
crisp_upscale Yes
creative_upscale Yes
create_style Yes
get_style Yes Yes
list_styles Yes Yes
list_basic_styles Yes Yes
delete_style Yes
get_current_user Yes Yes

Configuration

Environment Variable Description Default
RECRAFT_API_TOKEN Required. Your Recraft API token —
RECRAFT_TOOLSETS Comma-separated toolsets to enable: generation, processing, styles All
RECRAFT_CACHE_TTL Cache TTL in seconds (0 to disable) 120
RECRAFT_MAX_RETRIES Max 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

Model Description
recraftv3 Recraft V3 (default)
recraftv4 Recraft V4 (latest raster)
recraftv4_vector Recraft V4 Vector (SVG output)
recraftv2 Recraft V2
recraft20b Recraft 20B (legacy)
refm1 RefM1

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

Supported Styles

Style Substyles
realistic_image (default) b_and_w, enterprise, hard_flash, hdr, motion_blur, natural_light, studio_portrait
digital_illustration pixel_art, hand_drawn, grain, infantile_sketch, 2d_art_poster, handmade_3d, engraving, comic_book
vector_illustration bold_stroke, chemistry, colored_stencil, contour_pop_art, flat_2, line_art, line_circuit
icon broken_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

View the full README on GitHub

Install

npx -y recraft-mcp
New to MCP? Start with the mcpskill.org guide →

Configuration

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