How to Generate Images, Video and Music Inside Claude Code (MCP Guide)
Your coding assistant can write a landing page in seconds. Then you need a hero image for it, and everything stops: you open a browser tab, log into a separate image tool, write a prompt, download a file, drag it into the repo, fix the path. The assistant that just wrote 200 lines of React sits there and watches.
That gap closes with MCP. This guide shows you how to connect Claude Code, Cursor or Cline to image, video and music models so you can ask for a hero image the same way you ask for a function โ and get the file back without leaving your editor.
Setup takes about five minutes and one line of configuration.
What MCP actually does
Model Context Protocol is an open standard for giving AI assistants abilities they do not have natively. Your assistant is a language model: it is excellent at text and cannot render a pixel. Image, video and music generation need entirely different models.
MCP is the wiring between them. An MCP server publishes a list of tools, your assistant reads that list, and from then on it can call them. You do not write glue code, you do not manage a second SDK, and you do not switch apps.
The practical difference: instead of "write me the CSS for a hero section" and then doing the image yourself, you say "build a hero section and generate a matching background image, 16:9" โ one instruction, one result.
What you can do once it is connected
CCAPI's MCP server publishes eleven tools. In practice they cover five jobs:
- Images โ generate from a prompt, edit an existing image, or upscale one 2ร
- Video โ text-to-video and image-to-video, 4โ15 second clips
- Music โ full songs with vocals or instrumental, plus lyrics on their own
- Text โ call a different model for a second opinion, or run a cheap model over bulk work
- Discovery โ list what your key can use, and check your balance
Every one is driven in plain English. You never type a model name unless you want a specific one.
Step 1: Get an API key
- Sign up at ccapi.ai โ Google login works
- Go to Console โ Tokens and click Create token
- Give it a name like
my-laptop-mcp, leave the rest as-is, click Submit - Copy the key โ it starts with
sk-and is shown only once
Then add a small amount of credit under Console โ Top Up. Five dollars covers plenty of experimenting; images are cents, short videos more.
Treat the key like a password. Anyone holding it can spend your balance. If it leaks, delete it from the Tokens page โ that kills it immediately.
Step 2: Connect your editor
Pick the one you use. You only need one.
Claude Code
One line in your terminal:
claude mcp add --transport http ccapi https://api.ccapi.ai/mcp \
--header "Authorization: Bearer sk-YOUR-KEY"
Confirm it worked with claude mcp list.
Cursor
Open Settings โ MCP โ Add new MCP server, then paste:
{
"mcpServers": {
"ccapi": {
"type": "http",
"url": "https://api.ccapi.ai/mcp",
"headers": { "Authorization": "Bearer sk-YOUR-KEY" }
}
}
}
Save and restart Cursor.
Cline / Roo Code
Same JSON in cline_mcp_settings.json, with "type": "streamableHttp".
Anything else
Windsurf, Zed and most other MCP clients take the same three values: transport http, URL
https://api.ccapi.ai/mcp, and an Authorization: Bearer sk-... header.
There is nothing to install. The MCP server runs as part of the API gateway, so there is no local process, no npx package, and no second credential to rotate.
Step 3: Use it
Ask in normal language:
Generate an image of a red bicycle leaning on a whitewashed wall in morning light.
Now make the bicycle blue.
Make a 5-second vertical video of a paper plane gliding over a city at dusk.
Write lyrics about a night train, show them to me, and if I approve turn them into a song.
What's my CCAPI balance?
The assistant picks the tool, picks a sensible model, and hands back a URL.
Keep the tool list short
More tools mean worse tool selection โ a model choosing from eleven options is less reliable than one choosing from four. If you only ever generate images, mount only the image tools:
| Endpoint | What it publishes |
|---|---|
https://api.ccapi.ai/mcp |
everything |
https://api.ccapi.ai/mcp/image |
image generation, editing, upscaling |
https://api.ccapi.ai/mcp/video |
video generation |
https://api.ccapi.ai/mcp/music |
songs and lyrics |
https://api.ccapi.ai/mcp/text |
text models |
Each scoped endpoint still includes model lookup, balance and task polling, because nothing works without those. Mount two if you want two โ they compose.
Video and music are asynchronous, and that is fine
A video takes 30โ180 seconds and a song 30โ120. That is longer than most editors will hold a single tool call open, so those tools return a task ID and your assistant checks back until it is done.
You do not have to manage any of that. But it explains something you will otherwise find confusing: your assistant may say "I've submitted the video, let me check on it" and pause. That is the system working correctly, not a hang.
If your editor does give up waiting, just say "check on that video task". The job keeps running server-side regardless of what your editor did.
Things that will save you money
Every generation costs real credit. Model lookup, balance checks and task polling are free โ generation is not, and the MCP path is billed identically to a direct API call. There is no separate pricing tier and no discount.
Watch the first few sessions. Assistants retry on failure by default. A prompt that fails for a structural reason โ wrong model name, insufficient balance โ can be retried several times before the assistant gives up. Error messages here are written to tell the model when retrying is pointless, but it is worth watching until you trust it.
Ask before a batch. "Check my balance" costs nothing and takes a second.
Do not hardcode model names. Ask "what image models can I use?". Availability depends on your account and changes as models ship and retire, and a guessed name is a failed call you may still be charged for if the upstream started work.
A worked example: og:images for a whole site
Here is the kind of job that is tedious enough that most people skip it.
You have a marketing site with fourteen pages. None of them have a proper og:image, so every link
shared on Slack, X or LinkedIn renders as a grey box. Doing this by hand means fourteen trips
through an image tool, fourteen downloads, fourteen file renames, and a meta tag edit on each page.
With image generation available in the editor, it is one instruction:
Read the
<title>and meta description of every page undersrc/pages/. For each one, generate a 1536ร1024 og:image in a consistent flat-illustration style with a dark navy background, save it topublic/og/<page-slug>.png, and add theog:imagemeta tag pointing at it.
The assistant already knows how to read the files, derive slugs and edit the meta tags โ that is ordinary work for it. The only missing capability was making the pictures. Once that is wired in, the whole task collapses into a single pass.
The same shape applies to product-card images from a CSV, placeholder art for a design system, or regenerating every asset in a directory after a rebrand. The win is not the seconds saved per image. It is that jobs which were previously not worth doing become one sentence.
When something goes wrong
The tools do not appear. Restart the editor completely โ most clients read MCP config only at
startup. If they still do not appear, check the config file has "type": "http"; an entry with a
url but no type is silently treated as a local command and skipped.
"Unauthorized" or "invalid key". Usually a truncated paste. The key must include the sk-
prefix and have no trailing space. Generate a fresh one if you are unsure.
"Insufficient quota". Out of credit. Top up; retrying will not help, and a well-behaved assistant should tell you exactly that rather than looping.
"No available channel for model X". That model is not reachable from your account right now. Ask "list the models I can use" and choose from what comes back.
A video call seems to hang. Expected โ see the asynchronous section above. Ask the assistant to check the task again.
Frequently asked questions
Do I need to install anything? No. The MCP server is part of the API gateway. You add a URL and a key.
Does this work with ChatGPT / other assistants? Any client that supports MCP over HTTP transport works. That currently includes Claude Code, Cursor, Cline, Roo Code, Windsurf and Zed. Clients that only support stdio transport need a local bridge, which is not published yet.
Is MCP more expensive than calling the API directly? No. A tool call re-enters the same pipeline as an HTTP request โ same pricing, same routing, same usage logs. Your dashboard cannot tell the two apart.
Can I use my existing API key? Yes. It is the same key you would use for REST calls. No separate MCP credential.
What happens if my key leaks? Delete it from Console โ Tokens. It stops working immediately. Create a new one and update your config.
Can I restrict which models it can reach? Yes โ a token can be pinned to a specific group, and the model list your assistant sees is filtered to what that token can actually call. It will not be offered models it cannot use.
Where this actually helps
The obvious use is assets during development: hero images, og:image files, placeholder art, icon sets. Those are real, and they remove a context switch that costs more attention than time.
The less obvious use is bulk work. An assistant that can generate images in a loop can produce forty product-card images from a CSV, or regenerate every og:image in a site after a rebrand, in a single instruction. That is not a five-minute-saved task โ it is a task most people simply never do because the manual version is unbearable.
Video and music are earlier in that curve, but the same logic applies: the cost of trying a thing drops to one sentence.
Get started
- Create an account and generate a key
- Paste the config line for your editor
- Ask it to make you something
The API reference covers every endpoint behind these tools if you want to call them directly instead. If something does not work, email support@ccapi.ai with the exact error text and we will tell you what went wrong.