VidMachine

VidMachine

MCP server

The VidMachine MCP server connects your account to AI assistants and coding agents that speak the Model Context Protocol — Claude Code, OpenAI Codex, Cursor, OpenCode, Hermes Agent, and other MCP clients. It uses the same API keys, credit balance, and business rules as the REST API, so anything you generate through an assistant is visible in your dashboard.

Endpoint

The server speaks JSON-RPC 2.0 over a single stateless HTTPS POST and returns JSON responses:
https://vidmachine.ai/api/mcp
Supported protocol revisions: 2026-07-28, 2025-11-25, 2025-06-18, 2025-03-26. Modern clients use server/discover and send their version and capabilities in per-request metadata; legacy clients use the initialize handshake. Both eras are served on the same endpoint.

Authentication

Authenticate with the same API key you use for the REST API, sent as a Bearer token. Create one under API & MCP (after login).
Authorization: Bearer vidm_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Set up a client

Let your agent set it upCopy the prompt and paste it into your agent. It reads the setup playbook, adds the server to itself, asks for your API key, and verifies the connection.
Or add it manually: in every case you provide the endpoint URL above and an Authorization: Bearer <key> header.
These examples use an API key header. Clients that can only start an OAuth flow — for example claude.ai and ChatGPT hosted connectors — need OAuth support. Use the API-key setup below with Claude Code, OpenCode, Cursor, Codex, Hermes, or another header-capable client.

Claude Code

Put your key in the environment, then register VidMachine as an HTTP MCP server. The single quotes keep your shell from expanding the variable, so the key is not written to the config in plaintext.
export VIDMACHINE_API_KEY=vidm_...
claude mcp add --transport http vidmachine \
  https://vidmachine.ai/api/mcp \
  --header 'Authorization: Bearer ${VIDMACHINE_API_KEY}'
Run claude mcp list to confirm it connected.

OpenCode

OpenCode V2 stores remote servers under mcp.servers. The CLI writes the entry for you; quote the {env:...} placeholder so the shell does not expand it.
export VIDMACHINE_API_KEY=vidm_...
opencode mcp add vidmachine \
  --url https://vidmachine.ai/api/mcp \
  --header 'Authorization: Bearer {env:VIDMACHINE_API_KEY}'
Run opencode mcp list to confirm it connected. The equivalent config entry is:
{
  "mcp": {
    "servers": {
      "vidmachine": {
        "type": "remote",
        "url": "https://vidmachine.ai/api/mcp",
        "oauth": false,
        "headers": { "Authorization": "Bearer {env:VIDMACHINE_API_KEY}" }
      }
    }
  }
}

Hermes Agent

Add a remote server under mcp_servers in ~/.hermes/config.yaml:
mcp_servers:
  vidmachine:
    url: "https://vidmachine.ai/api/mcp"
    headers:
      Authorization: "Bearer vidm_..."
Restart Hermes or run /reload-mcp to discover the VidMachine tools.

Project config (.mcp.json)

The same placeholder works in a project .mcp.json, which is the safer form when the file is committed.
{
  "mcpServers": {
    "vidmachine": {
      "type": "http",
      "url": "https://vidmachine.ai/api/mcp",
      "headers": { "Authorization": "Bearer ${VIDMACHINE_API_KEY}" }
    }
  }
}

Codex CLI

Add an entry to ~/.codex/config.toml. The bearer_token_env_var field names an environment variable that holds your key — it is not the key itself.
[mcp_servers.vidmachine]
url = "https://vidmachine.ai/api/mcp"
bearer_token_env_var = "VIDMACHINE_MCP_KEY"
export VIDMACHINE_MCP_KEY="vidm_..."   # raw key, no "Bearer " prefix
Open a new terminal and run codex mcp list to confirm.

Cursor and other clients

In Cursor, add an MCP server of type http with the URL above and an Authorization header, or reuse the .mcp.json entry. Any client that supports Streamable HTTP and a custom header works the same way.

Tools

28 tools in five groups, in the order you use them: find what's working, build, render, post, and the brand settings behind it. Your assistant reads each tool's input schema automatically, so you rarely need to know the argument names. Read tools never change anything; write tools act on your account and use credits where noted.

Find what's working

Read-only answers: what you have, what it costs, and how the product works.
  • search_documentation — Search the official docs and return matching pages with a snippet, path, and URL.
  • get_documentation — Read one docs page as markdown; omit the page to get the documentation index.
  • list_projects — List every project with its content types, model priorities, and schedule.
  • list_videos — List videos, filtered by project, status, limit, and offset.
  • get_video — Fetch one video with its status, progress, final URL, publish IDs, and credits used.
  • get_video_content — Read a video's script, screenplay scenes, cover, and final URL, plus pipeline_state and next_step. Call before editing.
  • list_models — Catalog of callable image and video models with inputs and credit pricing. Every video model returns audio; supports_audio_input only flags lip-sync audio input.
  • list_generations — List API generations, filtered by status and model.
  • get_generation — Poll one generation for its status, output URL, and credits charged.
  • get_credit_balance — Show the account's subscription, purchased, and free credit balance.
  • estimate_video_cost — Quote the credits still needed to finish a video. Read-only: prices only the missing stages and returns steps, total, balance, and next_step. Call before any paid step.

