Skip to main content
Glama

appletv-mcp

一个 MCP 服务器,让 AI 代理能够通过本地网络完全控制 Apple TV——无需遥控器,无需 Siri。

基于 pyatv(Companion + AirPlay 协议)构建。姊妹项目 appletv-remote 以 Claude Code / opencode 技能的形式提供相同功能,而非服务器。

功能一览

工具

能力

atv_watch

"播放《人生切割术》"——JustWatch 搜索 → 深度链接直达影片(Apple TV+、Disney+、Max、Hulu、Prime、Peacock 等)

atv_youtube

通过 URL 或纯搜索词播放任意 YouTube 视频,通过 AirPlay 全屏播放(可选在 YouTube 应用内)

atv_open_url

打开任意深度链接;tvOS 会将其路由到对应应用

atv_launch_app / atv_list_apps

按友好名称启动应用;列出已安装应用

atv_remote

完整遥控:导航、确认、返回、主页、播放/暂停、停止、上一个/下一个、音量、睡眠/唤醒

atv_type

在聚焦的屏幕输入框(搜索框)中键入文字

atv_now_playing

当前播放内容:标题、状态、进度

atv_power

睡眠/唤醒,包括 HDMI-CEC 电视电源

atv_devices / atv_scan / atv_use

管理已配对电视和默认电视;发现网络上的电视

控制工具接受可选的 device 名称以指定非默认电视(atv_scanatv_devicesatv_use 除外——它们作用于配对配置本身)。

安装

前置条件: uvbrew install uv)。

  1. 每台电视配对一次(交互式;电视会两次显示 4 位 PIN 码):

uv run python scripts/pair.py

凭据以仅所有者可读的权限存储在 ~/.config/appletv-remote/devices.json 中(与 appletv-remote 技能共享)。请妥善保管该文件——它拥有对电视的完全控制权。

非交互式(代理驱动):设置 ATV_PIN_FILE=/tmp/atv_pin.txt,运行 pair.py <name-filter>,并将每个 PIN 码写入该文件。

  1. 向 MCP 客户端注册服务器。以 opencode 为例(~/.config/opencode/opencode.json):

"mcp": {
  "appletv": {
    "type": "local",
    "command": ["uv", "run", "--directory", "/path/to/appletv-mcp", "python", "server.py"],
    "enabled": true
  }
}

对于 Claude Code:claude mcp add appletv -- uv run --directory /path/to/appletv-mcp python server.py

注意事项与已知问题

  • pyatv 被固定在一个未合并分支的精确提交上,用于修复 tvOS 26 上的 play_url 问题(PR #2846,issue #2821/#2774)。合并并发布后,请切换回官方 pyatv

  • Netflix 深度链接不可靠,因其 2025 年 9 月的 tvOS 应用更新;atv_watch 会优雅降级,你也可以随时使用 atv_launch_app("netflix") + atv_type(...)

  • JustWatch 查询默认使用美国/英语;可通过 ATV_JW_COUNTRY / ATV_JW_LANGUAGE 覆盖。

  • YouTube 流通过 AirPlay 2 以 HLS 方式推送:播放会在电视上排队,工具返回后继续播放。URL 约 6 小时后过期。

  • 连接时出现 FetchAttentionState failed 警告属正常现象(分支特性);命令仍可正常工作。

  • 已在 tvOS 26(Apple TV 4K 第 3 代)上测试。tvOS 13+ 应可正常工作。

许可证

MIT

-
license - not tested
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

  • Control Android TV from any AI. 38 MCP tools: playback, recap, recommend, smart-home, schedules.

  • Control Unreal Engine to browse assets, import content, and manage levels and sequences. Automate…

  • Create and manage short links, track clicks, and automate URL management

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/slandau3/appletv-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server