Back to Guides
Workflow9 minUpdated Sep 19, 2026

How to Connect Claude Code to a YouTube MCP Server

Prepublish serves a YouTube script audit over MCP at https://mcp.prepublish.ai, and Claude Code connects to it with one command. The server needs no account or API key, exposes six tools, and answers each call with scores, flagged passages and rewrites for a script you have not recorded yet.

TL;DR

Prepublish runs a YouTube script audit as an MCP server at https://mcp.prepublish.ai. Connect Claude Code with claude mcp add --transport http prepublish https://mcp.prepublish.ai. Six tools cover a full script audit, a hook score, a reused-content check, a YouTube policy pre-flight, audit collection and a words-to-runtime calculator. It is free and anonymous, with a published daily cap.

Try it on your own script

Paste your draft below. You get your hook, structure, and pacing scores, a script-level attention-risk map, and the single biggest issue quoted from your own lines. Free, no login.

Free · No login · See a sample audit first if you prefer.

Key Takeaways

  • Claude Code connects with one command: claude mcp add --transport http prepublish https://mcp.prepublish.ai
  • The endpoint is stateless Streamable HTTP, free, and anonymous, and asks for no account
  • It exposes six tools, and returns scores, flagged passages and rewrites inside the conversation
  • The default cap is 100 AI-backed calls per UTC day across the whole endpoint and 6 per caller per 10 minutes
  • A bare GET to the endpoint returns a machine-readable server card listing 6 tools, the supported protocol revisions and the free-tier numbers for the current day

Key Statistics

  • •The Prepublish MCP server exposes six tools and is free and anonymous, with a default cap of 100 AI-backed calls per UTC day across the whole endpoint (prepublish-fe/lib/mcp/limits.ts).
  • •A single caller is limited to 6 AI-backed calls per 10 minutes by default, because every MCP call reaches the backend from the web container's one IP address (prepublish-fe/lib/mcp/limits.ts).
  • •The registry entry is ai.prepublish/script-audit v1.0.1, a remote Streamable HTTP server at https://mcp.prepublish.ai (prepublish-mcp/server.json).
  • •A bare GET to the endpoint returns a machine-readable server card listing 6 tools, the supported protocol revisions and the free-tier numbers for the current day (prepublish-fe/app/mcp/route.ts).
  • •The script_runtime tool converts length to runtime using measured speaking rates of 160, 181 and 201 words per minute across 349 videos (prepublish-fe/lib/seo/wpm-data.ts).

How to Connect Claude Code to a YouTube MCP Server

Prepublish serves a YouTube script audit over the Model Context Protocol at https://mcp.prepublish.ai, and it audits a script you have written but not recorded. Claude Code connects with one command:

claude mcp add --transport http prepublish https://mcp.prepublish.ai

The endpoint is stateless Streamable HTTP, free, and anonymous. It exposes six tools, returns scores, flagged passages and rewrites inside the conversation, and asks for no account.

How to connect Claude Code to a YouTube MCP server

Two ways, and the difference is only where the configuration lives.

The command above writes to local scope, which keeps the server to your machine. Run claude mcp list to confirm the entry, and /mcp inside a session to see the connection status and the tool list.

For a server that travels with a repository, create .mcp.json at the project root:

{
  "mcpServers": {
    "prepublish": {
      "type": "http",
      "url": "https://mcp.prepublish.ai"
    }
  }
}

The type field is load-bearing. Claude Code reads an entry that has a url and no type as a stdio server, skips it, and reports MCP server "prepublish" has a "url" but no "type". Adding "type": "http" fixes it, and "streamable-http" works as an alias, which matters because that is the name the MCP specification uses for the transport. A committed .mcp.json stays at pending approval until someone runs claude in the project and accepts the workspace trust dialog, so a cloned repository cannot silently approve its own servers.

https://mcp.prepublish.ai is the canonical connector URL. https://prepublish.ai/mcp and https://mcp.prepublish.ai/mcp serve the same handler and are listed as aliases on the server card, in prepublish-fe/app/mcp/route.ts.

Client setup for Claude Desktop, Cursor, Windsurf, VS Code and Codex CLI

Every client below takes the hosted URL directly. None of them requires the bridge for a basic connection, which is worth stating because the bridge exists and its presence invites the assumption that a remote endpoint is unavailable.

