Unified Codex + Claude tutorial · media

How to merge video clips with Medux MCP

Learn to merge video clips with the Medux API through Codex or Claude MCP. Check inputs, tool calls, task status, and output.

Watch the complete workflow: merge video clips with Codex, Claude, MCP, and Medux. Watch on YouTube ↗
Choose your AI client

Follow the Codex or Claude workflow

The Medux operation and request fields are shared. Switch tabs for the client-specific prompt, approval pattern, screenshots, and walkthrough.

Codex-specific workflow

Run Merge Video Clips as a Codex MCP task

Use the active workspace as the source of truth. Ask Codex to identify the source video clips in the intended playback order, select the Medux video merge tool, and keep the Medux task ID and returned output with the rest of the project. Naming the input roles and the expected result prevents an agent from guessing which file should be used where.

Codex prompt pattern

In this workspace, use the Medux video merge tool through Medux MCP to merge video clips.
First inspect and identify the source video clips in the intended playback order.
Show me the exact tool arguments before execution.
After the task completes, return the merged MP4 and verify that every clip appears once in the correct order and the final video plays from start to finish.

Approval gate

Before approving the call, compare the selected tool, file or asset IDs, ordering, timing, and output settings with the request. If a local filename was mapped to an uploaded Medux file ID, keep that mapping visible so it can be audited later.

Result verification

Let Codex monitor an asynchronous task until it reaches a terminal state, then save or report the merged MP4. The final check is explicit: confirm that every clip appears once in the correct order and the final video plays from start to finish.

Before you start

Connect Medux to Codex

Make sure the Medux MCP server is available in Codex and your Medux credentials are configured.

Prepare the source clips

Place both MP4 files in the same workspace. Similar resolution, frame rate, codec, and audio settings help produce a cleaner join.

Merge two video clips in five steps

01

Describe the result in one prompt

Name the source files and ask Codex to use Medux. The tutorial starts with this focused request:

Use Medux to merge two video clips:
sample-clip-3s.mp4 and sample-clip-7s.mp4.
Codex prompt asking Medux to merge two MP4 video clips
Codex receives the two filenames and the desired output operation.
02

Let Codex inspect the workspace and request upload URLs

Codex confirms that both clips exist, identifies the Medux video merge tool, and requests temporary upload URLs and file IDs through MCP. Approve the Medux calls when Codex asks.

Codex requesting approval for the Medux file upload URL tool
Medux creates the temporary upload destination and asset identity for each clip.
03

Upload each MP4 to its signed URL

Codex uploads the local clips with curl. The real signed URLs are generated by Medux and expire, so do not hard-code them into a reusable script.

curl -sS -X PUT \
  -H "Content-Type: video/mp4" \
  --upload-file "./sample-clip-3s.mp4" \
  "SIGNED_UPLOAD_URL_FOR_CLIP_1"

curl -sS -X PUT \
  -H "Content-Type: video/mp4" \
  --upload-file "./sample-clip-7s.mp4" \
  "SIGNED_UPLOAD_URL_FOR_CLIP_2"
Responsive command blocks: long URLs and paths wrap at any point, so this page stays within the viewport on desktop and mobile.
Codex running curl commands to upload video clips to Medux
Codex can retry the upload if a signed storage path needs URL normalization.
04

Start the Medux merge task and monitor it

After both uploads succeed, Codex sends the two Medux file IDs in the intended order to the video merge tool. It keeps querying the same task until processing finishes.

Both uploads are complete.
Merge FILE_ID_1 followed by FILE_ID_2 with Medux,
then keep checking the task until the result is ready.
Medux video merge task queued and monitored by Codex
Codex monitors the queued Medux task instead of asking you to check it manually.
05

Download, preview, and verify the merged video

When Medux returns the result URL, Codex downloads the output as merged-sample-clips.mp4. The demo verifies a duration of 10.023220 seconds and a file size of approximately 9.2 MB.

Codex reports the merged video filename duration and size
Codex returns the local file and verification details.
Preview of the completed merged MP4 video
Preview the final MP4 and confirm clip order, transition timing, audio continuity, and playback quality.

Workflow at a glance

Describe the merge
Create upload URLs
Upload both clips
Run and monitor
Verify the MP4

Why use Codex, MCP, and Medux?

Codex handles the planning and coordination; MCP gives it a standard connection to Medux; Medux performs the media processing. You avoid building a custom upload interface, writing a dedicated API client, or switching between separate editing dashboards.

Result: one natural-language request becomes a repeatable video merge workflow and a verified MP4 output.

Frequently asked questions

Can Codex merge videos through MCP?

Yes. Once Medux is connected, Codex can create upload destinations, send the clips, start the merge task, poll its status, and download the finished MP4.

What should I check before merging clips?

Confirm the intended clip order and compare resolution, aspect ratio, frame rate, video codec, and audio settings. Similar source properties generally create a cleaner result.

What should I verify after the merge?

Check the clip order, transition point, total duration, audio continuity, playback quality, resolution, and output file size.

Continue with another practical Medux workflow for video, image, audio, or document processing.

Claude-specific workflow

Run Merge Video Clips as a Claude MCP workflow

Keep the goal, source assets, and constraints together in the conversation. Ask Claude to restate the source video clips in the intended playback order before proposing the Medux video merge tool. That context checkpoint makes the file roles and desired outcome easy to correct before any Medux call is approved.