Build

Write the brief, the transcript, and the scene list.
  • create_project — Create a project; title is required, all other settings optional.
  • generate_ideas — Generate 10 video ideas for a project. Uses credits.
  • create_video — Create a standalone video draft from a prompt. Returns the ideaId for generate_video; does not use credits or start generation.
  • generate_transcript — Write the transcript with the LLM from the video's brief. Uses credits.
  • update_transcript — Save narration text you wrote yourself. Free; the response sets narrator_audio_stale when the saved voice-over was rendered from an older script.
  • generate_screenplay — Generate the scene list from the brief and narrator timings. Uses credits; for narrated projects generate_narrator_audio must run first.
  • replace_screenplay — Replace the whole scene list in one call. Free; use it for rewrites that change the scene count. Same validation as the dashboard.
  • update_scene — Edit one scene's prompt or text fields by 1-based number. Free; media is not regenerated, so regenerate the scene to pick up a new prompt.

Render

Turn scenes into media and assemble the final file.
  • generate_narrator_audio — Render the narrator voice-over from the saved transcript. Uses credits; must run before the screenplay for narrated projects.
  • generate_scene_media — Generate one scene's media — image, start_frame, or video. Paid and slow: a clip can take minutes, so do one scene per call.
  • generate_cover_prompt — Write the thumbnail prompt from the title, brief, and first scenes. Cheap LLM step; no image is rendered.
  • generate_cover_image — Render the thumbnail image. Pass reference_images with public image URLs to guide style or subject. Paid; pass force: true when the project has cover generation disabled, or enable it permanently with update_project generate_cover_photo: true.
  • generate_video — Start or resume the one-shot pipeline for an idea. Existing transcript, narrator audio, screenplay, and scene media are reused, so it is safe after editing the transcript. Uses credits.
  • export_video — Assemble the final video from the media that already exists. Asynchronous; it does not generate missing scene media.
  • create_generation — Queue any catalog model for image or video generation.

Post

Set the post time and status, then hand it to the scheduler.
  • update_video — Edit a video's title, status, post time, or cover. cover_photo_prompt and cover_photo_url are the thumbnail path. Same rules as the dashboard.

Brand

Project defaults that every video in the project inherits.
  • update_project — Update any subset of a project's settings. Set image_url to replace the reference image with a public image URL from your uploads. Set generate_cover_photo to enable thumbnails for the project (off by default; scheduled videos skip covers while it is false).
The documentation tools read the same markdown that backs /llms.txt and /llms-full.txt, so answers stay in sync with the published docs. They work without affecting credits.
Videos are built in stages: draft, transcript text, narrator audio, screenplay, scene media, thumbnail, then render. Call get_video_content before editing to read the real script, scenes, and thumbnail together with pipeline_state and next_step (the first missing stage), and estimate_video_cost to quote the credits those missing stages will cost before spending any. pipeline_state.narrator_audio_stale (also returned by update_transcript) is true when the saved voice-over was rendered from an older transcript — every narrator render stores a hash of the script it used, so whitespace-only edits do not count — and then generate_narrator_audio must run again before the screenplay. Write or rewrite the narration with update_transcript (free, model-written text) or generate_transcript (uses credits), then render the voice-over with generate_narrator_audio (uses credits). Write the scene list with generate_screenplay (uses credits; for narrated projects the voice-over must exist first), refine single scenes with update_scene (free — it only changes prompts and on-screen text, so regenerate the scene's media to pick up a new prompt), and rewrite the whole list with replace_screenplay when the scene count must change. Generate each scene's media with generate_scene_media (paid and slow — one scene per call, kind is image, start_frame, or video), then the thumbnail with generate_cover_prompt (cheap LLM step, no image is rendered) and generate_cover_image (paid; pass force: true when the project has cover generation disabled, or turn it on for good with update_project generate_cover_photo: true — that flag being off is also why scheduled videos arrive without a thumbnail). Finish with export_video, which assembles the media that already exists and returns immediately, or generate_video, which fills every remaining gap and then renders. generate_video resumes that pipeline and reuses whatever already exists — transcript, narrator audio, screenplay, scene media — so it is not all-or-nothing: edit the transcript, call it again, and only the missing stages run. For narrated projects the narrator audio must exist before the screenplay, because scene timing is derived from word-level TTS timings. Each stage uses credits, so review the script, scenes, and thumbnail first: a video in processing locks edits.

Errors

A missing or invalid API key returns HTTP 401 with a JSON-RPC error. Modern clients must send MCP-Protocol-Version, Mcp-Method, and Mcp-Name headers that match the JSON-RPC body; a mismatch returns 400. Tool failures return a result with isError: true and the same codes as the REST API: 402 insufficient credits, 404 not found, 409 edits locked while a video is generating, 429 too many generations in flight.

Credits

MCP usage draws on the same credit balance as your dashboard. Call get_credit_balance before a paid generation. create_generation charges only when the model succeeds and failed generations are free. Up to 10 queued or processing generations per account at a time. See Credits & billing.

Related

API reference — the REST API that the MCP tools call. AI models — the catalog returned by list_models. Programmatic overview.