Blog/8 min read

MCP Server for AI Video Generation: Use agent-media in Claude Code and Cursor

The agent-media MCP server lets your AI coding assistant create UGC videos, browse actors, and check render status — without leaving your editor. Install it in Claude Code, Cursor, or Windsurf and generate videos with natural language.

What is MCP?

MCP stands for Model Context Protocol. It is an open standard that lets AI coding assistants — like Claude Code, Cursor, and Windsurf — use external tools. Instead of copy-pasting API keys and writing fetch calls, you install an MCP server and your AI assistant can call it directly. Think of it as a plugin system for AI tools.

When you install an MCP server, your assistant gets access to new capabilities. It can read the tool descriptions, understand the parameters, and call the tools on your behalf. You just describe what you want in plain English.

What is the agent-media MCP server?

The agent-media MCP server exposes three tools that let your AI assistant interact with the agent-media video generation API:

create_video

Generate a UGC video with a specific actor, script, and optional settings like subtitle style and duration.

list_actors

Browse all available AI actors with their names, genders, and preview images. Your assistant can help you pick the right one.

get_video_status

Check the status of a video render. Returns the current state (queued, processing, completed, failed) and the download URL when ready.

That is all you need. Three tools cover the full workflow: pick an actor, create a video, and poll until it is done.

How to install the MCP server

The MCP server is published as an npm package. You do not need to clone anything — your AI assistant downloads and runs it automatically via npx. All you need is your agent-media API key, which you can get from the settings page.

Claude Code

Add this to your ~/.claude/settings.json file:

{
  "mcpServers": {
    "agent-media": {
      "command": "npx",
      "args": ["-y", "@agentmedia/mcp-server"],
      "env": {
        "AGENT_MEDIA_API_KEY": "ma_YOUR_KEY"
      }
    }
  }
}

Cursor

Open Cursor Settings, go to MCP, click "Add new MCP server", and paste:

{
  "mcpServers": {
    "agent-media": {
      "command": "npx",
      "args": ["-y", "@agentmedia/mcp-server"],
      "env": {
        "AGENT_MEDIA_API_KEY": "ma_YOUR_KEY"
      }
    }
  }
}

Windsurf

Open Windsurf Settings, navigate to MCP configuration, and add:

{
  "mcpServers": {
    "agent-media": {
      "command": "npx",
      "args": ["-y", "@agentmedia/mcp-server"],
      "env": {
        "AGENT_MEDIA_API_KEY": "ma_YOUR_KEY"
      }
    }
  }
}

Replace ma_YOUR_KEY with your actual API key. Restart your editor after saving. The MCP server will start automatically when your AI assistant needs it.

Example: generate a video with one sentence

Once the MCP server is installed, you can ask your AI assistant to create videos in natural language. Here is a real example:

You:

"Make a 10-second UGC video about Postiz with actor sofia"

Here is what your AI assistant does behind the scenes:

  1. 1Calls list_actors. Finds the actor named "sofia" and confirms she is available.
  2. 2Writes a script. Generates a natural-sounding 10-second script about Postiz based on your prompt.
  3. 3Calls create_video. Sends the script, actor ID, and duration to the agent-media API. Returns a video ID.
  4. 4Polls get_video_status. Checks the render status every few seconds until the video is complete.
  5. 5Returns the URL. Gives you a direct download link to the finished MP4 file.

The entire process takes about 60 seconds. You type one sentence and get back a finished video. No API docs, no boilerplate code, no manual HTTP requests.

Assistant: I found actor "Sofia" (ID: sofia-01). Let me create the video.

Tool call: create_video(actor: "sofia-01", script: "...", duration: 10)

Tool call: get_video_status(id: "vid_abc123") → processing...

Tool call: get_video_status(id: "vid_abc123") → completed

Your video is ready: https://agent-media.ai/v/vid_abc123

Why MCP over the raw API?

agent-media has a full REST API. You can call it directly with fetch or curl. But the MCP server adds a layer that makes the workflow significantly better for developers who use AI assistants:

Natural language interface

Say "make a video about X with actor Y" instead of constructing JSON payloads and managing auth headers.

No boilerplate

The MCP server handles authentication, request formatting, error handling, and response parsing. You never write a single line of integration code.

Automatic polling

Your AI assistant polls get_video_status automatically and waits for the render to finish. No manual status checking.

Actor discovery

Ask your assistant to "list all female actors" or "find an actor that looks professional" and it will browse the catalog for you.

Context-aware scripts

Your assistant can read your project files, understand your product, and write video scripts that match your brand voice — all in one step.

Available tools reference

Here is the full list of tools exposed by the agent-media MCP server, with their parameters and descriptions.

ToolParametersDescription
create_videoactor, script, duration?, subtitle_style?Start a new video render with the specified actor and script. Returns a video ID for status polling.
list_actorsgender?, search?List all available AI actors. Optionally filter by gender or search by name.
get_video_statusvideo_idCheck the current render status. Returns state (queued, processing, completed, failed) and the download URL when done.

What developers are building with it

The MCP server is useful anywhere a developer wants to generate video content as part of their workflow:

  • *Generating product demo videos while building features
  • *Creating UGC ad variations for A/B testing campaigns
  • *Building video content pipelines in CI/CD
  • *Producing onboarding videos for new product features
  • *Generating changelog videos from git commit history
  • *Creating social media content batches from a spreadsheet of scripts

Start generating videos from your editor

Install the MCP server, get your API key, and create your first video in under a minute.

npx -y @agentmedia/mcp-server