Recraft MCP Server: Generate, Edit & Vectorize Images
Generate, edit, upscale and vectorize raster and SVG images on the Recraft MCP server—create custom styles and convert images instantly.
npx -y @recraft-ai/mcp-recraft-serverOverview
The Recraft MCP Server implements a Model Context Protocol (MCP) gateway for image generation, editing, upscaling and vectorization. It exposes an HTTP API that wraps image models and utilities so you can programmatically create raster and SVG assets, apply custom styles, edit images with masks, and convert bitmap artwork into scalable vector graphics. The server is intended for teams and developers who want to integrate image production and conversion into web apps, design systems, or automated pipelines.
Because it follows MCP principles, the server is designed to be modular and model-agnostic: you can run it locally, deploy it behind your own infrastructure, and connect it to multiple back-end model providers. It handles common tasks such as file storage, input validation, multipart uploads, and producing standard responses so clients can be written once and used against different model backends.
Features
- Generate new raster (PNG/JPEG) images from text prompts or sketches
- Edit existing images using masks (inpainting and compositing)
- Upscale images with configurable scale factors and quality settings
- Vectorize raster images into SVG output for icons or illustrations
- Support for styles/presets to reproduce custom looks consistently
- Local storage option and streaming responses for large assets
- Simple REST endpoints compatible with MCP-style integrations
- Docker and local development modes for quick setup
Installation / Configuration
Clone the repository, configure environment variables, and run with Docker Compose or locally (Node.js).
- Clone the repo
- Create a .env file (example)
# Server
PORT=8080
HOST=0.0.0.0
# Authentication / provider keys (if required by your backends)
RECRAFT_API_KEY=your_provider_key_here
# Storage
STORAGE_PATH=./data
# Optional
ALLOW_CORS=true
- Run with Docker Compose
# Server will be available at http://localhost:8080
- Run locally (Node-based dev)
# or
Adjust environment settings to point the server at your preferred model backends or object storage.
Available Resources
The server exposes a compact set of HTTP endpoints to perform the common image operations. Below is a typical mapping — consult the running server’s /openapi or /docs endpoint for the exact contract your deployment provides.
| Endpoint | Method | Purpose |
|---|---|---|
| /generate | POST | Produce a new image from a text prompt or parameters |
| /edit | POST | Edit an existing image via mask + prompt (inpainting/compositing) |
| /upscale | POST | Upscale an uploaded image (scale, quality options) |
| /vectorize | POST | Convert uploaded raster image into SVG vector output |
| /styles | GET/POST | List and create reusable style presets |
Example: generate an image (JSON)
Example: edit via multipart (image + mask)
Example: vectorize (returns SVG)
Use Cases
- E-commerce: Generate product variants (background removal, consistent stylized shots) and automatically upscale photos for different display sizes.
- Design systems: Convert designer raster icons into clean SVGs and create a library of style presets to keep assets consistent across products.
- Game development: Batch-generate and stylize sprites and game UI elements using textual prompts and presets.
- Marketing automation: Produce hero images and social post artwork programmatically, then vectorize logos and icons for responsive layouts.
- Accessibility and localization: Recreate imagery with alternative color palettes or simplified shapes for accessibility or regional branding.
Developer Notes
- Authentication: Add API key checks or a reverse proxy if deploying publicly. Use environment variables to supply provider credentials (RECRAFT_API_KEY or equivalents).
- Storage: By default the server can persist to a local directory. Swap in S3-compatible storage for production by updating configuration/environment.
- Extensibility: The server is model-agnostic — you can add or swap back-end image generators, upscalers, and vectorizers by implementing the adapter interfaces and wiring them into the configuration.
- Documentation: After starting the server, look for built-in API docs (e.g., /docs or /openapi.json) to see full request/response schemas for your deployed instance.
Repository and source: https://github.com/recraft-ai/mcp-recraft-server