Chromecast / DLNA casting (catt)

io.github.amineutron由 GitHub 帳號 amineutron 發布v0.3.0更新於 Oct 24, 2026

Cast YouTube videos and media to a Chromecast or DLNA device with catt, and control playback.

已驗證STDIO僅桌面效率與工作流媒體與設計

概覽

AI 產生的概覽

讓助理把 YouTube 影片和其他媒體連結投放到 Chromecast 或 DLNA 裝置,並控制播放。

可以做什麼
把 catt 投放工具包裝成約 15 個 MCP 工具。可以依連結或影片 ID 投放 YouTube 影片、投放任意媒體連結,停止、暫停、繼續、跳轉與調整音量,並查詢投放狀態與媒體資訊。它也能掃描區域網路中的 Chromecast 和 DLNA 裝置;在裝有 Hyprland 的 Linux 桌面上,可把 Firefox 目前分頁的影片鏡像到電視,並支援 PC 與電視同步播放的雙螢幕模式。
適用情境
適合想用助理在同一網路內的電視或 Chromecast 上開始或控制播放的情境,例如投放 YouTube 連結、暫停或繼續、調整音量。Firefox 鏡像與雙螢幕工具只在執行 Hyprland 和 Firefox 的 Linux 桌面上才有意義。
執行需求
本機程序,可用 uvx 從 PyPI 套件 catt-mcp 執行,或以 pip 安裝。需要 Python 3.10+、catt 與 yt-dlp 套件,以及同一網路中的 Chromecast 或 DLNA 裝置。用 CATT_DEVICE 指定裝置名稱或 IP;TV_HOST 為選用,用於透過 ADB 喚醒 Android TV;adb 不在 PATH 時用 ADB_PATH。雙螢幕工具還需要 Hyprland 的 hyprctl、playerctl、Firefox 與 lz4。
安裝前請注意
此伺服器會控制你網路中的真實裝置:投放、停止、暫停、跳轉與音量工具會改變正在播放的內容,雙螢幕工具還會透過 ADB 操作 Firefox 與電視。它要求以 CATT_DEVICE 和 TV_HOST 提供裝置名稱或 IP,這些值會寫入助理設定。未宣告任何身分驗證,能存取此伺服器的人都能操作電視。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Chromecast / DLNA casting (catt),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

catt-mcp

[tests] [License: MIT] [Python 3.10+]

MCP server for casting YouTube videos and media to Chromecast/DLNA devices via catt.

Exposes 15 tools covering YouTube casting, playback control, dual-screen sync, and device discovery.

Demo

[MCP client: the 15 tools, then cast_scan finding the TV]

Recorded on the real network with docs/demo/record.sh: a minimal MCP client (docs/demo/mcp_demo.py) starts the server over stdio with CATT_DEVICE in the environment, lists the tools and calls cast_scan (read-only). Private IP addresses are replaced with documentation addresses.

Tools

OutilRôle
cast_youtubeCaste une video YouTube sur la TV (URL ou ID de video)
cast_urlCaste une URL quelconque (video, audio, stream) sur la TV
cast_stopArrete le cast en cours sur la TV
cast_pauseMet en pause le cast en cours
cast_resumeReprend la lecture du cast
cast_volumeRegle le volume du cast (0-100)
cast_seekAvance ou recule dans la video
cast_statusRetourne le statut du cast en cours
cast_scanScanne les devices Chromecast/DLNA disponibles sur le reseau
cast_infoRetourne les infos detaillees du media en cours
cast_browserCaste la video de l'onglet actif de Firefox sur la TV (YouTube, Twitch, etc.)
cast_browser_dualLance la video sur PC (Firefox) ET TV simultanement avec synchronisation (pour LightBeat)
cast_dual_resyncResynchronise PC et TV en relancant la TV a la position Firefox
cast_dual_stopArrete le dual cast et le watcher de synchronisation
cast_dual_offsetAjuste le decalage TV (positif=TV en avance, negatif=TV en retard)

YouTube ID extraction

_extract_video_id (URL watch?v=, youtu.be/, shorts/ or a bare 11-character ID, anything else rejected before it reaches catt/ADB) is deliberately duplicated in pylips-mcp (youtube_video, TV app with Premium account). Both servers stay installable on their own; each one tests its copy with the same table of cases (tests/test_youtube_id.py). Decision recorded on 2026-09-20.

Requirements

  • Python 3.10+
  • catt: pip install catt
  • yt-dlp: pip install yt-dlp
  • A Chromecast or DLNA-compatible device on the same network
  • lz4 (optional, for cache compression): pip install lz4

Dual cast (Linux + Hyprland)

cast_browser, cast_browser_dual, cast_dual_resync, cast_dual_stop and cast_dual_offset drive Firefox from the running desktop session. They are advertised only when the required binaries are present:

  • Hyprland with hyprctl in PATH
  • playerctl for MPRIS playback control
  • Firefox holding the video to mirror
  • lz4 (Python) to read Firefox's session cache

Without them the server starts normally and simply does not expose these five tools, instead of failing when they are called.

Installation en une ligne

bash
uvx catt-mcp                 # depuis PyPI ; avant publication : uvx --from git+https://github.com/amineutron/catt-mcp catt-mcp

Configuration Claude Desktop / Claude Code (mcpServers) :

json
{ "catt": { "command": "uvx", "args": ["catt-mcp"], "env": { "CATT_DEVICE": "Living Room TV" } } }

Setup

1. Install dependencies

bash
pip install mcp catt yt-dlp

2. Discover your device

bash
catt scan

Note the device name (e.g. 55OLED705/12, Living Room TV).

3. Configure

Copy config.example.yaml to config.yaml:

yaml
catt:  device: "55OLED705/12"   # Name from catt scan

4. Run

bash
catt-mcp                      # installed (pip, uvx) ; `catt-mcp --help` lists the settingspython -m catt_mcp            # same thing, from any environment where the package is installedpython server.py              # from a clone, without installing (thin launcher, code in catt_mcp/)

Or with environment variable:

bash
CATT_DEVICE="55OLED705/12" catt-mcp

The code lives in the catt_mcp package (catt_mcp/server.py, catt_mcp/sync_watcher.py), so it can be installed next to other MCP servers without module name clashes.

The dual-screen tools (dual_cast, dual_resync, dual_offset) drive the TV through ADB and need its IP address. Set it with TV_HOST (or tv.host in config.yaml), for example TV_HOST="192.0.2.10"; the built-in default is only a placeholder.

Claude Desktop Configuration

json
{  "mcpServers": {    "catt": {      "command": "python3",      "args": ["/path/to/catt-mcp/server.py"],      "env": {        "CATT_DEVICE": "55OLED705/12"      }    }  }}

License

MIT

Part of the Lyra ecosystem

DépôtRôle
lyraassistant DevOps vocal, local par défaut (AGPL-3.0)
fedora-agentsMCP : machines virtuelles KVM et sauvegardes
mcp-trackingMCP + API + tableau de bord des tâches longues
neutroncorehub PWA du homelab
hue-mcpMCP Philips Hue (fork de ThomasRohde/hue-mcp)
pylips-mcpMCP TV Philips
denon-mcpMCP ampli Denon
catt-mcpMCP Chromecast et DLNA

來源:README.md,提交 9709a1e

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

2
  1. v0.3.0最新Sep 25, 2026
  2. v0.2.1Sep 24, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分