MCP server for chat, image, video and voice tools in Claude Code and Cursor
The apillms MCP server exposes chat, image, video and voice generation as tools your agent can call directly — no separate SDK calls, no custom glue code. One server, ten tools, any MCP-capable client.
What MCP is and why it matters here
MCP (Model Context Protocol, modelcontextprotocol.io) lets an agent call external tools mid-conversation instead of only generating text. Normally, if you wanted an agent to also generate an image or a video, you'd have to write API calls, handle auth, and wire the response back into the conversation yourself. With an MCP server, the agent sees a list of tools with names and parameters, and can decide to call them on its own — "generate an image of X" becomes a tool call, not a custom script.
apillms runs that server at https://apillms.com/mcp, backed by the same account and the same single API key you already use for chat completions. There's nothing extra to provision.
The 10 tools
- chat — send a prompt to any text model
- list_models — list available chat models
- generate_image — generate an image from a prompt
- list_image_models — list available image models
- generate_video — generate a video from a prompt
- list_video_models — list available video models
- text_to_speech — turn text into audio
- list_voices — list available voices
- job_status — check the status of an async job (video generation)
- balance — check your account balance
This means an agent working in Claude Code, Claude Desktop, Cursor, or any other MCP-aware client can generate an image, kick off a video render, synthesize speech, or route a sub-task to a cheaper model — all without you writing any API code.
Step 1: register the server
In Claude Code, register the server with your API key in one command:
claude mcp add --transport http apillms https://apillms.com/mcp --header "Authorization: Bearer YOUR_KEY"
Replace YOUR_KEY with your apillms API key. There's exactly one key per account — no "create key" step, just Show or Roll it from /keys. If you roll your key (for example after rotating credentials), the old Authorization header stops working and you'll need to re-run the claude mcp add command with the new key, or edit the saved MCP config directly.
Other MCP-capable clients register the same way: point them at https://apillms.com/mcp and send the same Authorization: Bearer YOUR_KEY header. The exact config file or UI step differs per client — see the integration guides at /integrations, including the dedicated guide for Blender, which uses this same MCP pattern for its own tool server (3D scene control instead of chat/image/video).
Confirming the connection
Once added, ask the agent to list its tools, or just try a trivial call:
List your available MCP tools from the apillms server.
If the agent reports back all 10 tool names, the connection is live. If it reports a connection or auth error, double-check the header value — a missing Bearer prefix or a stale key are the most common causes.
Calling chat as a tool
Once connected, your agent can route sub-tasks to a specific model through the chat tool instead of using its own default model. Example prompt to the agent:
Use the apillms chat tool with model "deepseek-v4-flash" to summarize
this file in 3 bullet points, then show me the result.
This is useful when you want a cheap model for a mechanical sub-task (summarizing, extracting, formatting) while your main agent session keeps using a stronger model for the real work. Check list_models first if you're not sure which ids are live — the full set currently on sale includes claude-sonnet-5, claude-opus-5-5, gpt-5.5, deepseek-v4-flash, grok-4.6, kimi-k3 and others.
Cost depends on the model you pick. For a chat message of about 1,000 input and 500 output tokens, 1,000 such messages cost $0.14 on deepseek-v4-flash versus $2.24 on claude-sonnet-5 — worth factoring in if your agent calls chat frequently in a loop.
Generating images and video from a prompt
Image and video generation are exposed the same way. Example prompts:
Use list_image_models, pick "nano-banana", then generate_image with
prompt "a minimalist logo for a coffee roaster, flat vector style".
Use generate_video with model "veo3.1-lite", prompt "a drone shot
flying over a foggy forest at sunrise", duration 5s.
Image jobs return an estimated cost before running, and the final image lands in your media library. Credit costs vary by model and tier — nano-banana and nano-banana-pro run 22 credits per image at their cheapest tier, flux-2-pro and grok-image 32 credits, seedream-5-pro 81 credits. Ask list_image_models for the current id and credit cost before generating if you're optimizing for price.
Video is asynchronous and the credit range is wider: veo3.1-lite starts at 32 credits, veo3.1-fast at 51, kling-2.6 at 128, kling-o1-video at 276 credits. A render can take several minutes regardless of model, so don't expect the agent to return the finished video in the same turn.
Polling with job_status
For video, the agent starts the job with generate_video, gets back a job id, and should poll job_status until the job completes:
Start a video with generate_video, then call job_status every 30
seconds until it's done, and give me the final video URL.
If a video job fails, it's refunded automatically — you're not charged for a render that didn't produce output. Finished videos, images, and audio are kept in your media library for a limited time, so download what you want to keep instead of relying on the agent to re-fetch them later.
Voice as a tool
The text_to_speech tool converts text to audio using any voice from list_voices:
List voices, pick a neutral one, and use text_to_speech to read
this paragraph aloud.
Text-to-speech is billed at 12.73 credits per 1,000 characters, regardless of which voice you choose. At $5 for 1,000 credits (the Starter pack), that's roughly the same rate across your account whichever voice the agent picks — the cost driver is character count, not voice choice.
Checking balance from inside the agent
Since every tool call spends credits, it's worth letting the agent check balance before starting a batch job:
Call balance first. If I have less than 500 credits, warn me before
generating the video.
Credits never expire, so there's no urgency to spend them — but checking balance mid-session avoids a job failing partway through a longer agent workflow. Top up anytime from /billing with PayPal or card; packs run from Starter ($5, 1,000 credits) to Scale ($100, 23,000 credits).
Combining tools in one agent task
Because all 10 tools live on the same server and share one account, you can chain them in a single instruction without switching contexts:
1. Use chat with model "gpt-5.5" to write a 1-sentence product
tagline for a coffee roaster.
2. Use generate_image with nano-banana to create a logo matching
that tagline.
3. Use text_to_speech to read the tagline aloud.
4. Call balance and tell me what's left.
The agent decides which tool to call at each step based on the instruction — you don't have to manually copy outputs between separate API calls.
Troubleshooting
- Tool calls fail with an auth error — the header must be exactly
Authorization: Bearer YOUR_KEY; if you rolled your key on /keys, re-add the server with the new value. - generate_video never finishes — this is normal for longer or higher-resolution models; keep polling
job_status, since rendering can take several minutes. - Unsure which model id is current — always call the matching
list_*tool rather than hardcoding an id from memory, since the catalog changes. - Job failed but credits still look spent — check your payment history on /billing; failed video jobs are refunded automatically, and failed chat/image requests are not billed at all.
Why route multimedia through MCP instead of a UI
The Playground, Image studio, Video studio and Voice studio in the console are built for manual, one-off generation. MCP tools make the same models callable programmatically from inside an agent session — so a coding agent can generate a placeholder image for a UI mockup, or a research agent can synthesize a voice summary, without you switching tabs. For current model lists and prices across chat, image and video, see /models and /compare.
Takeaway
Register the apillms MCP server once with claude mcp add, and your agent gains 10 tools covering chat, image, video, voice, and account status. Use list_* tools to discover current model ids, generate_image/generate_video to produce media, job_status to poll long-running video jobs, and balance to keep an eye on spend — all without leaving the agent conversation.
Try apillms
One API key for Claude, GPT, Grok, DeepSeek and Kimi. OpenAI- and Anthropic-compatible, prompt caching included, pay-as-you-go from $5 with PayPal or card. Credits never expire.
FAQ
Does the MCP server work with clients other than Claude Code?
Yes — any MCP-capable client (Claude Desktop, Cursor, Cline, Continue, and others listed at /integrations) can connect to the same server URL and header.
How do I know when a video is ready?
Call the job_status tool with the job id returned by generate_video; poll it until the job reports completion, since rendering can take several minutes.
What happens if a video generation job fails?
Failed video jobs are refunded automatically, so you aren't charged for output that wasn't produced.
What do I do if MCP calls start failing after I roll my API key?
Re-run the claude mcp add command (or update your client's saved config) with the new key from /keys, since the old Authorization header stops working as soon as you roll it.