ClientConfig fileRemote URL directly or bridgeSimplest entry
Claude Code.mcp.json in the project, or local scope via the CLIRemote URL directly; the bridge also worksclaude mcp add --transport http prepublish https://mcp.prepublish.ai
Claude DesktopNo file for a remote connector. ~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows, for the local bridgeRemote URL through Connectors, or the bridge in the config fileConnector URL https://mcp.prepublish.ai, or npx -y prepublish-mcp
Cursor~/.cursor/mcp.json for every project, .cursor/mcp.json for oneRemote URL directly; the bridge also works{"url": "https://mcp.prepublish.ai"}
Windsurf~/.codeium/windsurf/mcp_config.jsonRemote URL directly, as serverUrl or url{"serverUrl": "https://mcp.prepublish.ai"}
VS Code with Copilot.vscode/mcp.json in the workspace, or the user-profile mcp.jsonRemote URL directly; the bridge also works{"type": "http", "url": "https://mcp.prepublish.ai"}
Codex CLI~/.codex/config.toml, or .codex/config.toml in a trusted projectRemote URL directly; the bridge also worksurl = "https://mcp.prepublish.ai"

Claude Code

The CLI command above, or the .mcp.json block in the section above. Both are documented in the Claude Code MCP reference.

Claude Desktop

For a remote connector, open Customize then Connectors, choose Add custom connector, and paste https://mcp.prepublish.ai. Claude Desktop, claude.ai and Cowork connect to custom connectors from Anthropic's cloud infrastructure rather than from your machine, so the endpoint has to be reachable over the public internet, which this one is. Free plans are limited to one custom connector. The steps are in Get started with custom connectors using remote MCP.

The local file is a separate mechanism and takes only a command, so it needs the bridge:

{
  "mcpServers": {
    "prepublish": {
      "command": "npx",
      "args": ["-y", "prepublish-mcp"]
    }
  }
}

Save the file, quit Claude Desktop, and restart it. Local server logs land in ~/Library/Logs/Claude on macOS and %APPDATA%\Claude\logs on Windows, per the MCP quickstart for Claude Desktop.

Cursor

Create ~/.cursor/mcp.json for every project, or .cursor/mcp.json for one project:

{
  "mcpServers": {
    "prepublish": {
      "url": "https://mcp.prepublish.ai"
    }
  }
}

Cursor documents both file locations and the remote url shape in its MCP documentation.

Windsurf

Edit ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "prepublish": {
      "serverUrl": "https://mcp.prepublish.ai"
    }
  }
}

Windsurf docs now live under the Devin Desktop documentation; the MCP page still names ~/.codeium/windsurf/mcp_config.json as the file and accepts serverUrl or url for a remote server.

VS Code with Copilot

Create .vscode/mcp.json in the workspace, or run MCP: Open User Configuration for the user profile:

{
  "servers": {
    "prepublish": {
      "type": "http",
      "url": "https://mcp.prepublish.ai"
    }
  }
}

The wrapper key is servers, not mcpServers, which is the most common copy-paste error for this client. VS Code documents the file and the remote shape in Add and manage MCP servers in VS Code.

Codex CLI

Add a table to ~/.codex/config.toml:

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

Codex CLI, the ChatGPT desktop app and the Codex IDE extension share this configuration. The supported keys for a Streamable HTTP server are documented in the Codex MCP reference.

Which YouTube script tools does the MCP server expose

Six tools, discovered with tools/list. Names, inputs and outputs below come from prepublish-fe/lib/mcp/tools.ts, which is the single source of truth: the stdio bridge fetches its list from the hosted server at startup, so the names cannot drift between the two.

ToolInputsReturnsCost
audit_scriptvideo_title, script_text, and optional email, video_duration_seconds, category, audienceHook, structure and pacing scores, a script-level attention-risk map, and a copy-paste rewrite per flagged passage, plus an analysis_idAI-backed
get_auditanalysis_idThe current state of an audit started earlier, and a browser linkFree
audit_hookhook_text, with optional niche and emailPer-sentence attention pull, the curiosity gap, payoff distance, a grade, top issues and rewritesAI-backed
check_authenticityvideo_title, script_textA score, a risk level, the firing signals quoted from the script, and remediation stepsAI-backed
policy_preflightscript (200 characters minimum), optional titleThe YouTube policy categories the draft may touch, each citing YouTube's own published page, plus a verdict and flag countsAI-backed
script_runtimeOne of script_text, word_count, target_minutesA runtime range or a word budget from measured speaking ratesFree, local arithmetic

