Skip to main content
Glama
Yoto Cards MCP
by haimrait
README.md
# Yoto Cards MCP

An MCP server and agent skill for building and looking after **Yoto Make Your Own cards**
by chatting with an AI agent: create cards from podcasts, files and streams, pick track
icons and covers, reorder and fix tracks, and undo mistakes.

> Independent project that works with Yoto. Not made by, endorsed by, or affiliated with Yoto.

It runs locally today (Claude Code, Claude Desktop and other desktop or CLI agents over
stdio) and is built so the same tools can later be hosted for web and mobile agents.

## What's different

- **Every change is undoable.** The previous version of a card is saved before every
  write (25 per card); `restore_card` brings it back, and can even recreate a deleted card.
- **No half-written cards.** Tracks upload in parallel as a background job and are written
  to the card once, in order. Concurrent edits to one card are serialised, and each edit
  re-reads the latest card first, so changes made in the Yoto app are not overwritten.
- **No accidental doubles.** Audio already on the card (or twice in one request) is recognised by
  Yoto's own content hash and skipped with a note saying which track it matches, so a retried
  request or a re-added file does not fill the card twice. `allow_duplicates` keeps a copy on purpose.
- **Nothing is lost on round-trip.** Card fields the server doesn't know are kept as they are.
- **Limits enforced before writing:** 100 tracks, 5 hours / 500 MB per card, 60 min / 100 MB per track.
- **The parent sees the important moments themselves.** In apps that support MCP elicitation,
  sign-in opens the real Yoto page through the app (the link never passes through the chat),
  and the upload plan is shown as a form before anything uploads.
- **Confirmations the agent can't fake.** Deleting, removing tracks, restoring and replacing
  covers ask the parent through a form when the client supports it (MCP elicitation, both
  protocol versions); otherwise the agent must ask in chat and pass `confirm: true`.
- **Safe downloads.** Files are identified by their bytes, never by name or headers. Web
  pages, archives, programs and scripts are refused. Downloads can't reach private networks
  or cloud metadata addresses, including through redirects or DNS tricks (the check runs on
  the address actually connected to). Size is capped while downloading.
- **Painless sign-in.** PKCE with a loopback listener catches the approval, so nobody copies
  codes by hand. Yoto's single-use refresh tokens are rotated under a lock shared across
  processes, so a desktop app and a CLI agent can share one login.
- **The skill ships with the server** over MCP (`skill://yoto-cards/SKILL.md`), and the
  essentials are repeated in the server's instructions for agents that don't load skills.
- **Icons for anything, still or animated.** Yoto's library first; otherwise `make_icon` turns an emoji into crisp
  16x16 pixel art (Google's Noto Emoji, Apache 2.0) or renders a grid the agent draws, and shows a
  preview so the agent and the parent can see it before it goes on a track. Add a `motion` (bounce, wiggle,
  float, pulse, twinkle, flip) for a looping 16x16 GIF the player animates.
- **Suggestions for each child.** A minimal profile (nickname, birth month, languages,
  interests, things to avoid) is stored on your computer and read by the AI app you chat with;
  the podcast search gets only search words and a country code. `discover_content` searches in
  the child's languages, checks every show's real feed (language, length, still publishing,
  downloadable, not explicit) and never suggests a show twice.
- **Stickers for the physical cards.** `make_labels` prints covers on an A4 PDF at real card size
  (rounded corners, cut lines, 9 per page), with a preview of the page.
- **Podcast cards that keep up.** A card can follow its podcast: new episodes are found by date
  and added once each, oldest first, as far as the card's limits allow; old gaps are never
  refilled, and a full card is reported instead of squeezed. Optionally fully automatic.
- **Cover designs to choose from.** `design_cover` builds three different layouts around the
  show's own artwork, in its colours, with readable titles (Hebrew and other right-to-left text
  included) and emoji from the content, and returns them as one numbered preview.