Claude prompt pattern

Using the assets and requirements in this conversation, help me merge video clips with Medux MCP.
Restate which input fulfills each role: the source video clips in the intended playback order.
Propose the the Medux video merge tool call and summarize its arguments before asking for approval.
When it finishes, return the merged MP4 with a checklist confirming that every clip appears once in the correct order and the final video plays from start to finish.

Context checkpoint

Have Claude summarize the intended transformation, identify every source asset by role, and list the important constraints. Review that summary together with the proposed tool arguments; correct the conversation first if a file, order, time range, or setting is ambiguous.

Result verification

Keep the Medux task ID in the conversation while Claude checks progress. When processing ends, ask for the merged MP4 plus a concise validation checklist confirming that every clip appears once in the correct order and the final video plays from start to finish.

Before you start

Connect Medux through MCP

Make sure the Medux MCP connector is available in Claude and that your API credentials are configured.

Prepare compatible source clips

Place both MP4 files in an accessible local project folder. Using clips with compatible dimensions and codecs usually produces the cleanest transition.

Step-by-step workflow

01

Describe the merge task in one prompt

Tell Claude which files to combine and explicitly ask it to use Medux through MCP. In the recorded workflow, the two files are sample-clip-3s.mp4 and sample-clip-7s.mp4.

Use Medux to merge two video clips:
sample-clip-3s.mp4 and sample-clip-7s.mp4.
Upload the files using the curl command.
Prompt asking Claude to merge two video clips
Claude receives the file names and the expected upload method.
02

Let Claude inspect the files and choose the Medux tools

Claude checks that both clips exist, loads the Medux connector, and prepares signed upload URLs. This removes the need to manually search for endpoints or assemble the merge request yourself.

Claude inspects source clips and prepares upload URLs
Claude confirms the files and prepares the upload stage through Medux.
03

Upload each clip to the generated URL

Medux returns temporary signed URLs for the source files. Run the generated curl commands in your local terminal when the hosted Claude environment cannot directly reach the storage endpoint.

# The signed URL is generated by Medux and expires.
curl -X PUT   "SIGNED_UPLOAD_URL_FOR_CLIP_1"   -H "Content-Type: video/mp4"   --data-binary "@/path/to/sample-clip-3s.mp4"

curl -X PUT   "SIGNED_UPLOAD_URL_FOR_CLIP_2"   -H "Content-Type: video/mp4"   --data-binary "@/path/to/sample-clip-7s.mp4"
Page-width safe: the command block wraps long signed URLs and file paths, so it will not create horizontal overflow on desktop or mobile.
Claude provides curl commands for two signed upload URLs
When direct upload is blocked, Claude provides terminal-ready upload commands.
04

Confirm the uploads and start the merge

After both uploads succeed, tell Claude they are complete. Claude then submits the two uploaded asset URLs to the Medux video merge tool and begins monitoring the task.

Both uploads completed successfully.
Please start the Medux video merge task and keep checking until the result is ready.
Claude starts the Medux video merge task
The merge request is submitted after both source assets are available.
05

Open and review the merged output

When processing finishes, Medux returns the final video URL. Open the result, verify that the clips appear in the intended order, and check the transition point, audio continuity, duration, and playback quality.

Merged video result preview
Preview the final MP4 and confirm that both clips were joined correctly.

Workflow at a glance

Describe the task
Create upload URLs
Upload both clips
Run Medux merge
Preview the result

Why this workflow is useful

Claude handles the coordination while Medux handles the media processing. You keep the entire operation in one conversational workflow without building a custom upload interface, writing a dedicated API client, or switching between multiple dashboards.

Result: two source clips become one ready-to-use MP4 through a repeatable MCP workflow.

Quick answer

How do I merge video clips with Medux MCP?

Connect either Codex or Claude to Medux MCP, prepare the required inputs, review the proposed medux_merge_video call, and verify the returned result. The tabs above keep client-specific prompting on one canonical page.

Can I use the same Medux tool in Codex and Claude?

Yes. The client interaction differs, but both use the same Medux MCP tool and API request contract shown in this tutorial.

Related developer intent

Use AI agents to merge video clips

This tutorial addresses developer workflows for merge video API and combine video clips programmatically by making the task repeatable through the Medux API. Codex or Claude can prepare inputs, show the MCP tool arguments for approval, monitor processing, and return an output that can be checked against the original request.

This capability fits a broader AI video editing pipeline alongside video watermark removal, logo removal, object cleanup, resizing, and output validation for owned or authorized media.

Can Codex or Claude merge video clips through Medux MCP?

Yes. Use the client-specific tab above to prepare the inputs, review the Medux tool call, run the operation, and verify the returned result. The linked API reference remains the source of truth for supported fields and limits.

Production, trust, and developer intent

Apply rights-aware controls when you merge video clips

Use this as an authorized AI media processing workflow for merge video clips. Codex or Claude can expose the selected files, tool arguments, task status, and result checks, making the edit easier to review than an opaque one-click video operation.

Only process media you own or are permitted to modify. For production and commercial publishing, retain the source license or authorization, review the changed region, and record who approved the final output.

What should I verify before running an AI video editing API?

Verify ownership or permission, choose the operation that matches the requested edit, inspect the complete output, and keep the task record with the approved source file.