# Add video to your app with Claude Code or Cursor

> Install the Chunkify skill and connect Chunkify MCP so your coding agent adds video uploads and playback to your application, then manages your videos from chat.

This guide sets up Claude Code, Cursor, or Codex so the agent adds uploads and playback to your application, and so you can ask it about your videos afterwards: create a video asset, add captions, check why a webhook failed, or read last week's watch time.

You need:

- A Chunkify account and a Project.
- Your application open in a coding agent that supports MCP.
- For ongoing playback, your own [storage and CDN connected to the Project](/docs/storage). To try the flow first, Chunkify temporary storage works without a bucket; files stored there are deleted after 24 hours.

## Two pieces: the skill and the MCP connection

The setup has two parts, and each does a different job.

**The skill** is a set of instructions your agent reads before it writes code. It tells the agent how to inspect your application, which SDK and components to use, how to handle webhooks, and what to verify before it calls the work done. It lives in your project as a `SKILL.md` file with four reference files.

**The MCP connection** gives the agent access to your Chunkify Projects. You connect it once with OAuth, choose the Projects it can use, and the agent can then read and manage resources in them. The same connection also covers playback analytics for those Projects.

You can use MCP on its own to manage videos from chat. The skill is what guides an integration into your codebase.

## Install the skill

Open your application in your coding agent and use the installation prompt for that agent:

