feat(api): migrate YouTube connector to Composio
Summary
Adds YouTube to the Composio toolkit allowlist (artist + supported + enabled lists, plus COMPOSIO_YOUTUBE_AUTH_CONFIG_ID env). Removes four custom YouTube MCP tools whose capabilities Composio's YouTube toolkit already covers (`YOUTUBE_GET_CHANNEL_STATISTICS`, `YOUTUBE_LIST_PLAYLIST_ITEMS`, `YOUTUBE_UPDATE_THUMBNAIL`). Keeps `get_youtube_revenue` as the only retained custom YouTube tool — Composio doesn't expose YouTube Analytics — and rewrites it to read the OAuth access token from Composio's connected-account state instead of the `youtube_tokens` Supabase table.
Test plan
- On preview, `GET /api/connectors?account_id=` returns `youtube` with `isConnected` and a `connectedAccountId`
- `GET /api/connectors/actions?account_id=` lists the three YouTube actions above
- After connecting via the chat UI, calling `get_youtube_revenue` for a monetized channel returns daily/total revenue without touching `youtube_tokens`
- `pnpm test` (2305+ green)
- `pnpm lint:check` clean
Summary by cubic
Migrate YouTube to Composio: enable the youtube connector, replace custom MCP tools with Composio actions, and keep get_youtube_revenue as a custom tool that queries YouTube Analytics via Composio.
-
Refactors
- Enabled Composio YouTube: added
youtubetoALLOWED_ARTIST_CONNECTORS,ENABLED_TOOLKITS, andSUPPORTED_TOOLKITS, and wiredCOMPOSIO_YOUTUBE_AUTH_CONFIG_IDinbuildAuthConfigs; swapped login/channels/playlist-videos/thumbnail tools for Composio actions (YOUTUBE_GET_CHANNEL_STATISTICS,YOUTUBE_LIST_PLAYLIST_ITEMS,YOUTUBE_UPDATE_THUMBNAIL). - Rewrote
get_youtube_revenueto authorize withcheckAccountArtistAccess, read the artist’s Composio connected account, and call YouTube Analytics viacomposio.tools.proxyExecutewithconnectedAccountId(tokens never leave Composio). - Updated the Composio Tool Router: renamed to
getComposioTools, removedresolveSessionToolkits, and merged owner tool sets by priority (shared → customer → artist); customer meta-only filter applies only when an artist is in scope. - Removed the
youtube_tokenstable, YouTube OAuth helpers, and thegoogleapisdependency.
- Enabled Composio YouTube: added
-
Migration
- Set
COMPOSIO_YOUTUBE_AUTH_CONFIG_IDand deploy; artists must connect YouTube in the connectors UI. - No DB tokens are used;
get_youtube_revenueworks with Composio’s connected account tokens.
- Set
Summary by CodeRabbit
Release Notes
-
New Features
- Added YouTube as a supported connector through Composio integration.
-
Removed
- Removed standalone YouTube login tool; authentication now handled through Composio's YouTube connector.
- Removed direct YouTube channel and video listing tools; now available via Composio's YouTube toolkit.
- Removed thumbnail upload tool; manage through Composio's YouTube integration.
-
Improved
- YouTube revenue analytics now use streamlined authentication via Composio connectors.