Skip to content
Guides

Cursor MCP Image Generation: Make Assets in the Editor

Cursor MCP image generation from one mcp.json entry: prompts for heroes, icons and illustrations, a model per asset, and caps on what the agent spends.

Updated 6 min read

Cursor MCP image generation takes one entry in mcp.json: once the server is added, the agent can price, start and read back images and clips, then save the files into your project like any other change. Cursor's agent has had an image tool of its own since version 2.4, which its changelog says runs on Google's Nano Banana Pro. A server such as Frameport's adds a choice of models, from Nano Banana Pro itself to GPT Image 2.5 Sunburst and Frameport Image 1, plus video, a price before every call, and spending caps you set.

This guide adds the server, gives prompts that turn into real assets for your app, matches a model to each kind of asset, and keeps each project's spending bounded.

Add the server to mcp.json

Create an API key under API keys in the dashboard, one per project, so each project's images show under its own key's name. Then pick where the server lives:

  • ~/.cursor/mcp.json in your home folder makes it available in every project you open.
  • .cursor/mcp.json at the root of a project makes it part of that project, and the file can be committed.

For a project file that goes into git, leave the key out of it. Cursor fills in ${env:NAME} from the environment in the url and headers of a server, so each person on the team uses their own key:

.cursor/mcp.json
{
  "mcpServers": {
    "frameport": {
      "url": "https://frameport.ai/mcp",
      "headers": { "Authorization": "Bearer ${env:FRAMEPORT_API_KEY}" }
    }
  }
}

Each person then exports FRAMEPORT_API_KEY with their key. If Cursor was opened from the Dock or the Start menu and does not see the variable, start it from a terminal where the variable is set (cursor .), or put the server in your global file instead. Cursor lists the server under Customize in the sidebar, where you can switch it off and on; a missing or revoked key answers 401 and the server does not connect.

It is a remote server over Streamable HTTP, and it keeps no session: every call carries the key, and nothing runs on your machine. The MCP docs keep the config for every client current.

Generate assets from the editor

Ask in plain words, in Agent mode. The agent picks the tools: get_quote for the price, generate_image to start, and get_generation to read the result until it is done. Because the agent can read your code, the best prompts point it at the file the asset is for:

Read app/pages/index.vue and make a 16:9 hero image that matches its headline, on nano-banana-pro.
Quote it first and set max_cost_usd to the quote. Save it as public/images/hero.png and use it on the page.

Make three 4:3 empty-state illustrations, for the inbox, search and settings screens, flat and warm,
on fp-image-1. Make the inbox one first, then pass its file id as a reference for the other two.

Give me four 1:1 icon ideas for a weather app in one call on gpt-image-2-5-sunburst.
Show them to me before saving anything.

When an image has succeeded, get_generation returns it inline, up to two pictures per read of 4 MB at most each. Cursor attaches them to the chat, so the agent sees what it made and can try again ("the horizon is too high"). Every file also comes with a signed download link that works without a key for about an hour; the agent saves it into your repo with a terminal command such as curl -o public/images/hero.png "<link>", which runs under your usual terminal approvals. You name the folder and the file in the prompt.

To edit an image the agent made, name it by its file id (file_…), which it has from the generation: "the same hero at night". A picture on your disk is a different case: the server cannot read your files, so give it a public https URL, or upload it to your workspace first (uploads).

The same tools start video. A looping background for the hero, as a draft on Frameport Motion 1, costs $0.10 for 5 seconds at 480p; the agent then reads the clip every 10 seconds or so until it is ready.

Choosing a model per asset

Every image model of the catalog is open through the same tool, and its id is one word in the prompt. Four kinds of asset cover most projects:

AssetModelShapePer image
A hero or a bannerNano Banana Pro16:9$0.16
A social card with its title in the pictureGPT Image 2.5 Sunburst16:9$0.085
A set of illustrations that must matchFrameport Image 14:3 or 1:1$0.025
Icon and logo ideasGPT Image 2.5 Sunburst1:1$0.085

Why these: Nano Banana Pro is its maker's highest-fidelity model, renders lettering accurately, and edits from up to 6 reference pictures, which makes it the pick for the image visitors see first. GPT Image 2.5 Sunburst follows layout instructions closely and writes legible text, but reads no pictures, so it works from the prompt alone. Frameport Image 1 takes up to 10 references and edits in plain language, so a first illustration can anchor the style of the rest. Nano Banana Pro vs GPT Image 2.5 compares the first two in detail.

The models take five shapes: 1:1, 3:4, 4:3, 9:16 and 16:9. For exact pixels, such as a 1200 × 630 social card, generate the nearest shape and let the agent crop and resize the file with your usual tools. A request can ask for up to four images at once (n), each charged on its own; if one fails, only the others are billed.

Caps and one key per project

An agent that can generate can spend, so keep four guards in place:

  • Approve the paid calls. Cursor asks for approval before it uses an MCP tool unless you change that. Keep it for generate_image, generate_video and edit_video. In Auto-review mode, allowlist only the free, read-only tools: list_models, get_quote, get_generation, list_generations and get_balance, which the server marks as read-only.
  • Cap each request. Every tool that starts work takes max_cost_usd, and a request priced above it is refused before anything is held.
  • Retry without paying twice. The same tools take an idempotency_key: called again with the same key and the same fields, they return the first generation instead of a second charge.
  • Bound the balance. A key has no spending limit of its own; it spends from its workspace. To bound a project, give it a workspace of its own funded with a fixed amount, and check what is left with get_balance.

A project rule saves repeating this in every prompt. Cursor reads rules from .cursor/rules/*.mdc, or from an AGENTS.md at the root:

.cursor/rules/images.mdc
---
description: Making images and clips with the frameport MCP server
alwaysApply: true
---
- Call get_quote before generate_image or generate_video, tell me the price, and wait for my yes.
- Set max_cost_usd to the quoted price. Use a new idempotency_key per new image, the same one on a retry.
- Save files under public/images/ with names that say what they show. Never write the API key into a file.

A failed image costs nothing, and its hold goes back to the balance. The guide on image and video MCP servers lists every tool, and Claude Code image generation shows the same setup in a terminal agent. For what MCP is and why an agent needs it, see what an MCP server for image generation is. Sprites, icons and textures for a game are covered in the AI game assets generator API.

FAQ

Can Cursor do image generation?

Yes. Since version 2.4, Cursor's agent has a built-in image tool, which its changelog says uses Nano Banana Pro. An MCP server adds the rest: a choice among the catalog's image models, video clips, edits from reference pictures, a quote before each call and a cap per request.

How much does image generation in Cursor cost with an MCP server?

You pay per image from a prepaid balance, from $0.025 an image depending on the model; Nano Banana Pro costs $0.16. Quotes and reads are free, and a failed image is not charged. Your Cursor plan is separate.

Is there a Cursor image generation skill or extension to install?

No extension is needed: the MCP server is the tool, and a project rule tells the agent how to use it. Add the entry to mcp.json, then write the rule above so the agent quotes first and saves files where you want them.

Does the same server work in opencode or other editors?

Yes. Any client that connects to a remote MCP server over Streamable HTTP and sends a header works with the same URL and an Authorization: Bearer header. In opencode, add it as a remote server and read the key from the environment with {env:NAME}, as its docs show. The setup for Claude Desktop is in Claude image generation.

Can the Cursor agent see the images it makes?

Yes. A finished image comes back inside the tool's answer, and Cursor attaches it to the chat, so a model that reads images can check it against your request and ask for another take.

Start building.

Your API key is free. Top up from $10 when you are ready.