How to generate images in Claude Code
Claude Code writes the page, the component and the copy, but it can't draw the hero image. Connect the Magnt MCP server and it can: one command adds a generate_image tool, and every result comes with a download link Claude can save straight into your project.
Key takeaways
- 01Run claude mcp add --transport http magnt https://magnt.app/mcp.
- 02Run /mcp inside Claude Code and sign in with your Magnt account.
- 03Ask for the image and where to save it. Claude downloads the result into your project.
- 04Each image costs 1 credit. Results stay available for 24 hours.
Add the server
Magnt runs a remote MCP server at magnt.app/mcp, so there is nothing to install. Add it once from your terminal. Add --scope user if you want Magnt in every project rather than just the current one.
Next, start Claude Code, run /mcp, pick magnt and choose to authenticate. A browser window opens, you sign in to Magnt, and Claude Code stores the sign-in. If you would rather use an API key, create one at magnt.app/developers and add it with --header "Authorization: Bearer YOUR_KEY" instead.
claude mcp add --transport http magnt https://magnt.app/mcp --scope userAsk for an image like you would ask a designer
Claude decides when to call the tool, so you can ask in plain words. Say what the picture shows, the light, the framing and the aspect ratio, and say where the file should go. Claude writes the prompt, calls generate_image and shows you the result in the conversation.
Be specific about the destination. A hero banner wants 16:9 with calm space for a headline. A product card wants 1:1 with a clean background. An Open Graph image wants a wide composition with the subject away from the edges, because social sites crop it.
Make a 16:9 hero image for this landing page: a sunny kitchen
windowsill with basil, mint and rosemary in terracotta pots,
soft morning light, calm space on the right for the headline.
Save it to public/hero.webp and use it in the Hero component.How the file ends up in your project
Every result comes back three ways: the image itself, so Claude can look at it; an image_id; and a download link that works for 24 hours. Claude saves the file by downloading the link with a normal shell command, so the image lands wherever you asked, under the name you chose.
Want changes? Ask for them. Claude passes the image_id back to generate_image with the new instructions, so it edits the picture you liked instead of starting again. Say what should change and what should stay, for example: keep the pots and the light, but make the wall pale green.
Costs, limits and privacy
Each image spends 1 credit from your Magnt plan, the same credits you use in the app, whether it is a new picture or an edit. Each account can make 30 images an hour. Claude can call get_credit_balance to check what is left before making a batch.
Results are kept for 24 hours so Claude can download or edit them, then the links stop working and the files are deleted. Prompts and the photos you attach are not stored. Keep anything you want in your project or your own storage.
Check the image before you ship it
Claude is quick at writing prompts and slower at spotting what went wrong in a picture. Open the file before you commit it. Look for warped hands, stray lettering, extra objects and anything that contradicts the brief, and make sure the crop still works at mobile width.
Write the alt text after you have looked at the final image, not from the prompt. The prompt describes what you asked for; the alt text should describe what is actually there.


