Labsco
daanrongen logo

Cast

from daanrongen

MCP server for Google Cast โ€” discover devices, play media, control volume, launch apps, and manage queues over stdio

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeQuick setup

cast-mcp

MCP server for Google Cast โ€” discover devices on your local network via mDNS, play media, control volume, launch apps, and manage queues, all over stdio. No environment variables or API keys required; the server connects directly to Cast receivers using the castv2 protocol.

Tools (17 total)

DomainToolsCoverage
Discoverydiscover_devicesScan local network for Cast-enabled devices via mDNS
Mediaplay_media, pause, resume, stop, seek, get_media_statusPlayback control and media status
Queueload_queue, queue_next, queue_prevPlaylist queuing and navigation
Appsget_status, launch_app, stop_appApplication lifecycle on Cast receivers
Volumeget_volume, set_volume, mute, unmuteVolume and mute control

Development

bun install
bun run dev        # run with --watch
bun test           # run test suite
bun run typecheck  # type check without emitting
bun run build      # bundle to dist/main.js
bun run inspect    # open MCP Inspector in browser

Inspecting locally

bun run inspect launches the MCP Inspector against the local build:

bun run build && bun run inspect

This opens the Inspector UI in your browser where you can call any tool interactively and inspect request/response shapes.

Architecture

src/
โ”œโ”€โ”€ config.ts                   # (no env config required)
โ”œโ”€โ”€ main.ts                     # Entry point โ€” ManagedRuntime + StdioServerTransport
โ”œโ”€โ”€ domain/
โ”‚   โ”œโ”€โ”€ CastClient.ts           # Context.Tag service interface (port)
โ”‚   โ”œโ”€โ”€ errors.ts               # CastError, DeviceNotFoundError
โ”‚   โ”œโ”€โ”€ models.ts               # Schema.Class models (CastDevice, MediaStatus, โ€ฆ)
โ”‚   โ”œโ”€โ”€ discovery.test.ts       # Discovery domain tests
โ”‚   โ”œโ”€โ”€ media.test.ts           # Media domain tests
โ”‚   โ””โ”€โ”€ volume.test.ts          # Volume domain tests
โ”œโ”€โ”€ infra/
โ”‚   โ”œโ”€โ”€ CastClientLive.ts       # Layer.scoped โ€” mDNS discovery + castv2 connections
โ”‚   โ””โ”€โ”€ CastClientTest.ts       # In-memory test adapter
โ””โ”€โ”€ mcp/
    โ”œโ”€โ”€ server.ts               # McpServer wired to ManagedRuntime
    โ”œโ”€โ”€ utils.ts                # formatSuccess, formatError
    โ””โ”€โ”€ tools/                  # discovery.ts, media.ts, queue.ts, apps.ts, volume.ts