# Youtube MCP Server — 3 tools via DADL

The Youtube DADL turns Youtube's API into an MCP server that Claude, GPT or any MCP-compatible agent can consume directly. One YAML file declares all 3 tools — channel, videos, description, visibility — and ToolMesh serves them at runtime. No Python boilerplate, no per-endpoint code, no separate MCP server process.

Below: the endpoint coverage matrix, a two-block ToolMesh setup, the full tool reference grouped by Youtube feature area, required credential scopes.

**Source:** [YouTube Data API v3](https://developers.google.com/youtube/v3/docs)

**Updated:** 2026-10-19

**Tags:** media, crud, user-management, authentication, logging, notifications, auth:oauth2

## Which Youtube endpoints are covered?

**6%** (3 of ~52 endpoints).

**Focus:** Video release workflow: videos, visibility, description, channel.

**Missing:** Everything outside reading and updating existing videos: video upload, delete and rating, thumbnails, captions, playlists and playlist items, search, comments and comment threads, subscriptions, channel sections and branding, members, activities, i18n and category lookups, live streaming (separate API).


*Last reviewed: 2026-10-19*

## How do you configure the Youtube DADL?

1. Open https://console.cloud.google.com and create or select a Google Cloud project.
2. Enable the API: APIs & Services → Library → 'YouTube Data API v3' → Enable. No billing account is needed; the default quota is 10,000 units per day.
3. Configure the OAuth consent screen (Google Auth Platform → Branding / Audience): user type 'External', add an app name and contact address. Then set the publishing status to 'In production'. CRITICAL: an app left in 'Testing' issues refresh tokens that expire after 7 days. The scope used here is a sensitive scope; an unverified production app shows a warning page during consent ('Google hasn't verified this app' → Advanced → continue), which is fine for your own account.
4. Create the client: Google Auth Platform → Clients → Create client → application type 'Web application', authorized redirect URI https://developers.google.com/oauthplayground. Download the client JSON right away: it holds client_id and client_secret together, and the console shows the secret in full only once. Copy the client ID in full from the client's detail page; it ends with .apps.googleusercontent.com. An ID and a secret from different clients fail later with invalid_client ('The provided client secret is invalid').
5. One-time consent: open https://developers.google.com/oauthplayground, open the settings (gear icon), tick 'Use your own OAuth credentials' and enter the client ID and secret; keep 'Access type: Offline' and tick 'Force prompt: Consent Screen'. In step 1 enter the scope https://www.googleapis.com/auth/youtube.force-ssl and click 'Authorize APIs'.
6. On the Google account chooser pick the CHANNEL you want to manage. If the channel is a brand account it appears as its own entry below your personal account. The token is bound to exactly this channel.
7. In step 2 click 'Exchange authorization code for tokens' and copy the refresh token.
8. Store the three values as ToolMesh credentials: CREDENTIAL_YOUTUBE_CLIENT_ID, CREDENTIAL_YOUTUBE_CLIENT_SECRET, CREDENTIAL_YOUTUBE_REFRESH_TOKEN. Then recreate the ToolMesh container (docker compose up -d toolmesh): a plain docker compose restart keeps the old environment and therefore the old values.
9. Verify: call list_channels. It must return the channel you picked. Then call list_videos with the ID of one of its videos; a private or unlisted video of that channel must be visible.
10. If calls later fail with 'invalid_grant', the refresh token was revoked or expired: repeat the consent step and replace CREDENTIAL_YOUTUBE_REFRESH_TOKEN.

**Environment variable:** `CREDENTIAL_YOUTUBE_REFRESH_TOKEN`

[Authentication docs](https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps)

*YouTube has no service-account access to channels; the refresh_token flow with a one-time interactive consent is the only headless option. ToolMesh exchanges the refresh token for short-lived access tokens on demand, no external refresh job is needed. The scope youtube.force-ssl allows reading and editing the channel's videos; youtube.readonly is enough if only list_videos and list_channels are used. The consent binds the token to one channel, so one backend instance manages one channel. Quota is counted per Google Cloud project: 1 unit per read, 50 units per video update, 10,000 units per day by default.
*

## How do you install the Youtube MCP server with ToolMesh?

Add to your `backends.yaml`:

```yaml
- name: youtube
  transport: rest
  dadl: youtube.dadl
  url: "https://www.googleapis.com"

```

Set the credential:

```
CREDENTIAL_YOUTUBE_REFRESH_TOKEN=your-token-here
```

## What 3 tools does the Youtube DADL expose?

- **GET** `list_videos` — Read one or more videos by ID. Returns an array of video resources with the requested parts: snippet (title, description, tags, categoryId, channelId, publishedAt, defaultLanguage), status (privacyStatus = private | unlisted | public, publishAt, embeddable, license, madeForKids, containsSyntheticMedia), statistics (viewCount, likeCount, commentCount, all as strings). Unknown IDs and private videos of other channels are missing from the array (no 404); an empty array means "not found or not visible to the authorized channel". In the first seconds after a videos.update the result can still show the previous privacyStatus; when verifying an update, retry with backoff instead of trusting one immediate read. Costs 1 quota unit per call regardless of the number of IDs.

- **PUT** `_update_video_raw` — Internal: raw videos.update. REPLACES every part named in `part`; mutable properties missing from the body are deleted, and snippet requires title and categoryId. Use the update_video composite instead, which reads the video and merges. Costs 50 quota units.

- **GET** `list_channels` — List the channel the stored OAuth token belongs to (mine=true). Returns an array, normally with one channel: id, snippet (title, customUrl, publishedAt) and statistics (viewCount, subscriberCount, videoCount as strings). Use it to confirm that the consent was given for the intended channel before updating videos, and as a cheap credential check. Costs 1 quota unit.


## What composite workflows does the Youtube DADL provide?

- **FN** `update_video` — Update a video of the authorized channel. Pass only what should change: visibility (privacy_status = private | unlisted | public), title, description, tags, category or flags. The composite reads the video, merges your changes into the current snippet and status and writes both parts back completely, so tags, language and all other fields you did not pass stay as they are. To swap one line of the description (for example a link) pass replace_line_prefix and replace_line_with: exactly one line must start with the prefix; if no line does but a line already equals the replacement, the description is left unchanged, so the call is safe to repeat. If nothing differs from the current state no write happens. Returns {id, changed, snippet, status}; `changed` lists the fields that were written (empty array = already in the requested state). The returned status reflects the write and is authoritative; a list_videos read in the first seconds afterwards may still show the previous privacyStatus, so verify with a delayed retry rather than an immediate read. Costs 1 quota unit for the read plus 50 units when something is written. Changing privacy_status to public publishes the video immediately.


## Which DADLs are related to Youtube?

- [Stripe](https://www.dadl.ai/d/stripe/) — Stripe REST API — payment processing, billing, subscriptions, invoices, products, and financial infrastructure
- [Alertmanager](https://www.dadl.ai/d/alertmanager/) — Prometheus Alertmanager API v2 -- alerts, silences, receivers, alert groups, status, and operational health
- [Billomat](https://www.dadl.ai/d/billomat/) — Billomat REST API — German cloud invoicing & accounting: invoices, estimates, credit notes, recurring invoices, delivery notes, order confirmations, dunning reminders, clients, contacts, articles, payments, expenses, taxes
- [BookStack](https://www.dadl.ai/d/bookstack/) — BookStack wiki and documentation platform REST API -- shelves, books, chapters, pages (HTML/Markdown content), attachments, image gallery, comments, cross-entity search, exports (HTML/Markdown/PDF/ZIP), ZIP imports, users, roles, content permissions, recycle bin, audit log and tags. Hierarchy: shelves > books > chapters > pages.
- [CentralStationCRM](https://www.dadl.ai/d/centralstationcrm/) — CentralStationCRM REST API v1 — German small-business CRM: people, companies, deals in pipelines, projects, tasks, notes (protocols), calendar, tags, custom fields, attachments, activity stream and webhooks
- [Checkmk](https://www.dadl.ai/d/checkmk/) — Checkmk REST API (version 1.0, Checkmk 2.4) -- live host and service status via Livestatus queries, downtimes, acknowledgements and comments, the Event Console (list, acknowledge, change state and archive events) and BI (packs, rules, aggregations and live aggregation state), plus the full Setup side: hosts, clusters, folders, service discovery, rules and rulesets, host/service/contact groups, users, roles, passwords, time periods, host tags, notification rules, site connections and change activation.


---

**Canonical URL:** https://www.dadl.ai/d/youtube/
**Raw DADL:** https://github.com/DunkelCloud/dadl-registry/blob/main/youtube.dadl
