MCP Documentation
CONNECT YOUR
AGENT IN
5 MINUTES.
MemeForge exposes 18 image tools via MCP (Model Context Protocol). Your AI agent gets meme generation, background removal, filters, composition and more — no GUI required. Two transports: stdio for local, HTTP for hosted.
Step 0
QUICK START
The fastest path from zero to meme. One config line, then ask your agent to generate a meme — it handles the rest.
Add MemeForge to your MCP client
claude mcp add memeforge https://memeforge.xyz/api/mcp
Or add manually to your config file
{
"mcpServers": {
"memeforge": {
"url": "https://memeforge.xyz/api/mcp"
}
}
}Ask your agent to make a meme
"Make a Drake meme where he rejects writing tests and prefers deploying to production"
The agent calls MemeForge tools automatically
That's it. Below is the detailed setup for both transports and the full tool reference.
Transport 1
STDIO (LOCAL)
Runs as a local subprocess. Your MCP client (Claude Code, Claude Desktop, Cursor) launches the server and communicates via stdin/stdout. Best for development and when you want everything local.
1. Build the server
cd mcp-server npm install npm run build
2. Configure your client
claude mcp add memeforge -- node /path/to/MemeForge/mcp-server/dist/index.js
Or add manually to config files
{
"mcpServers": {
"memeforge": {
"command": "node",
"args": ["/path/to/MemeForge/mcp-server/dist/index.js"]
}
}
}{
"mcpServers": {
"memeforge": {
"command": "node",
"args": ["/path/to/MemeForge/mcp-server/dist/index.js"]
}
}
}In stdio mode, tools accept a saveTo parameter. Files are saved to /tmp/memeforge-output/ with path traversal protection. Example: saveTo: "my-meme.png"
Transport 2
HTTP (HOSTED)
Connect to the hosted MemeForge server via URL. No install, no build, no subprocess. Works with any MCP client that supports HTTP/SSE transport.
claude mcp add memeforge https://memeforge.xyz/api/mcp
Or add manually to any MCP client config
{
"mcpServers": {
"memeforge": {
"url": "https://memeforge.xyz/api/mcp"
}
}
}No install
Just paste the URL
Same 18 tools
Identical to stdio
Free tier
100 req/day, no key needed
To self-host the HTTP endpoint, run the Next.js app (npm run dev) and point your config to http://localhost:3001/api/mcp. The HTTP transport includes auth middleware, CORS, and security headers.
Tools 1-5
MEME TOOLS
The core meme creation workflow. Search templates, generate memes from descriptions, or render with full control over text positions and styling.
The fastest path. Describe what you want and MemeForge auto-selects the best template and renders the meme in one call. Great when you know the vibe but not the exact template.
generate_meme({
description: "drake approval meme",
texts: [
"Spending 6 hours debugging",
"Adding console.log everywhere"
]
})
// → Returns rendered meme imageSearch templates WITHOUT rendering. Returns zone labels, descriptions, and hints so you can verify the match before committing. Use this when you want to preview which template fits.
find_template({
query: "plan that backfires",
limit: 3
})
// → Returns:
// 1. gru-plan — Gru's Plan [featured]
// Zones: [0] step-1, [1] step-2, [2] step-3, [3] realization
// Use when: multi-step plan where step 3 or 4 backfiresGenerate a meme from a specific template ID. Texts are auto-positioned into the template's zones in order. Supports fuzzy matching if the exact ID isn't found.
meme_from_template({
template: "expanding-brain",
texts: [
"Using var",
"Using let",
"Using const",
"Using TypeScript enums"
]
})Full control rendering. Provide a custom image URL with manually positioned text overlays and optional deep-fry effects. Use this for non-template memes or custom layouts.
render_meme({
image: "https://example.com/photo.jpg",
width: 800,
height: 600,
texts: [{
text: "TOP TEXT",
x: 50, y: 20,
width: 700, height: 100,
fontSize: 64,
color: "#FFFFFF",
outlineColor: "#000000",
outlineWidth: 4,
font: "Impact",
allCaps: true,
textAlign: "center",
textStyle: "outline"
}],
deepFry: {
noise: 3,
jpegIterations: 2,
jpegQuality: 15
}
})Browse all 220+ templates with optional search and tier filter. Returns template IDs, zone counts, and keywords. Paginated.
list_templates({
query: "comparison",
limit: 5,
tier: "featured"
})
// → drake, distracted-boyfriend, two-buttons, ...Tools 6-10
IMAGE OPERATIONS
Resize, crop, rotate, flip, and adjust. Accept image URLs or base64 data URIs. Return the processed image.
Resize to target dimensions. Fit modes: cover (crop to fill), contain (fit within, may letterbox), stretch, inside (shrink only), outside (grow only).
resize({
image: "https://example.com/photo.jpg",
width: 400,
height: 400,
fit: "cover"
})Crop a rectangular region by pixel coordinates.
crop({
image: "https://example.com/photo.jpg",
x: 100, y: 50,
width: 600, height: 400
})Rotate by any angle. Canvas expands to fit. Positive = clockwise.
rotate({
image: "https://example.com/photo.jpg",
angle: 45,
background: "#000000"
})Mirror an image horizontally, vertically, or both.
flip({
image: "https://example.com/photo.jpg",
direction: "horizontal"
})Adjust brightness, contrast, saturation, blur, opacity. Toggle grayscale, sepia, or invert.
adjust({
image: "https://example.com/photo.jpg",
brightness: 20,
contrast: 30,
saturation: -50,
grayscale: false,
blur: 2
})Tools 11-13
COMPOSITION
Combine multiple images. Layer with positioning, create collages, or stamp watermarks.
Layer multiple images on a canvas. Each layer has position, size, opacity, rotation, and anchor point. Layers draw in array order (first = bottom).
compose({
width: 1200,
height: 800,
background: "#000000",
layers: [
{ image: "https://.../background.jpg" },
{
image: "https://.../logo.png",
x: 50, y: 50,
width: 200,
opacity: 0.8,
anchor: "top-left"
},
{
image: "https://.../sticker.png",
x: 900, y: 600,
rotation: -15,
anchor: "center"
}
]
})Arrange up to 20 images in a grid, horizontal strip, or vertical strip. Auto-sizes cells. Configurable gap and background color.
collage({
images: [
"https://.../photo1.jpg",
"https://.../photo2.jpg",
"https://.../photo3.jpg",
"https://.../photo4.jpg"
],
layout: "grid",
columns: 2,
gap: 8,
background: "#FFFFFF"
})Stamp a watermark/logo onto an image. 5 positions, configurable opacity, scale, and margin.
watermark({
image: "https://.../photo.jpg",
watermark: "https://.../logo.png",
position: "bottom-right",
opacity: 0.3,
scale: 0.15,
margin: 20
})Tools 14-15
CLEANUP
Remove text from memes or remove backgrounds from images. ML-powered where available.
Strip text from a meme. First tries template matching (returns the clean original if found). Falls back to pixel-based inpainting. Adjustable sensitivity and radius.
remove_text({
image: "https://.../meme-with-text.jpg"
})
// → "Text removed using template matching
// (clean original found!)"
// Force pixel inpainting:
remove_text({
image: "https://.../custom-meme.jpg",
forceInpaint: true,
sensitivity: 60,
radius: 10
})5 methods: auto (ML first, fallback to color), ml (rembg U2-Net), sam (MobileSAM with bounding boxes — best quality), color (flood fill), threshold (brightness cutoff). Returns transparent PNG.
// Automatic (recommended)
remove_background({
image: "https://.../product.jpg",
method: "auto"
})
// SAM with bounding box (best for specific subjects)
remove_background({
image: "https://.../group-photo.jpg",
method: "sam",
boxes: [
{ x1: 100, y1: 50, x2: 400, y2: 500 }
]
})
// Color-based (e.g. green screen)
remove_background({
image: "https://.../greenscreen.jpg",
method: "color",
color: "#00FF00",
tolerance: 30
})Tools 16-18
FILTERS & PRESETS
Apply named filter presets in one call. Each preset is a curated combination of adjustments and deep-fry effects.
Apply a preset by ID. Use list_filters to see all options.
apply_filter({
image: "https://.../photo.jpg",
filter: "deep-fried"
})Available presets
deep-friedOversaturated, noisy, JPEG artifactsvintageWarm, faded retro with sepianoirB&W with high contrastvaporwaveHigh saturation pink/blue aestheticnuclearMaximum artifacts, bulge, distortionsoftSlight blur, warm brightnesshigh-contrastPunchy contrast and saturationnegativeInverted colorswashed-outDesaturated, low contrast, fadedcomicHigh contrast, sharp edges, vividReturns all available filter presets with descriptions.
list_filters() // → deep-fried, vintage, noir, vaporwave, nuclear, // soft, high-contrast, negative, washed-out, comic
Returns all fonts available for text rendering.
list_fonts() // → Impact, Arial, Arial Black, Comic Sans MS, // Courier New, Georgia, Helvetica, Times New Roman, // Trebuchet MS, Verdana
Reference
TEMPLATE SYSTEM
220+ meme templates in two tiers. Featured templates (15) have hand-crafted text zones with hints. Extended templates (205+) come from the memegen.link MIT catalog with auto-generated zones.
Featured templates (15)
drakedistracted-boyfriendtwo-buttonschange-my-mindexpanding-brainone-does-not-simplybatman-slapping-robindisaster-girlthis-is-finealways-has-beenbernie-askingis-this-a-pigeonleft-exittrade-offerthinkingThe texts array must match the template's zone order. For Drake: texts[0] = what gets rejected (top), texts[1] = what gets approved (bottom).
Always use find_template first if you're unsure about zone order. It returns labels and hints for each zone.
Reference
DEEP FRY EFFECTS
The deepFry parameter on render_meme, generate_meme, and meme_from_template accepts these settings. All are optional — combine any subset for your desired level of chaos.
Recipe examples
deepFry: {
brightness: 10,
contrast: 15,
saturation: 40,
jpegIterations: 2,
jpegQuality: 30
}deepFry: {
brightness: 25,
contrast: 40,
saturation: 250,
sharpen: 15,
noise: 8,
jpegIterations: 10,
jpegQuality: 5,
bulgeAmount: 3,
bulgeRadius: 70
}Bonus
BUILT-IN PROMPTS
MemeForge includes 3 MCP prompts your agent can invoke for guidance. These inject context without using a tool call.
quickstart60-second intro to MemeForge: workflow, key tools, common mistakes, first meme example.
template_cheatsheetZone order reference for all 15 featured templates. Which text goes where.
meme_guideHow to write meme text that actually lands. Tone, length, common patterns.
Common pitfalls
- –Emojis don't render (canvas has no emoji font). They're stripped automatically with a warning.
- –Fewer texts than zones = empty zones. The tool warns you.
- –Max image dimension is 4096x4096. Larger images are rejected.
Tips
- –Chain tools:
remove_background→composeto put subjects on new backgrounds. - –Use
find_templatebeforegenerate_memeto verify zone order. - –Featured templates have richer zones. Extended templates may need manual positioning via
render_meme.