LivePositively

Letting Claude, Cursor or Codex Generate Images and Video Through an MCP Server

Sp

SpicyAPI Team


4 minutes

Long library hall with reading lamps on wooden tables

Organised workflows make agent output easier to review.

Coding assistants write code well, but teams increasingly want them to produce assets too, such as product photo variations or a short spinning-product clip. The Model Context Protocol (MCP) makes that possible without writing a custom integration for every assistant. This article explains what MCP is, what a media-generation server can do, and how to set one up with sensible cost controls.

What MCP is

MCP is an open protocol that lets an AI assistant call external tools in a standard way. An MCP server describes a list of tools (name, inputs, what each does). A client such as Claude, Cursor or Codex connects to the server, reads that list, and calls the tools when your request needs them. You write one server, and every MCP-capable client can use it.

For media generation, that means you can type "make three lighting variations of this product photo" in your editor and the assistant handles the model choice, the upload and the download.

What a media-generation MCP server can do

A useful server covers the whole job, not just the final call. The @spicyapi/mcp server from SpicyAPI exposes 15 tools that cover steps like these:

  1. Browse models: list image, video, audio and text models and read what each accepts.

  2. Get a price quote: ask what a specific request would cost before anything runs.

  3. Upload a file: send a source image, such as your product shot.

  4. Create a task: start the generation with the chosen model and parameters.

  5. Wait: poll until the task finishes, so the assistant does not guess.

  6. Download: save the result to your project folder.

Because every step is a tool, the assistant can chain them: find a suitable model, quote the price, show it to you, run the job, and save the files.

Why "confirm before every paid step" matters

An agent that can spend money needs guardrails. Left alone, an assistant might retry a failing request in a loop, pick the most expensive model because it sounds capable, or generate twenty variations when you wanted three. The sensible default is a confirmation prompt before each paid action. In this server, every paid step asks for confirmation first, and the quote tool lets the assistant tell you the price up front. You stay in control of spending while the assistant does the repetitive work.

Prices are also shown before a run starts, and write requests support idempotency keys, so a retried request is not charged twice.

Setup walkthrough

The steps are short. Check the SpicyAPI documentation for the exact, current instructions, since client configuration formats change between versions.

  1. Create an account and an API key. Top up a small prepaid balance; pricing is pay-per-request in US dollars with no subscription.

  2. Keep the key out of your repository. The server reads it from the SPICY_API_KEY environment variable, so put it in your MCP client's configuration rather than in files that get committed. The server runs on Node.js 22.13 or later and is started with npx.

  3. Add the server to your MCP client's configuration. For Claude Desktop the entry looks like this:

{
  "mcpServers": {
    "spicyapi": {
      "command": "npx",
      "args": ["--yes", "--package=@spicyapi/mcp", "spicyapi-mcp"],
      "env": { "SPICY_API_KEY": "YOUR_SPICY_API_KEY" }
    }
  }
}

Cursor, Codex and other clients use the same command and variable, but each keeps its configuration in a different place; the documentation lists them.

  1. Restart the client and ask it to list the available tools. If you see the browsing, quote, upload and task tools, you are connected.

Example requests

Product photo variations. "Upload mug.png, find an image-editing model that accepts a reference image, and quote three variations: warm window light, soft studio backdrop, and a wooden table at golden hour. Ask me before running anything."

The assistant should upload the file, pick a model, report the total, and wait for your approval. When approved, it creates the tasks, waits, and saves three files into assets/mug/.

A five-second product spin. "Take mug-hero.png and make a 5-second image-to-video clip with a slow 360-degree turntable rotation, neutral gray background, steady lighting. Quote at 720p first."

For scale: at the time of writing (October 2026), Wan 3.0 image-to-video is listed at $0.09 per second at 720p, so a 5-second clip is about $0.45. Z-Image Turbo text-to-image starts from $0.01 per image, which makes it handy for quick concept drafts.

Cost control tips

  • Quote first, always. Make "show me the price" part of your standing instructions to the assistant.

  • Draft small. Use the lowest resolution and shortest duration for exploration, then re-run only the approved ones at final quality.

  • Set a cap in the prompt. "Stop and ask if the total exceeds $2" is a simple guard that agents follow well.

  • Limit batch size. Request three variations, review them, then ask for more.

  • Download promptly. Results are stored for up to 14 days, and download links are signed, so save what you need into your repository or asset folder.

Where to go next

For fully automated pipelines, the SDKs (TypeScript, Python, Go, PHP and Java) and the CLI cover the same ground. Start with one small task, watch each step, and tighten your instructions until the loop feels predictable.


Read This Next