- **YouTube audio, locally and carefully.** `read_youtube` lists a video or playlist (with the
  video's licence when YouTube shows one) and plans the cards; YouTube links then work as track
  sources. Only for audio the family has the right to use: the parent confirms it before anything
  downloads. Links are reduced to a video ID before reaching yt-dlp, which runs without a shell,
  the user's yt-dlp config or browser cookies. Live streams, age-restricted videos and anything
  over Yoto's track limits are refused.
- **Podcasts in one step.** `read_feed` takes a feed, an Apple Podcasts link or a show's website and
  returns clean episodes plus a plan of how many cards they need within Yoto's limits.
- **Readable errors.** Every failure comes back with a stable code and a "What to do" line.

## Tools

| Area | Tools |
|---|---|
| Account | `account_status`, `sign_in`, `finish_sign_in`, `sign_out` |
| Cards | `list_cards`, `get_card`, `create_card`, `update_card_details`, `delete_card` |
| Tracks | `add_tracks`, `rename_track`, `move_track`, `reorder_tracks`, `remove_tracks` |
| Jobs | `get_job`, `list_jobs`, `cancel_job` |
| Podcasts | `read_feed`, `follow_podcast`, `podcast_updates`, `add_new_episodes`, `unfollow_podcast` |
| YouTube (local) | `read_youtube` |
| Art | `search_icons`, `make_icon`, `set_track_icons`, `design_cover`, `set_cover` |
| Print | `make_labels` |
| Children | `save_child_profile`, `list_child_profiles`, `delete_child_profile`, `discover_content`, `record_suggestion` |
| Players (opt-in) | `list_players`, `player_status`, `control_player`, `player_settings`, `change_player_settings` |
| Undo | `list_backups`, `restore_card` |

Track sources: `url` (a podcast enclosure, a direct audio link, or a YouTube video link in
local mode), `path` (an absolute path on the computer running the server; local mode only) or
`stream_url` (audio the player streams on every play).

## Setup

Both routes need your own free **Yoto client ID** (a public ID, not a secret): create a public
client at <https://dashboard.yoto.dev> and register the callback URL
`http://127.0.0.1:8787/callback`.

### Claude Desktop: one file

No terminal, and no Node to install: Claude Desktop runs the extension with its built-in Node.

1. Download the `.mcpb` file from the
   [latest release](https://github.com/haimrait/yoto-cards-mcp/releases/latest). (Or build it
   yourself with `npm install` and `npm run extension`; it is written to `extension/out/`.)
2. Double-click it, or drag it into **Settings → Extensions**.
3. Paste your client ID, choose whether to use YouTube and player control, and install.
4. Ask Claude to connect your Yoto account.

Claude Desktop warns that the extension gets access to your computer and that Anthropic has not
verified the developer. Expect it, and install only a file from a source you trust. YouTube audio still needs yt-dlp and Deno (below). If you added
`yoto-cards` to the app's config by hand before, remove that entry so the tools are not doubled.

### Claude Code and other agents: from source

Requires Node 22 or newer.

1. **Get the code and build it:**
   ```bash
   git clone https://github.com/haimrait/yoto-cards-mcp.git
   ```
   ```bash
   cd yoto-cards-mcp
   ```
   ```bash
   npm install
   ```
   ```bash
   npm run build
   ```
2. **Connect your agent.**
   - Claude Code:
     ```bash
     claude mcp add yoto-cards -e YOTO_CLIENT_ID=your_client_id -- node "/absolute/path/to/dist/bin/cli.js"
     ```
   - Claude Desktop or another desktop agent's MCP config:
     ```json
     {
       "mcpServers": {
         "yoto-cards": {
           "command": "node",
           "args": ["/absolute/path/to/dist/bin/cli.js"],
           "env": { "YOTO_CLIENT_ID": "your_client_id" }
         }
       }
     }
     ```
   Fully restart the app afterwards.
3. **Sign in:** ask the agent to connect your Yoto account (it calls `sign_in`), or from a terminal:
   ```bash
   YOTO_CLIENT_ID=your_client_id node dist/bin/cli.js login
   ```

### Player control (optional)

Playing cards, pausing, volume, night light, sleep timer, alarms and volume limits on the
family's players. Off by default because:

- it needs three more Yoto permissions: `family:devices:view`, `family:devices:control` and
  `family:devices:manage` (tick them on your app at dashboard.yoto.dev);
- Yoto does not verify apps that use the control or manage permissions. That is fine for
  personal use and sharing, but matters for a public listing.

To switch it on, add `YOTO_PLAYER_CONTROL=true` to the server's environment, restart the app,
and sign in again so the parent approves the new permissions. Every command and settings
change is confirmed by the parent, a player's settings are backed up before each change,
and live commands use Yoto's documented player connection (MQTT, signed in with the
family's Yoto token).

Not yet tried on a real player. Sign-in with the three permissions and the player list were
checked live (2026-11-28) on an account with no players. Two things only a real player can
confirm: the address format sent to play a card (`https://yoto.io/<cardId>`) and the exact
shape of the player's replies.

### YouTube audio (local only)

Needs [yt-dlp](https://github.com/yt-dlp/yt-dlp) and [Deno](https://deno.com) (yt-dlp uses
Deno to read YouTube):

```bash
brew install yt-dlp deno
```

On Windows: `winget install yt-dlp.yt-dlp DenoLand.Deno`. The server looks in the usual
install places, since desktop apps start it with a short PATH; set `YOTO_YTDLP_PATH` if
yt-dlp is elsewhere. Keep yt-dlp up to date (`brew upgrade yt-dlp`): YouTube changes often.

YouTube's terms allow downloading only where YouTube or the rights holder permits it. Use this
for the family's own videos, Creative Commons videos, or with the creator's permission.

### Automatic podcast updates (optional)

Cards that follow a podcast with `auto_add: true` are updated by the `sync` command. Run it
once a day from your scheduler, for example with cron (`crontab -e`):

```
0 7 * * * YOTO_CLIENT_ID=your_client_id /usr/local/bin/node "/absolute/path/to/dist/bin/cli.js" sync >> "$HOME/.yoto-cards-mcp/sync.log" 2>&1
```

`sync --dry-run` shows what it would add without changing anything. Each line of the log
says what was added, what failed, and whether a card is full.

### Configuration

| Variable | Default | Purpose |
|---|---|---|
| `YOTO_CLIENT_ID` | (none) | Public client ID; required to sign in |
| `YOTO_REDIRECT_URI` | `http://127.0.0.1:8787/callback` | Must match the URL registered for the client |
| `YOTO_DATA_DIR` | `~/.yoto-cards-mcp` | Tokens (file mode 600), backups, job records, temporary downloads |
| `YOTO_ALLOW_LOCAL_FILES` | `true` | `false` accepts URLs only |
| `YOTO_SCOPES` | `openid profile offline_access user:content:view user:content:manage user:icons:manage` | Requested Yoto scopes (Yoto only honours scopes requested explicitly) |
| `YOTO_ALLOW_YOUTUBE` | same as `YOTO_ALLOW_LOCAL_FILES` | `false` hides `read_youtube` and refuses YouTube links |
| `YOTO_YTDLP_PATH` | (searched) | Full path to yt-dlp, if it is not found automatically |
| `YOTO_PLAYER_CONTROL` | `false` | `true` adds the player tools and their permissions (see above) |
| `YOTO_LOG_LEVEL` | `info` | Logs go to stderr only, with secrets redacted |

`node dist/bin/cli.js http --port 3939` serves the same tools over Streamable HTTP on
`127.0.0.1`, which is useful for testing with web-style clients through a tunnel.

## Development

```bash
npm test
```
```bash
npm run typecheck
```
```bash
npm run extension
```

The last one builds the Claude Desktop extension, with the icon renderer's binaries for Mac,
Windows and Linux on Intel and ARM.

Tests run against an in-process fake of the Yoto API and cover editing, limits, sniffing,
network guards, token rotation across processes, sign-in, confirmations on both MCP
protocol versions, backups and restore, and skills over MCP.

```
src/
  yoto/      Yoto API client, auth (PKCE, refresh), loopback sign-in, card schemas
  cards/     pure card edits, limits, icon search, CardService (lock, backup, verify)
  media/     downloads, byte sniffing, private-network guard
  jobs/      background job manager and the track upload pipeline
  storage/   JSON store (file for local, memory for tests) with a cross-process lock
  mcp/       server, tools, confirmations, responses
  bin/cli.ts stdio / http / login / status / logout
skills/yoto-cards/SKILL.md + references, served over MCP
```

## Verified against the live Yoto API (2026-11-27)

Every tool was run against a real account. Behaviour the docs don't spell out, confirmed live:

- **Scopes must be requested by name.** A token with only `user:content:manage` gets 403 on
  `GET /content/{id}`; `user:content:view` has to be in the sign-in request, even though the
  dashboard says it is "included automatically". `account_status` flags this.
- **Dashboard scopes must be ticked on the app**, or sign-in fails with "scopes that have not been pre-approved".
- **`metadata.languages` accepts only** `en, en-gb, en-us, fr, fr-fr, es, es-es, es-419, de, it, nl, zh_Hans`.
  Other languages (e.g. Hebrew) are rejected; leave the field out. Titles in any language work.
- **Icon uploads must be raw bytes** with `Content-Type: image/png`; multipart is refused.
  Covers are raw bytes too, and the returned `mediaUrl` goes in `metadata.cover.imageL`.
- Tracks with `icon16x16: null` and stream tracks without `duration`/`fileSize` are accepted.
- Audio upload (PUT with the sniffed MIME type), transcoding, and SHA-256 dedupe work.
- Refresh tokens rotate on every refresh, and the session renews automatically.
- Emoji and hand-drawn 16x16 PNG icons upload and display; preview sheets match what is uploaded.
- Animated 16x16 GIF icons upload with `autoConvert=false` and Yoto keeps every frame (served back as
  `GIF89a`, though labelled `image/png`).
- `read_feed` handles real feeds (440-episode show, Apple Podcasts link lookup), and episode links
  from podcast analytics services chain about six redirects before the audio, so up to 10 are followed,
  each re-checked by the network guard.
- YouTube audio (2026-11-28, yt-dlp 2026.11.23): a Creative Commons video's stereo M4A (itag 140)
  downloads in seconds, uploads and transcodes like any file. yt-dlp older than about 90 days gets
  HTTP 403 from YouTube, which the server reports as "update yt-dlp".

## Privacy

No server of its own, no analytics, no tracking. [PRIVACY.md](PRIVACY.md) lists what is kept on
your computer and what is sent to Yoto, your AI app and other services.

## License

[Apache License 2.0](LICENSE). See [NOTICE](NOTICE). Yoto is a trademark of Yoto Limited;
this project is independent and only describes compatibility.

## Roadmap

- Hosted mode on Vercel: OAuth for many families, a database store, an upload page
  so parents can send files from their phone straight to Yoto.
- MCP Tasks for uploads once the SDK ships server support (jobs work in every client today).
- Try player control on a real player.

TDQS

A3.6/5.0

Scored across 36 tools

Disambiguation4/5

Most tools target a clearly distinct resource+action (search_icons vs make_icon vs set_track_icons, create_card vs add_tracks vs add_new_episodes), and the descriptions actively explain the boundaries. A few clusters could be mis-picked at a glance — move_track vs reorder_tracks vs rename_track, and podcast_updates vs add_new_episodes — but the wording makes the intended choice recoverable.

Naming Consistency4/5

Nearly everything follows a snake_case verb_noun pattern (create_card, list_cards, get_card, delete_card, add_tracks, remove_tracks, restore_card), which reads predictably. The only deviations are noun-only status names like account_status and podcast_updates, plus finish_sign_in, which are minor but break the pattern.

Tool Count3/5

36 tools is heavy, but the surface covers genuinely separate sub-domains: auth, cards, tracks, icons, covers, podcast/YouTube ingestion, child profiles, discovery, backup, and job control — roughly 4-6 tools each. Each tool earns its place, yet the total is large enough to burden tool selection and would benefit from consolidation (e.g. merging job tools or track-editing tools).

Completeness4/5

Lifecycle coverage is strong: full card CRUD, full track add/remove/rename/move/reorder, podcast follow/update/add/unfollow, profile save/delete/list, backups with restore, and job get/list/cancel. Minor gaps remain — there is no way to clear or remove a cover, and no direct tool to inspect or undo a suggestion history beyond record_suggestion.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues