# YouTube — how to use (mcp.ai)

Busca, vídeo, canal, playlist, comentários, trending e relacionados do YouTube. Hospedado pela plataforma, sem necessidade de credencial.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_youtube?ms=1781045220000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `youtube_api`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/youtube`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/youtube/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/youtube/api` — Escape hatch: call any path on the YouTube backend. Pass path (e.g. /search), optional method (default GET), query map, and JSON body for POST. Prefer the named youtube_* tools when available; this is
  - body: { path: string, method?: string, query?: object, body?: string }
- `POST https://api.mcp.ai/api/youtube/channel/about` — Channel description, links, country, subscriber count, banner.
  - body: { id?: string, forUsername?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/community` — Community posts tab for a channel.
  - body: { id?: string, forUsername?: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/featured` — Featured channels listed on a channel. Note: YouTube deprecated the featured-channels tab; this route exists upstream but typically returns an empty/error envelope.
  - body: { id?: string, forUsername?: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/home` — Channel home page payload (featured shelves + meta).
  - body: { id?: string, forUsername?: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/playlists` — Channel playlists tab.
  - body: { id?: string, forUsername?: string, sort_by?: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/search` — Search a channel's own videos and playlists.
  - body: { id?: string, forUsername?: string, query: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/shorts` — Channel shorts tab.
  - body: { id?: string, forUsername?: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/shorts/post` — POST variant of channel shorts. Requires a `params` continuation token from a prior GET response. Skip in daily smoke (no synthetic params).
  - body: { id?: string, forUsername?: string, params: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/store` — Store / merch shelf for a channel.
  - body: { id?: string, forUsername?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/videos` — Channel videos tab.
  - body: { id?: string, forUsername?: string, sort_by?: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/channel/videos/post` — POST variant of channel videos. Requires a `params` continuation token captured from a prior GET response — used to fetch deeper pages or filtered shelves that the GET surface can't address. Skip in d
  - body: { id?: string, forUsername?: string, params: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/comments` — Top-level comments thread for a video.
  - body: { id: string, sort_by?: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/download` — Stream/download metadata for a video (formats, audio/video URLs, status).
  - body: { id: string, cgeo?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/hashtag` — Posts under a hashtag (without leading #).
  - body: { tag: string, type?: string, token?: string }
- `POST https://api.mcp.ai/api/youtube/home/feed` — YouTube home feed (anonymous, geo/lang aware).
  - body: { geo?: string, lang?: string, token?: string }
- `POST https://api.mcp.ai/api/youtube/hype` — YouTube Hype: viral / hyped videos feed.
  - body: { geo?: string, lang?: string, token?: string }
- `POST https://api.mcp.ai/api/youtube/playlist` — Playlist items by playlist id.
  - body: { id: string, token?: string, ids?: string[] }
- `POST https://api.mcp.ai/api/youtube/resolve/url` — Resolve a YouTube URL or share link to its videoId / pageType.
  - body: { url: string }
- `POST https://api.mcp.ai/api/youtube/search` — Search videos, channels, playlists.
  - body: { query: string, type?: string, sort_by?: string, duration?: string, upload_date?: string, geo?: string, lang?: string, token?: string }
- `POST https://api.mcp.ai/api/youtube/trending` — Trending videos by region.
  - body: { geo?: string, type?: string, lang?: string }
- `POST https://api.mcp.ai/api/youtube/video/related` — Related videos for a given video id.
  - body: { id: string, token?: string, ids?: string[] }

## Example prompts
- "Busque vídeos sobre "receita fit""
- "Detalhes do vídeo dQw4w9WgXcQ"
- "Trending nos EUA"

## More
- Page: https://mcp.ai/youtube
- Agent spec (llms.txt): https://mcp.ai/youtube/llms.txt
- Postman collection: https://mcp.ai/youtube/postman.json
