TubeOnAITubeOnAIDevelopers
Skip to Content
TubeOnAITubeOnAIDevelopers
MCP

Protocol and examples

TubeOnAI runs a remote MCP server so AI clients can read transcripts for you.

  • URL: <issuer>/mcp. Use exactly the URL shown on the AI tools page of the TubeOnAI site you sign in to.
  • Transport: Streamable HTTP. Every call is a single POST /mcp that returns plain JSON. There is no SSE stream and no session.
  • Protocol versions: 2025-11-25, 2025-06-18, 2025-03-26 and 2024-11-05. A request without MCP-Protocol-Version is treated as 2025-03-26. Any other version, including 2026-07-28, gets 400, so clients that support both fall back to initialize.
  • Methods: initialize, ping, tools/list, tools/call and notifications.
  • Sign-in: OAuth, discovered from the 401 challenge. You can also send an API key as Authorization: Bearer toa_live_… from clients that let you set headers. See Authentication.

Setup steps for each client are in the README and on the AI tools page.

Tools

The tools use the same service, inputs and outputs as the REST API.

ToolDoesRead only
get_transcriptTranscript or full text of a URL, an upload, a selected podcast episode, or a page of an earlier resultNo
get_accountPlan, credits left and free transcripts left todayYes
discover_podcastFind a feed's episodes and publisher transcriptsNo
create_uploadStart a private file upload and get a signed PUT grantNo
complete_uploadFinish an upload after its bytes are sentNo
get_uploadCheck an upload's verificationYes
list_libraryYour saved sources, filtered by title words (query), kind and statusYes
get_library_itemOne saved source: status, link, whether its transcript is ready, its projectsYes
add_to_librarySave 1–20 URLs and start extracting their transcriptsNo
delete_library_itemDelete a saved source (needs confirm: true)No
list_projectsYour projects with source countsYes
create_projectA project from 2–20 URLs or saved sourcesNo
get_projectA project's sources in orderYes
rename_projectRename a projectNo
add_to_project / remove_from_projectAdd or remove sourcesNo
delete_projectDelete a project; its sources stay saved (needs confirm: true)No
list_publish_destinationsYour connected accounts, Telegram chats and WordPress sitesYes
create_postPublish or schedule text (needs confirm: true)No
list_posts / get_postScheduled and published posts with delivery statusYes
reschedule_post / cancel_postMove or cancel a scheduled post (needs confirm: true)No

Library, projects and publishing

These tools act on what you see in the web app. Projects are the multi-source projects of the web app (folders and smart collections stay in the app). Deleting a library item hides it with Undo, as in the app. New sources added by add_to_library use your free daily transcripts and never pay for transcription without your yes; sources added to a collection never use paid transcription.

Deleting and publishing need your yes. Without confirm: true, delete_library_item, delete_project, remove_from_project, create_post, reschedule_post and cancel_post change nothing and return confirmation_required, so the client asks you first. Mutating tools take an idempotency_key; a retry with the same key never repeats the action.

Permissions. When your client connects, the consent page lists what it asked for: reading transcripts, the library and projects (always), changing the library and projects (library:write) and seeing or publishing posts (publish). A tool call the connection wasn't allowed gets HTTP 403 with WWW-Authenticate: Bearer error="insufficient_scope", scope="<scope>", resource_metadata="…" (the MCP scope challenge), so the client can ask you to allow it; reconnect and allow it. See Authentication.

get_transcript

Arguments match the body of POST /v1/ai/transcript: exactly one of url, media_url, id, upload_id or podcast, plus optional format, cursor, poll_only, allow_paid_transcription and allow_image_ocr.

The result is either a ready transcript or a pending status with retry_after_sec. To continue, call again with id and poll_only: true. Read further pages with id and cursor. The first page answers most questions.

Paid transcription needs the user's yes. When a video has no captions, the tool returns an stt_consent_required error that quotes the cost. A well-behaved client asks you before it retries with allow_paid_transcription: true. The server's MCP instructions tell clients never to set it without your explicit yes.

get_account

No arguments. It returns {email, plan, credits_left, free_transcripts_left_today, resets_at}.

discover_podcast

Pass url (a public RSS feed or episode page) and a stable idempotency_key once. Poll with id while it is processing. Then pick one feed and episode and call get_transcript with podcast: {feed_url, episode_guid}. It never imports a whole feed or the latest episode on its own. If the server has podcast transcripts turned off, it returns a service_unavailable error saying so.

Uploads: create_upload, complete_upload, get_upload

  1. create_upload with idempotency_key, declared_size_bytes, content_type and optional original_filename and expected_sha256. It returns an upload id and a short-lived signed PUT grant.
  2. The client sends the file's bytes with an HTTP PUT to grant.upload_url, with every header in grant.headers. The MCP server can't read files on your computer or files attached to a chat. Your client must be able to read the file and make the PUT itself.
  3. complete_upload with id, then get_upload with id until ready.
  4. get_transcript with upload_id.

If your client can't send files, use the CLI (tubeonai transcript --file <path>) or the web app, then ask your client to read the result by its library id.

Results and errors

Successful results include both structuredContent and a JSON text copy in content.

Errors come back as tool results with isError: true, so the model can read them and tell you. The text content, and _meta["tubeonai/error"], hold:

{
  "code": "rate_limited",
  "message": "You've used all 50 free transcripts for today. …",
  "retryable": true,
  "action": "upgrade",
  "retry_after_sec": 30512,
  "link": "https://<your TubeOnAI address>/settings"
}

Codes are the REST error codes in lower case. link is set when action is upgrade. details is added when the code has details, such as estimate_credits for stt_consent_required. Protocol problems, such as an unknown tool or method, are JSON-RPC errors.

Example

MCP=https://<your TubeOnAI address>/mcp
KEY=toa_live_...

curl -s -X POST "$MCP" \
  -H "Authorization: Bearer $KEY" -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"get_transcript","arguments":{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}}}'

In a chat, just ask, for example: "What are the key arguments in https://www.youtube.com/watch?v=…?". The client calls get_transcript and answers from the transcript. The transcript is also saved to your library under "From AI tools".

On this page