Best Ways to Generate Images Inside Claude and Cursor (2026)

Yes, you can generate images without leaving Claude or Cursor. The cleanest way is an MCP image server that your agent calls directly. Type a request, get a PNG in your project folder. No tab-switching, no upload, no API key in your shell.

The path you choose depends on how much you actually need. This article walks through each option honestly: what it takes to set up, where it works, and where it stops working. If you already know you want the full setup, the install guide for AgentBrush takes about two minutes.

Option 1: Copy-paste from a separate web app

The most common approach today. You open Midjourney, ChatGPT, or another web tool in a browser tab, generate there, download the file, and drag it into your project.

It works. There is no debate about that. But it is also the option that costs the most in friction over time. Every image breaks your development flow: you lose context, you wait for a tab to load, you manage file names manually. If you need ten assets for a single feature, you have made ten round trips.

Where this makes sense: you are generating one or two images total for a one-off project. The setup cost of anything more complex is not worth it.

Where it starts hurting: any project that needs a consistent asset pipeline, iteration on existing images, or background removal. Those workflows become tedious in a browser tab very quickly.

Option 2: Open-source MCP bridges

The Model Context Protocol lets any MCP-compatible client (Claude Code, Cursor, Codex CLI, Gemini CLI, and others) call external tools as if they were native capabilities. Several community-built MCP servers wrap image APIs and expose them to your agent.

The best of these are genuinely useful for simple generation. You install the server, add it to your MCP config, and you can ask your agent to "generate an image of X" from the chat panel. For a quick proof of concept, that is a real improvement over the browser-tab workflow.

The limitations show up quickly in production use:

  • No presets. You write every style detail in the prompt from scratch. This is fine once. It is annoying the hundredth time you need a flat illustration with the same visual language.
  • No mask editor. If you want to repaint one region of an existing image, you are regenerating from scratch or switching to a web tool.
  • No local background removal. Some bridges call a cloud API to strip backgrounds, which adds latency and costs money at volume. Others just do not support it.
  • No reference images. Keeping a character or product consistent across outputs requires passing reference images, and most thin wrappers do not expose that.

For a quick, disposable image or a personal project where variety is fine, an open-source bridge is a reasonable choice. For anything that needs consistency, style control, or iterative editing, you will quickly want more.

Option 3: A full MCP image tool (AgentBrush)

AgentBrush is an MCP server built specifically for this use case. It connects to Claude Code, Cursor, Codex CLI, Gemini CLI, and any other MCP-compatible client, and it handles the full image workflow without you leaving your editor.

The practical difference from a thin bridge:

Presets. Six built-in styles (realistic, flat_illustration, pixel_art, isometric, logo, custom) mean you do not re-describe your visual language every time. For a project that needs consistent illustrations, you pick flat_illustration once and every asset comes back with the same visual grammar.

gpt-image-2 quality. AgentBrush runs on gpt-image-2, OpenAI's image model launched in April 2026. Instruction-following is strong, text inside images is legible, and the model reasons about your request before generating. More on what the model can do is in what gpt-image-2 means for image generation.

Local background removal at zero token cost. Generate on a clean background, then ask to remove it. The two-step process exists because gpt-image-2 does not produce a reliable native alpha channel: AgentBrush generates your subject first, then runs background removal locally, never uploading your image anywhere, and always outputs a real transparent alpha-channel PNG. No cloud service, no per-image charge. For a detailed walkthrough, see transparent-background PNG generation.

Reference images for consistency. Pass an existing image as a reference and the output inherits the same subject. One product shot stays identical across lifestyle scenes. One character stays recognizable across a sprite sheet. This is the practical alternative to training a LoRA when you just need consistent outputs, not a fine-tuned model.

Mask editor for regional edits. Select a region, describe what you want changed, and regenerate only that area. Background swaps, label corrections, and pose adjustments without touching the rest of the image.

AI image generation without leaving your editor: the actual flow

Here is what a typical request looks like from inside Cursor or Claude Code.

You type this in the chat panel:

