Cover for YouTube MCP: Upload from Claude Code, Codex, Muse and More

YouTube MCP: Upload from Claude Code, Codex, Muse and More

Upload and schedule YouTube videos from Claude Code, Cursor or Codex with an MCP server: title, description, tags, privacy and a custom thumbnail.

Nov 8, 20265 min readAlexandroAlexandro
Table of Contents

You can upload a video to YouTube straight from Claude Code, Cursor, Codex or another agent like Muse or OpenClaw with a YouTube MCP server. Connect your channel in PublishQ, add the server, and tell your agent which file to upload and what to call it:

claude mcp add --transport http publishq https://publishq.com/mcp

It sets the title, description, tags, privacy and even a custom thumbnail in one call. One tip before your first try: ask for unlisted or private. A YouTube upload that doesn't say otherwise goes out public.

upload a youtube video from the terminal with an ai agent

One evening with it looks like this: a finished render on disk at 23:00, live on the channel the next morning, without opening YouTube Studio once.

23:00. The render is done

The file is ./exports/pipeline-rebuild.mp4, 14 minutes long. The thumbnail is ./exports/thumb.png. Here's what goes to the agent:

Upload ./exports/pipeline-rebuild.mp4 to my YouTube channel and schedule it public for 09:00 tomorrow. Title: "I rebuilt my publishing pipeline in a weekend". Use the description in notes.md, tags automation and publishing, category Science & Technology, and thumb.png as the thumbnail.

23:01. The agent finds the channel and uploads

First it calls publishq_list_accounts with the platform set to YOUTUBE and gets the channel's account ID. Then it uploads both files with publishq_upload_media. The local server reads them from your disk, which is the easy way with big video files.

23:03. It creates the post

This is the call it makes:

{
  "content": "I rebuilt my publishing pipeline in a weekend",
  "mediaIds": ["e1d2c3b4-a5f6-4789-9012-3456789abcde"],
  "accounts": [
    {
      "accountId": "f0e1d2c3-b4a5-6789-0123-456789abcdef",
      "platformSpecificSettings": {
        "description": "Write-up and config files are linked below.",
        "privacyStatus": "public",
        "categoryId": "28",
        "tags": ["automation", "publishing"],
        "madeForKids": false,
        "thumbnailMediaId": "a7b8c9d0-1111-4222-8333-944455556666"
      }
    }
  ],
  "scheduledAt": "2026-11-09T09:00:00Z"
}

content is the video title, and YouTube allows 100 characters with no < or >. The description can be up to 5000 characters. All the tags together have to fit in 500 characters. Category 28 is Science & Technology; without one, YouTube files the video under People & Blogs (22).

youtube title description tags and thumbnail set by an ai agent

23:10. You check it before bed

The post now sits in your PublishQ queue. Until 09:00 you can still change the title, the description, the schedule, or only the thumbnail, and you can cancel it. The YouTube scheduler shows it on the calendar next to everything else you have queued.

09:00. It goes live

PublishQ uploads the video and sets the custom thumbnail right after, from a JPEG or PNG of up to 50 MB (1280x720 looks best). YouTube only takes custom thumbnails from verified channels, so if yours isn't verified yet, the video still publishes and PublishQ tells you why the thumbnail was refused. Verifying takes a minute at youtube.com/verify.

For your very first upload, do the same with privacyStatus set to unlisted and publishNow. You watch it on YouTube right away, and once you trust the setup, switch to scheduling.

What about Shorts?

There is no Shorts switch. Upload a vertical 9:16 video of 3 minutes or less and YouTube treats it as a Short. Check your framing first with the YouTube Shorts safe zone checker, because the title and buttons cover the bottom of the frame.

The same publishq_create_post call can send that Short to TikTok and Instagram Reels at once, each with its own caption through postOverrides. Each platform's rules are covered in the TikTok prompts guide and the Instagram MCP guide.

posting a youtube short tiktok and reel at once

Settings you can pass

SettingWhat it does
privacyStatuspublic, unlisted or private. Public when you leave it out.
descriptionUp to 5000 characters
tagsArray of tags, 500 characters in total
categoryIdYouTube category, for example 28 for Science & Technology
madeForKidsMarks the video as made for kids
containsSyntheticMediaDiscloses realistic AI-generated or altered content
embeddableWhether other sites can embed the video
thumbnailMediaIdThe media ID of your custom thumbnail

The YouTube API guide has every value, and YouTube's limits are on one page.

Setup in Cursor and Codex

In Cursor, add {"mcpServers": {"publishq": {"url": "https://publishq.com/mcp"}}} to ~/.cursor/mcp.json (Cursor YouTube page). In Codex, sign in with npx @publishq/cli@latest login and run codex mcp add publishq -- npx -y @publishq/mcp@latest. Codex is good at a queue of finished videos, which the Codex YouTube page walks through. Prefer the terminal without an agent? The PublishQ CLI uploads the same way.

Uploading from Muse, OpenClaw or another agent

Agents that run in the cloud can upload too. They usually take a public link to the video instead of a file on your disk. The setup for each:

For an agent that isn't listed, open publishq.com/agents and copy the line at the top of that page into your agent. It reads the page, sets itself up, and gives you a link to approve the login in your browser.

Create a PublishQ account, connect your channel, and upload your next video as unlisted from the agent you already use.

Frequently Asked Questions

Direct answers extracted from this article.

Yes. Connect your channel in PublishQ, add https://publishq.com/mcp to Claude Code, and ask it to upload a file. It sets the title, description, tags, privacy and thumbnail in one call.
Public, unless you set privacyStatus to unlisted or private. Ask for unlisted on your first upload so you can check it before anyone sees it.
Yes. Upload a JPEG or PNG and pass its media ID as thumbnailMediaId. YouTube only accepts custom thumbnails on verified channels, and PublishQ tells you when a thumbnail is refused.
Upload a vertical 9:16 video of 3 minutes or less. YouTube treats it as a Short automatically; there is no separate setting.
Yes. Use scheduledAt instead of publishNow. You can edit the post or change only its thumbnail until it goes out.
Start for Free

No credit card required • Set up in under 3 minutes