Adding AI Image Generation to Your Claude Code Workflow

Most Claude Code workflows are code-focused by definition. But image assets come up: marketing sites need graphics, internal tools need icons, documentation benefits from diagrams. When those needs arise, stepping outside your terminal session adds friction. With AgentPatch connected, Claude Code can handle image generation as part of the same workflow.

Why This Matters

The value isn’t just that Claude Code can call an image API. It’s that image generation becomes something you can include in broader tasks without context-switching. You’re already describing what you’re building to Claude Code — extending that to “and here’s the visual I need” is a natural fit.

AgentPatch provides access to Recraft image generation through MCP. Recraft is well-suited for practical development assets: clean illustrations, UI references, abstract graphics. Once connected, Claude Code uses it the same way it uses any other tool.

Setup

Install the AgentPatch CLI (zero dependencies, Python 3.10+):

pip install agentpatch

Set your API key:

export AGENTPATCH_API_KEY=your_api_key

Then use it:

ap search "web search"
ap run agentpatch google-search --input '{"query": "test"}'

Get your API key from the AgentPatch dashboard.

Run this command to add AgentPatch as an MCP server:

claude mcp add -s user --transport http agentpatch https://agentpatch.ai/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"

Replace YOUR_API_KEY with your actual key from the AgentPatch dashboard. Claude Code discovers all AgentPatch tools automatically.

Example

You’re setting up a new project and want to document the architecture. You ask Claude Code:

“Write a README section explaining our three-tier architecture, and generate a diagram illustration showing the frontend, API layer, and database with arrows between them.”

Claude Code writes the section and calls Recraft through AgentPatch to generate the diagram. You get both outputs in the same session. Claude Code can also write the image file to docs/architecture.png and link it from the README automatically.

Another example: you’re building a landing page and need a hero visual.

“We’re launching a developer CLI tool. Generate a hero image for the landing page — a terminal window with glowing green output, dark background, minimal and professional.”

Claude Code calls Recraft through AgentPatch and produces the image. If you want to iterate:

“Make the terminal larger in the frame and add a subtle gradient background instead of flat black.”

Claude Code calls the tool again. Your design iteration happens in the same place as your code work.

Wrapping Up

Image generation is one piece of what AgentPatch brings to Claude Code. Web search, news, maps, and email all live on the same connection. Tasks that used to require multiple tools now fit into a single session. See everything available at agentpatch.ai.