Generate a flat app icon: a stylized lightning bolt inside a rounded square,
dark navy background, electric blue gradient on the bolt, clean and minimal.
preset: flat_illustration ยท quality: medium

AgentBrush receives the request, compiles it into a well-structured gpt-image-2 call, handles the size, tracks the token cost (5 tokens at medium quality), and saves the file into your project directory. You get a file path back in the chat, with the image already sitting where you need it.

If you want a transparent version:

Remove the background from the icon.

One more call. Background stripped locally, free, PNG with real transparency saved alongside the original.

If you want to adjust just the bolt color without regenerating everything:

Open the mask editor on the icon. I want to change the bolt from electric blue to warm orange.

The mask editor opens, you paint the region, confirm, and the edit lands. The rest of the image stays intact.

The token costs are worth knowing before you start. At 1024x1024: low quality costs 1 token, medium costs 5, high costs 20. Plans start at $6.99/month for 100 tokens (Starter, low and medium only), $14.99/month for 600 tokens (Pro), and $29.99/month for 1,300 tokens (Power, the only tier with $0.04/token overage). A medium-quality icon is 5 tokens; a high-quality hero image is 20. Full cost breakdown is here.

Generate images in Cursor: setup in two minutes

The setup is the same whether you are using Cursor or Claude Code. You install the AgentBrush MCP server and add one entry to your MCP config. The install guide covers both editors step by step.

Once it is connected, image generation is a natural-language request from whatever chat panel you already use. There is no new interface to learn.

Claude image generation: what the model handles vs. what AgentBrush handles

Claude itself does not generate images. It reasons about your request, decides which tool to call, and passes a well-formed prompt to AgentBrush. AgentBrush then calls gpt-image-2 and returns the result. From your perspective this is seamless: you ask for an image and you get one. Under the hood, you are getting Claude's instruction-following and agentic reasoning as the prompt-to-API layer, and gpt-image-2's generation quality as the output layer.

This also means context from your project can flow into the image request. Claude can read a color hex from your design tokens, infer the style from earlier conversation, or reference a file in your project directory. The image generation is connected to the rest of your agent session, not isolated in a separate tab.

Choosing the right option

Situation Recommendation
One-off image, no setup budget Browser web app
Occasional generation, minimal config Open-source MCP bridge
Regular asset work, style consistency, editing, transparent PNGs AgentBrush

For a ranked comparison of all available image-generation MCP servers, including tradeoffs between them, see best image-generation MCP servers.

Where this breaks down

AgentBrush is worth the two-minute setup for any project that needs more than a few images. But there are limits worth knowing:

Complex scenes with many subjects can drift from the reference if the composition gets crowded. Simpler subjects stay more consistent.

Very fine edges (hair, fur, glass) give the background remover more trouble than clean geometric silhouettes. For pixel art sprites or logo marks, the cut-out is nearly always clean. For a photo of a person with loose hair, you may need to regenerate on a higher-contrast background.

Sizes above 2K are outside what gpt-image-2 reliably handles in AgentBrush. Stay at 1024x1024 for anything that needs to be dependable.

The mask editor is best for bounded regional edits. If you want to change the fundamental composition of an image, a fresh generate is faster than masking.

FAQ

Can I generate images in Claude without any plugins? Claude can describe images and reason about them, but it does not generate image files natively. You need a tool connected via MCP. AgentBrush is the connection between your Claude session and the gpt-image-2 generation API.

Does Cursor support image generation? Not built-in. Cursor supports MCP servers, which means you can add AgentBrush to your MCP config and generate images directly from the Cursor chat panel. The setup is one config entry and takes about two minutes.

Is the background removal really free? Yes. It runs locally using a segmentation model that executes on your machine. No upload, no cloud service, no token cost. You can remove backgrounds at any volume without it affecting your token balance.

What image formats does AgentBrush output? PNG for everything. Background removal always outputs a PNG with a real transparent alpha channel. Generated images without background removal are also PNG.


Ready to generate from your editor? Connect AgentBrush to Claude or Cursor and run your first image request in two minutes. The setup is one config entry; everything after that is a conversation.