Every AI-backed result repeats the same constraint in its payload: the check is text-only, it maps relative attention risk inside an unrecorded script, and it does not measure or predict published YouTube retention.

audit_script

Use it when the draft is finished or nearly finished.

Audit this script for a video titled "I rebuilt my studio for 400 pounds". I plan to record about nine minutes. Send the result to me@example.com.

The tool starts an asynchronous audit and polls for up to 90 seconds inside the same request. If the audit has not settled by then, it returns the id and tells the assistant to collect it later. The five checks worth running by hand before you spend a call on this one are in the pre-recording method.

get_audit

Use it after a poll timeout, or when you come back to an audit from earlier in the conversation.

Collect the audit with analysis id 6f0b1c2e-9a44-4f0a-9c3d-1f7b2a8e5d10 and show me only the passages it flagged hardest.

audit_hook

The cheap check, for an opening alone. The browser version of the same check is the hook analyzer.

Score this opening and tell me which sentence loses people first: "Most creators lose half their viewers in the first fifteen seconds, and the reason is rarely the editing."

check_authenticity

For the fear that a repeating format reads as templated.

Check this script for reused-content risk. I publish the same format every week and I am worried it now reads as mass-produced: [paste the script]

The signals it returns come with quotes from the draft, so the report shows the repetition rather than asserting it.

policy_preflight

For a script that touches sensitive subject matter.

Pre-flight this script against YouTube advertiser policy before I record. The title is "How I got banned from three platforms": [paste the script]

The category list cites YouTube's published policy pages. The quoted passages and their rewrites belong to the paid audit, so a free result can return counts with the quotes locked. The browser equivalent is the monetization checker.

script_runtime

Arithmetic, with no AI call and no budget consumed.

How long will this 2,400-word script run, and how many words do I need for a twelve-minute video?

Rates come from a measurement of 349 videos: 25th percentile 160 words per minute, median 181, 75th percentile 201 (prepublish-fe/lib/seo/wpm-data.ts). Speaking time only. Pauses, B-roll and demonstrations add time, so the estimate is a floor rather than a target.

Remote Streamable HTTP or the stdio bridge

Use the hosted URL for everything, unless the client cannot be handed a URL.

The endpoint is one path that answers POST and GET. A POST carries one JSON-RPC message and gets one JSON response, with no session id issued and no SSE stream opened. The specification allows that: a server handling a request may answer with application/json instead of a text/event-stream, and the Mcp-Session-Id header is a MAY. The handshake, tool discovery and every tool call are ordinary POST requests. A bare GET returns the server card instead of the 405 the specification permits, because humans and crawlers arrive at that URL from directory listings.

The registry entry is ai.prepublish/script-audit, version 1.0.1, marked latest, with a remote-only Streamable HTTP record pointing at https://mcp.prepublish.ai. Those are the fields in prepublish-mcp/server.json, read back from the official registry on 19 September 2026.

The bridge is published on npm as prepublish-mcp version 1.0.0, and the invocation documented in prepublish-mcp/README.md and on the MCP server documentation is npx -y prepublish-mcp. It starts a local process that connects to the same hosted server over Streamable HTTP and re-serves the tool list over stdio, which is the transport a client uses when it spawns a subprocess and talks over stdin and stdout. The bridge adds and hides nothing: prepublish-mcp/test/bridge.test.ts asserts that its sorted tool names equal the six names in the hosted list, and that a forwarded script_runtime call returns the same arithmetic.

Three cases where the bridge is the right answer:

  • The client takes only a command and arguments. That is the claude_desktop_config.json path, plus some editors and local agent runtimes.
  • The audit has to run from your own network. Custom connectors in Claude connect from Anthropic's cloud, so a private endpoint behind a firewall will not be reached that way. The bridge runs on your machine.
  • You want to forward a bearer token from a local environment variable. PREPUBLISH_TOKEN sends an Authorization: Bearer header upstream, and PREPUBLISH_MCP_URL points the bridge at another deployment.

The bridge needs Node 20 or newer, per the engines field in prepublish-mcp/package.json. On startup it writes one line to stderr naming the upstream URL, the tool count and whether a token was supplied, which is the fastest way to confirm that the process launched and reached the server.

Is the YouTube MCP server free? Limits and what happens at the cap

Free and anonymous, with two published counters. Both defaults come from prepublish-fe/lib/mcp/limits.ts, and both are environment variables on the deployment rather than constants in the client.