<tabs>
    <tab title="Claude Code">
        Ask Claude Code to install the skill in your project:

        <agentprompt title="Install in Claude Code" agents="Claude" prompt="Install the Chunkify skill from https://chunkify.dev/SKILL.md
        in .claude/skills/chunkify/ in this project.
        Include its linked reference files and keep their references/ directory structure."></agentprompt>

        Start your request with `/chunkify` to use the installed skill. See [Claude Code skills](https://code.claude.com/docs/en/skills) for other installation locations.
    </tab>
    <tab title="Codex">
        Ask Codex to install the skill in your project:

        <agentprompt title="Install in Codex" agents="Codex" prompt="Install the Chunkify skill from https://chunkify.dev/SKILL.md
        in .agents/skills/chunkify/ in this project.
        Include its linked reference files and keep their references/ directory structure."></agentprompt>

        Mention `$chunkify` in your request to use the installed skill. See [Codex skills](https://learn.chatgpt.com/docs/build-skills) for other installation locations.
    </tab>
</tabs>

Both agents use the same skill files. Cursor and other coding agents that support Agent Skills may use a different installation directory, so follow your agent's skill setup instructions.

## Connect Chunkify MCP

Connect your agent to `https://api.chunkify.dev/mcp` using OAuth.

In Claude Code, run this from your application's directory, then use the `/mcp` command to authenticate:

```sh
claude mcp add --transport http --scope local chunkify https://api.chunkify.dev/mcp
```

In Codex:

```sh
codex mcp add chunkify --url https://api.chunkify.dev/mcp
codex mcp login chunkify
```

In Cursor or another MCP client, add the same URL as a custom MCP server in the client's settings and choose OAuth.

You can also ask the agent to do the registration:

<agentprompt title="Install Chunkify MCP" prompt="Use the skill at https://chunkify.dev/SKILL.md to install Chunkify MCP."></agentprompt>

When the agent opens the authorization page, sign in to Chunkify and select the Projects it can access. The agent cannot complete the login or consent for you.

Each Project you select lets the agent read and manage that Project's Assets, uploads, workflows, webhooks, analytics, and your Project API tokens. Team key management is a separate switch that is off by default. Leave it off unless your integration needs team API operations.

To confirm the connection works, ask the agent to list the Projects it is authorized to use.

## Ask for uploads and playback

With both pieces in place, describe the flow you want:

<agentprompt title="Add uploads and playback" agents="Codex, Claude" prompt="Use the Chunkify skill to add video uploads and on-demand playback to this application.
Use my Project's configured storage and CDN, and keep the existing UI and authorization.
Handle playback readiness through verified webhooks and save playback URLs with our video records."></agentprompt>

Here is what the agent does with that request:

1. **Inspects your application.** It identifies your language, frameworks, routes, database models, authorization hooks, and UI components, and explains which files and fields must change.
2. **Sets up server credentials.** Your server needs a Project API token. The agent can create one through MCP and save it privately as `CHUNKIFY_PROJECT_TOKEN`, or reuse a working one.
3. **Creates Upload sessions on your server.** A route in your application calls Chunkify with the official SDK for your language and returns only the session fields the browser needs.
4. **Adds the uploader.** The [`@chunkify/uploader`](/docs/integration/uploader) component handles file selection, the transfer, progress, retries, and completion.
5. **Adds a webhook handler.** It verifies each request with the SDK using `CHUNKIFY_WEBHOOK_SECRET`, then updates your video record when the stream becomes playable or processing fails.
6. **Saves playback URLs.** The playback, poster, and timeline preview URLs are stored with your video records, so normal page views do not call Chunkify.
7. **Adds playback.** For a new playback UI it uses the [`@chunkify/player`](/docs/integration/player) component, styled to match your application.

To test the webhook route on your machine, the agent can run `npx -y @chunkify/cli@latest listen`, which [forwards Chunkify events to your local server](/docs/cli/integration).

Expect the agent to ask you to perform one real upload. The skill does not treat the integration as complete until a video has gone from upload to playback.

## What you can ask once connected

The connection stays useful after the integration ships. Most of these prompts come from the [Chunkify MCP prompt library](/products/mcp); replace the titles with your own videos.

- **"Create a video asset from https://example.com/path/to/video.mp4 and tell me when it is playable."** The agent adds the hosted file as a source, creates the asset, and reports its status.
- **"Add captions to the launch film in its original language."** It checks for an existing caption track, requests one, and confirms when it is ready.
- **"Build a workflow that captions a video and translates that track into French and Spanish."** It creates a workflow that runs those steps for each video.
- **"Make a downloadable 720p MP4 of Along the Coast."** It requests the rendition and returns the file details.
- **"The launch film plays, but our app still says processing. Did our webhook get the event?"** It finds the event and inspects the delivery attempts and your endpoint's responses.
- **"Which videos earned the most watch time last week?"** It finds the Project's saved analytics server and ranks videos by watch time.
- **"Export last weekend's daily views as a CSV I can share with the team."** It creates an export link. Keep that link private.

The analytics questions need an analytics server saved on the Project and a player that sends events to it. Reports go through the same OAuth connection, with no extra key. For an AI client that only reads analytics, the Analytics Server has its own [read-only MCP endpoint](/docs/integration/analytics/server/mcp) that uses a private MCP key.

## What the agent can and cannot do

**Access is limited to what you approve.** The agent works only in the Projects you selected. New Projects are not added automatically; disconnect and reconnect to change the selection. You can review access or disconnect the agent in **Account → Connected apps**.

**Tools can change things and cost money.** The agent can create, modify, and delete resources in the selected Projects, and writes can incur processing charges. The skill has the agent get your approval before deleting resources.

**Tokens stay out of the conversation.** Keep tokens and webhook secrets out of chat, tracked files, and browser code. The agent saves a new token directly to your private server configuration. If it falls back to the CLI, it checks for a saved token with `chunkify config token`, which shows only a masked suffix, and asks you to save a token yourself if none exists.

**Application tokens outlive the connection.** Tokens created through MCP keep working after you disconnect the assistant. Revoke them separately to stop applications that use them.

**Your storage and CDN are not rebuilt.** The agent uses the storage and CDN already configured on your Project. It does not create buckets, CDN distributions, DNS records, or certificates unless you ask.

**CORS changes need your approval.** Browser uploads to your bucket and playback from your CDN need a CORS policy. The agent reads the current policy, shows you the full merged policy and the exact change, and asks before replacing it.

## Frequently asked questions

### Does this work with Codex or other MCP clients?

Yes. The skill has installation prompts for Codex and Claude Code, and other agents that support Agent Skills can install the same files in their own directory. Other MCP clients connect to `https://api.chunkify.dev/mcp` with OAuth.

### Can the agent see my videos?

It can read and manage the resources in the Projects you select on the authorization page, including Assets, uploads, and analytics. It cannot reach Projects you left unselected.

### What does it cost?

Preparing a 1080p video for streaming costs $0.03 per input minute on Pay as you go and $0.02 on Team. Your storage and CDN providers bill storage and delivery themselves. Transferring outputs to Amazon S3 is free; transfers to Cloudflare R2 or other S3-compatible storage use a monthly allowance, then cost $0.09 per GiB. New accounts on Pay as you go receive $10 in welcome credit after verifying a card. See [pricing](/pricing/) for plans and the cost calculator.

## Next steps

- Read the [agent guide](/docs/integration/chunkify-skill) for the skill's setup details and more example prompts.
- Browse the prompt library on the [Chunkify MCP page](/products/mcp).
- Follow the [video streaming quickstart](/docs/video-streaming/quickstart) to see the API calls the agent makes on your behalf.
