# Generate videos with OpenAI Codex

> Connect the Motionvid MCP server to OpenAI Codex with one command and generate motion graphics videos from your prompts and your code.

Add Motionvid with codex mcp add, sign in once, and Codex can make and deliver videos as part of any task.

## Set it up

`~/.codex/config.toml`

```
[mcp_servers.motionvid]
url = "https://motionvid.ai/mcp"
```

1. Run: codex mcp add motionvid --url https://motionvid.ai/mcp
2. Sign in: codex mcp login motionvid
3. Ask Codex for a video.

Headless: add bearer_token_env_var = "MOTIONVID_API_KEY" under the url and export that variable. Codex takes the name of the env var, not the key itself.

## Example prompts

- "Make a 30 second explainer of our API for the docs homepage and save it to ./public."
- "Make a 30 second explainer on how compound interest works, with voiceover and music."
- "Turn https://yourapp.com into a 20 second vertical launch ad that ends on our logo."
- "Make a 15 second animated bar chart of these numbers: 2023 1.2M, 2024 2.9M, 2025 6.4M."

## Tips

- Install the skill (npx skills add tolypash/motionvid-agent) so Codex follows the same steps every time.
- Headless: set bearer_token_env_var = "MOTIONVID_API_KEY" in ~/.codex/config.toml and export the key.
- Codex takes the name of the env var, not the key itself.
- Ask for the preview frames before the render to catch wording changes early.

## Questions and troubleshooting

### Can Codex make videos?

Yes, with the Motionvid MCP server Codex can generate a video from a prompt, check its progress and download the finished MP4.

### It says I need to sign in, or the tools are missing

The server is added but not signed in. Run the sign-in step again and log in with your Motionvid account. The connector needs a paid plan; on a free account the tools answer with an upgrade message.

### The video is taking a while

That's normal. A build writes the script, animates each scene and records the voiceover, usually a few minutes. Ask the agent to check the status again rather than starting a new video.

## More

- All agents: https://motionvid.ai/agents.md
- Skill: https://motionvid.ai/SKILL.md