LimitDefaultWindowVariable
AI-backed calls across the whole endpoint100One UTC dayMCP_DAILY_CALL_CAP
AI-backed calls per caller610 minutesMCP_CALLER_CALL_LIMIT
script_runtimeUnlimitedNoneNone

Two refusals, two different problems. When the global day is spent, the tool returns: Prepublish's free MCP endpoint has reached its daily limit of 100 AI-backed calls (it resets at 00:00 UTC). When one caller has used six checks inside ten minutes, it returns: This connection has used its 6 free Prepublish AI checks for now; the allowance resets in about N minute(s). Both are tool-level errors rather than protocol failures, so the message you see in the conversation is the message the server wrote.

The per-caller limit exists because the backend rate limiter keys on client IP and every MCP call reaches it from the web container's single IP address, which would otherwise put every user of the server in one shared bucket. Both counters are in-process. A restart resets them, which is a deliberate trade: a soft cap that forgets is better than wrongly blocking someone. Get the live numbers from GET https://mcp.prepublish.ai, where free_tier.ai_backed_calls_per_day and used_today are read from the same counters.

Two more gates sit behind the MCP layer, in the tools themselves. A free full audit needs an email address, and the backend answers without one with a 402 or a 400 whose message mentions email. Each individual check also has its own daily allowance on prepublish.ai, which returns a 429 that says the allowance for that check is spent. Neither is a fault in your configuration.

The endpoint implements protocol revisions up to 2025-11-25, and negotiates down for older clients; 2025-06-18, 2025-03-26 and 2024-11-05 are answered as asked. The revision in force is newer than that, and clients are required to handle older dialects, so a current client will connect, but the server cannot use capabilities added after 2025-11-25.

What this server does not do

It does not predict retention. Every AI-backed payload carries the same constraint, stated for the model to relay: a text-only check of an unrecorded script, mapping relative attention risk inside the draft, with no ability to account for delivery, editing, thumbnail, topic or distribution.

It does not decide monetisation. policy_preflight reports the categories a draft may touch against YouTube's published policy text and links each one. Only YouTube decides, and it decides on the finished video.

It does not fetch a video, a transcript or a channel. All six tools take text you paste. If the draft does not deserve the check, no tool here will tell you that: it audits execution against the title's promise, not whether the topic was worth a video.

It does not write the script. The tools audit a draft you already wrote, and audit_script will return rewrites for flagged passages only, not a draft of its own.

It does not give you a per-user history. There are no API keys yet, and authenticated use means an existing magic-link token forwarded by the bridge. Anonymous use has no identity to attach a run history to, which is why get_audit takes the id that audit_script returned.

Troubleshooting MCP connection problems

Every symptom below is a string the code produces. The server messages and JSON-RPC codes come from prepublish-fe/lib/mcp/tools.ts, prepublish-fe/lib/mcp/limits.ts, prepublish-fe/lib/mcp/protocol.ts and prepublish-fe/app/mcp/route.ts.

SymptomCauseFix
MCP server "prepublish" has a "url" but no "type" in claude mcp listThe .mcp.json entry has a URL and no transport type, so Claude Code reads it as a stdio serverAdd "type": "http" or "type": "streamable-http" to the entry
The server never appears after you edit claude_desktop_config.jsonThe file is loaded at launch, and invalid JSON fails silentlyQuit Claude Desktop and reopen it, then read ~/Library/Logs/Claude/mcp-server-prepublish.log
Prepublish's free MCP endpoint has reached its daily limit of 100 AI-backed calls (it resets at 00:00 UTC).The global day counter is spentWait for 00:00 UTC, or run the same check from the browser tool linked on the MCP server documentation. Do not retry the tool
This connection has used its 6 free Prepublish AI checks for now; the allowance resets in about N minute(s).Six AI-backed calls from one caller inside ten minutesWait out the window, or use the browser tool for the next check
Prepublish needs an email address to continue: ...A free full audit is released by email and the backend rejects the call without an addressPass the user's real address as email on audit_script. Never invent one, and do not retry unchanged
Prepublish rejected the input for policy_preflight: ...The draft is below the schema minimum, 50 characters for script_text and 200 for a policy script, or a required field is emptyPaste the full draft rather than a summary, then call the tool again
Prepublish's free daily allowance for this check is spent: ...The backend's own per-check limit, distinct from the MCP endpoint capTell the user the check can be run in the browser, or try again tomorrow
The audit (analysis_id "...") is still running. Call get_audit with that id in a minute to collect it.audit_script stopped polling after 90 secondsCall get_audit with that id. The in-conversation link opens the same result in a browser
Unknown tool "no_such_tool" with JSON-RPC code -32602The name was misspelled, or the client is holding a stale tool listRe-run tools/list and use a name from the response
Method "resources/read" is not implemented by this server with JSON-RPC code -32601This server declares the tools capability only. resources/list and prompts/list answer with empty arrays, and any other method falls through to this errorCall only initialize, ping, tools/list and tools/call. Nothing else is implemented
JSON-RPC batching is not supported; it was removed in protocol revision 2025-06-18. Send one request per POST. with code -32600A script or an inspector sent a JSON array of requestsSend one JSON-RPC message per POST. The specification removed batching in the 2025-06-18 revision
npx -y prepublish-mcp exits at once and the client shows a failed serverNode is older than 20, which the package's engines field requires, or the upstream host is unreachableRun node --version, then run the bridge by hand to read its stderr line. Point it elsewhere with PREPUBLISH_MCP_URL if needed

