How to make a video from the terminal
One command in Claude Code, or two lines in Codex's config, and your CLI drafts videos you can render to MP4 without opening an editor.
If you already live in a terminal, the round trip through a video app is the slow part. Claude Code and the OpenAI Codex CLI both speak the Model Context Protocol natively, which means a video toolset is one registration away and then it is just something your agent can do — in the same session, in the same repo, alongside everything else.
This is the CLI-specific path. The workflow is the same one the general agent guide covers, but the setup, the scoping, and the render loop all look different from a terminal, and those differences are where people get stuck.
Register the server
Claude Code takes one command: claude mcp add --transport http motion-text https://motiontext.video/mcp. The Codex CLI takes a two-line entry in ~/.codex/config.toml with a url key, which is what tells it to use Streamable HTTP rather than a stdio bridge. Neither needs a key for anonymous drafting.
Scope it to a repo, or globally
Claude Code writes to your global config by default; add --scope project to write a committable .mcp.json in the current repository instead, which shares the connector with everyone who clones it. Codex reads ~/.codex/config.toml globally or .codex/config.toml inside a trusted project folder.
Confirm it connected
Run claude mcp list or codex mcp list. You want the server listed and its tools resolvable. A server that registers but never resolves tools is almost always a URL typo or a proxy stripping the connection.
Ask for the video
Describe it in plain language in your normal session: the script or lyrics with one beat per line, a mood, a length, a format. The agent calls the tools and replies with an edit link.
Add the studio endpoint for renders
Anonymous drafting cannot render. Register https://motiontext.video/mcp/studio as a second server and your CLI opens a browser sign-in the first time it is used. Signed in on Pro, the agent can queue a 1080p or 4K server render and poll the job until it returns a download link — no editor, no browser tab.
Pull the file
The render job resolves to a download URL. From there it is curl, or wget, or whatever already moves files around in your workflow.
Claude Code and Codex, side by side
The two CLIs differ mainly in whether registration is a command or a file. Claude Code manages MCP config for you; Codex expects you to write the entry. Both connect to the same endpoint and expose the same tools once they are up.
Claude Code — one command per endpoint:
claude mcp add --transport http motion-text https://motiontext.video/mcp
claude mcp add --transport http motion-text-studio https://motiontext.video/mcp/studio
claude mcp listThe Codex config entry
Codex reads ~/.codex/config.toml globally, or .codex/config.toml inside a folder you have marked trusted. The presence of a url key is what selects Streamable HTTP; there is no command, no args, and no mcp-remote bridge involved. For the studio endpoint Codex handles the OAuth sign-in itself, or you can point bearer_token_env_var at a static token if you would rather keep it in the environment.
~/.codex/config.toml:
[mcp_servers.motion-text]
url = "https://motiontext.video/mcp"
[mcp_servers.motion-text-studio]
url = "https://motiontext.video/mcp/studio"Scripting it without an agent
For anything that should run unattended — a build step, a cron job, a release script — you do not want an agent in the loop at all. The same drafting capability is a plain HTTP endpoint. POST JSON to /api/drafts and you get a draft link back; GET /api/spec returns the schema and the current limits, so a script can check what it is allowed to ask for rather than guessing.
That is the right shape for the repeatable cases: a weekly changelog video built from the same template, a release note turned into a clip, a batch of quote videos from a file of lines. The agent is genuinely useful for one-off creative work and unnecessary overhead for a job you have already specified.
Questions
Can I really render an MP4 without opening a browser?
Once, for sign-in. The studio endpoint needs an authenticated account, and your CLI opens a browser for that the first time. After that, on a Pro account, the agent queues the render and polls it to a download link entirely from the terminal.
Why does Codex need a url key specifically?
It is how Codex distinguishes a remote Streamable HTTP server from a local stdio one. An entry with a url connects directly; without it Codex expects a command to spawn. This is the most common reason a Codex entry silently fails.
Can I commit the connector so my team gets it?
In Claude Code, yes — add --scope project and the server is written to .mcp.json in the repository. Codex has the equivalent in a .codex/config.toml inside a trusted project folder.
Does this work in CI?
The anonymous drafting endpoint does, and the plain HTTP endpoint is a better fit there than MCP anyway. The studio endpoint needs an interactive sign-in or a bearer token in the environment, which is what bearer_token_env_var is for.
Does the agent upload my audio?
No. Media stays out of the agent path entirely; audio and images are added in the editor. The agent works on structure — scenes, timing, captions, styling.