Frequently asked questions

How do I connect Claude Code to a YouTube MCP server?

Run claude mcp add --transport http prepublish https://mcp.prepublish.ai in a terminal. For a project-scoped server that you can commit, add an entry under mcpServers in .mcp.json with "type": "http" and the endpoint as "url", then approve the server when Claude Code asks. Claude Code reads an entry that has a url but no type as a stdio server and skips it, so the type field is required.

Is the YouTube MCP server free to use?

Yes. The endpoint is anonymous and needs no account, API key or card. The free tier is a published allowance: 100 AI-backed calls per UTC day across the whole endpoint, and 6 AI-backed calls per caller per 10 minutes by default, read from prepublish-fe/lib/mcp/limits.ts. The script_runtime calculator is local arithmetic and never counts against either limit. An optional bearer token raises the free-tier limits without changing the tools.

Does this work in Claude Desktop?

Yes, two ways. Add it as a custom connector under Customize then Connectors, and paste https://mcp.prepublish.ai; the connection then originates from Anthropic's cloud infrastructure. Or keep the local config file and run the stdio bridge, which Claude Desktop launches itself: npx -y prepublish-mcp forwards to the same hosted server, so the tool list is identical.

Can Cursor, Windsurf, VS Code Copilot and Codex CLI use the same server?

Yes. Cursor reads ~/.cursor/mcp.json or .cursor/mcp.json and accepts a url entry. Windsurf reads ~/.codeium/windsurf/mcp_config.json and accepts serverUrl or url. VS Code reads .vscode/mcp.json in a workspace or the user-profile mcp.json and takes an entry with "type": "http". Codex CLI reads ~/.codex/config.toml and takes a [mcp_servers.prepublish] table with url.

Can the MCP server analyze a video that is already published?

No. All six tools take text you paste: the script, the hook, the policy draft. Nothing fetches a video, a transcript or a channel, and no result is a measurement of a published video. The tools read a draft before you record. If you need the analysis to line up with real viewer behaviour, compare it against your own YouTube Studio curve afterwards, which is the sequencing described in the pre-recording checks.

Why does audit_script ask for an email address?

Because a free full audit is released by email, and the backend rejects the request without an address. The tool description tells the assistant to ask you rather than guess, and the failure message repeats that. The narrower checks, audit_hook, check_authenticity and policy_preflight, do not need an address. The address is used to send that one result, and there is no account behind it.

What happens when the free daily cap is reached?

The tool returns an error telling the model that the endpoint has reached its daily limit and not to retry, and it names https://prepublish.ai/upload as the alternative for that day. The counter resets at 00:00 UTC. The live number is published on the server card, so you can read it before you start: a GET to the endpoint returns the cap and the calls used today.

Does the server read or store my script?

The script is processed to produce the audit and stored with the analysis so the result can be reopened by id. The MCP documentation states that nothing is sold or shared. If you would rather not send a draft to any service, the six tools are the wrong instrument, and a manual read of your own script is the honest alternative.

Related Guides

Free tools to put this into practice

Want to see how this reads on real channels? Browse the channel breakdowns. Each one compares script patterns across a channel's own higher-viewed and lower-viewed uploads, quoted from the transcripts.

See where your next script leaks viewers

Paste your script, get your scores and the biggest leak for free. No login.