Token导航 LogoToken导航

MCP Server · 开发工具

roku MCP

一个通过MCP协议和CLI控制Roku设备的工具,提供UI检查、远程输入、应用启动和测试功能。

stdio官方级别未说明来源级核验工具 26roku-mcp
开发工具TypeScriptClaudeCursorWindsurf

快速开始

作者 / 组织
danecodes
提供方
danecodes
运行时
Node.js

工具数量

26

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

3

仓库热度

收录来源

1 个

MCP World

选型结论

roku MCP 属于开发工具类 MCP Server,公开资料标注 26 个工具,通过stdio 本地进程接入,适配 Claude、Cursor、Windsurf,有可以直接复制的安装命令;接入前先确认权限范围。

分类

开发工具

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

npx roku-mcp ui tree --device 192.168.0.30

客户端配置示例

{
  "mcpServers": {
    "roku-mcp": {
      "command": "npx",
      "args": [
        "roku-mcp",
        "ui",
        "tree",
        "--device",
        "192.168.0.30"
      ]
    }
  }
}

按公开安装命令拼出来的示例,字段名和参数以仓库 README 为准;带 YOUR_API_KEY 这类占位符的位置记得换成自己的值。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 26 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

年份-MCP

MCP服务器和CLI,允许AI代理(和开发人员)与Roku设备交互。

您的编码代理可以看到Roku屏幕上的内容,发送远程控制输入,并查询设备状态——所有这些都可以通过 模型上下文协议 或者一个简单的CLI。

它的作用

  • 检查UI --查询SceneGraph节点树,截取屏幕截图,使用类似CSS的选择器查找元素
  • 发送输入 --遥控键、文本输入
  • 发射和副载 --启动频道,深度链接到内容,部署开发版本
  • 测试 --烟雾测试、飞行前证书检查、CPU采样、控制台错误监控
  • 查询状态 --设备信息、媒体播放器、活动应用程序、已安装应用程序、调试控制台
  • 应用程序上下文 --下降a roku-app.md 项目中的文件,每个连接的代理都会学习应用程序的导航

配置

设置您的Roku设备IP地址:

  • MCP服务器: 集 ROKU_DEVICE_IP MCP配置中的环境变量(见下文)
  • CLI: 使用 --device 标志(默认为 192.168.0.30)
  • 屏幕截图: 集 ROKU_DEV_PASSWORD 如果您的开发密码不是 rokudev

应用程序上下文(可选)

丢一个 roku-app.md 项目根目录中的文件,教代理如何导航您的特定应用程序:

## Crunchyroll Navigation
Left-side nav menu: Home, Browse, Simulcasts, My Lists, Settings.
Press Left from any content screen to open it.
Browse has genre rows — Select a genre to see the content grid.
Search is accessible from the top of the nav menu.

MCP服务器在启动时读取此文件,并将其附加到发送给每个连接的代理的指令中。不需要配置——如果文件存在,就使用它。

要使用其他路径,请设置 ROKU_APP_CONTEXT 环境变量:

{
  "env": {
    "ROKU_APP_CONTEXT": "/path/to/my-app-context.md"
  }
}

快速开始

作为MCP服务器(Claude Code、Cursor、Windsurf等)

添加到您的 .mcp.json (项目根或 ~/.claude/.mcp.json 全球):

{
  "mcpServers": {
    "roku": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "--package", "@danecodes/roku-mcp", "roku-mcp-server"],
      "env": {
        "ROKU_DEVICE_IP": "192.168.0.30"
      }
    }
  }
}

要自动批准所有Roku工具调用(这样您就不会每次都收到提示),请添加 ~/.claude/settings.json:

{
  "permissions": {
    "allow": ["mcp__roku"]
  }
}

作为MCP服务器(GitHub Copilot/VS代码)

Copilot需要HTTP传输。首先在终端中启动服务器:

ROKU_DEVICE_IP=192.168.0.30 npx --package @danecodes/roku-mcp roku-mcp-http
# roku-mcp HTTP server running at http://localhost:3141/mcp

然后添加到 .vscode/mcp.json 在您的项目中:

{
  "servers": {
    "roku": {
      "type": "http",
      "url": "http://localhost:3141/mcp"
    }
  }
}

在自定义端口上运行 ROKU_MCP_PORT=8888.

作为MCP服务器(OpenAI Codex CLI)

添加 ~/.codex/config.toml (全球)或 .codex/config.toml (项目范围):

[mcp_servers.roku]
command = "npx"
args = ["-y", "--package", "@danecodes/roku-mcp", "roku-mcp-server"]

[mcp_servers.roku.env]
ROKU_DEVICE_IP = "192.168.0.30"

您的代理现在拥有以下工具:

设备控制

工具说明
roku_ui_tree获取完整的SceneGraph UI树——查看屏幕上的内容
roku_find_element通过类似CSS的选择器查找元素
roku_press_key发送遥控器按键(选择、向上、向下等)
roku_type_text在键盘输入中键入文本
roku_screenshot截图,可选择保存到磁盘
roku_launch启动一个带有可选深度链接参数的频道
roku_deep_link通过ID直接深度链接到内容
roku_close_app关闭正在运行的应用程序(按Home)
roku_sideload将.zip包部署到设备
roku_device_info获取设备型号、软件版本、网络信息
roku_active_app获取当前正在运行的应用程序
roku_media_player获取播放状态(位置、持续时间、格式)
roku_installed_apps列出所有已安装的频道
roku_console_log读取BrightScript调试控制台输出(错误、打印语句、崩溃)
roku_console_command发送调试命令(bt、var、cont、step、over、out)
roku_volume调高、调低或静音
roku_input将自定义输入参数发送到正在运行的应用程序

试运行器(左移)

工具说明
roku_wait_for轮询,直到屏幕上出现具有可配置超时的选择器——在导航后使用
roku_assert_element断言元素存在、聚焦或具有特定属性值——返回通过/失败JSON
roku_sideload_and_watch侧载zip+监视控制台以查看错误/崩溃——返回CI就绪通过/失败报告
roku_smoke_test启动应用程序,验证UI渲染,可选地验证播放——完整通过/失败,包括步骤详细信息

代理效率

工具说明
roku_focused_element仅返回当前聚焦的元素——全树扫描的令牌高效替代方案
roku_screen_name从SceneGraph根组件推断当前屏幕名称
roku_console_watch在时间窗口内监控模式匹配的控制台——匹配行通过/失败

左移质量门

工具说明
roku_cert_preflight运行Roku证书故障检查表(返回导航、主退出、重新启动、错误扫描)
roku_chanperf_sample通过chanperf在可配置的持续时间内采样CPU使用情况——高水印+通过/失败

作为CLI

# Inspect the UI tree
npx roku-mcp ui tree --device 192.168.0.30
npx roku-mcp ui tree --depth 4
npx roku-mcp ui tree --all-attrs

# Find specific elements
npx roku-mcp ui find "HomePage HomeHeroCarousel"
npx roku-mcp ui find "AppLabel" --all-attrs

# See what's focused, what screen you're on, or get raw XML
npx roku-mcp ui focused
npx roku-mcp ui screen
npx roku-mcp ui source

# Take a screenshot
npx roku-mcp ui screenshot -o screen.png

# Send key presses
npx roku-mcp press Select
npx roku-mcp press Down --times 3 --delay 200

# Type text
npx roku-mcp type "search query"

# Launch apps
npx roku-mcp launch dev
npx roku-mcp launch dev --params '{"contentId":"12345","mediaType":"episode"}'

# Device info
npx roku-mcp info device
npx roku-mcp info app
npx roku-mcp info apps
npx roku-mcp info player

# Debug console
npx roku-mcp console log
npx roku-mcp console log --filter "error"
npx roku-mcp console send bt

# Test runner
npx roku-mcp test sideload-watch ./build.zip --duration 30000
npx roku-mcp test smoke --content-id GG5H5XQ7R --media-type episode
npx roku-mcp test cert-preflight
npx roku-mcp test chanperf --duration 15000 --threshold 70
npx roku-mcp test wait "HomeScreen" --timeout 10000
npx roku-mcp test assert "#playButton" --assertion focused

作为一个图书馆

ECP客户端单独发布为 @danecodes/roku-ecp --如果你想用自己的代码控制Roku设备,请使用它:

import { EcpClient, Key, parseUiXml, findElement } from '@danecodes/roku-ecp';

const roku = new EcpClient('192.168.0.30');

// Send keys
await roku.press(Key.Down, { times: 3 });
await roku.press(Key.Select);

// Inspect the UI
const xml = await roku.queryAppUi();
const tree = parseUiXml(xml);
const button = findElement(tree, 'AppButton#play_button');
console.log(button?.attrs.focused); // "true"
console.log(button?.attrs.text);    // "Play"

// Query state
const player = await roku.queryMediaPlayer();
const app = await roku.queryActiveApp();

选择器语法

使用类似CSS的选择器对SceneGraph节点名称查找元素:

选择器匹配项
HomePage带标签的节点 HomePage
AppButton#play_buttonAppButton 随着 name="play_button"
#titleLabel任何节点 name="titleLabel"
HomePage HomeHeroCarouselHomeHeroCarousel 里面的任何地方 HomePage
LayoutGroup > AppLabelAppLabel 这是一个直接的孩子 LayoutGroup
AppButton:nth-child(1)首先 AppButton 兄弟姐妹之间
CollectionModule + CollectionModuleCollectionModule 紧接着另一个
A ~ B一般兄弟姐妹——全部 B 之后 A
[focused="true"]属性值匹配
[text*="Log"]属性包含子字符串
[text^="Episode"]属性以开头
[uri$=".png"]属性以结尾
[visible]属性存在
AppButton:has(AppLabel[text="Play"])包含匹配子项的父项
AppButton:not([focused="true"])否定
:first-child, :last-child, :only-child位置伪类
:empty没有子节点的节点
LinearCard, SlantedCard逗号组--匹配其中之一
*通用--匹配任何节点

烟雾测试演示

将编码代理指向开发版本,它将进行侧载、测试和报告——对输出进行截图并将其发送给您的经理。

You: Sideload the build at ./target/crunchyroll-dev.zip and run a smoke test.
     Deep link to content ID "GG5H5XQ7R" (episode) and verify playback starts.

Agent: I'll sideload the build and watch the console for errors first.

  → roku_sideload_and_watch(zip_path: "./target/crunchyroll-dev.zip", duration: 30000)

  {
    "passed": true,
    "message": "PASS: Install Success — no errors in 30s of console output",
    "sideload_result": "Install Success",
    "errors": [],
    "crashes": [],
    "exceptions": []
  }

Agent: Clean install. Now running the smoke test with playback verification.

  → roku_smoke_test(
      content_id: "GG5H5XQ7R",
      media_type: "episode",
      ui_timeout: 15000,
      playback_timeout: 30000
    )

  {
    "passed": true,
    "message": "PASS: App launched, UI rendered, and playback started",
    "steps": [
      { "name": "launch",     "passed": true, "message": "Deep linked to \"GG5H5XQ7R\" in channel dev" },
      { "name": "ui_visible", "passed": true, "message": "UI rendered after 2340ms", "elapsed_ms": 2340 },
      { "name": "playback",   "passed": true, "message": "Player reached \"play\" after 8710ms", "elapsed_ms": 8710 }
    ],
    "player_state": {
      "state": "play",
      "error": false,
      "position": "00:00:08",
      "duration": "00:42:17"
    }
  }

Agent: All green. Build sideloaded cleanly, UI rendered in 2.3s, playback started in 8.7s.

所有测试命令在失败时都会以代码1退出,使其对CI友好。

在聊天中使用它

您可以通过AI助手与Roku对话。代理使用MCP工具导航、检查和截图设备:

You: Go to the browse screen, select the Action genre, and take a screenshot for me

Agent: I'll take a screenshot to see where we are first.

  → roku_screenshot()

Agent: We're on the Home screen. I'll open the nav menu and find Browse.

  → roku_press_key(key: "Left")
  → roku_screenshot()

Agent: Nav menu is open. Browse is two items down.

  → roku_press_key(key: "Down", times: 2)
  → roku_press_key(key: "Select")
  → roku_screenshot()

Agent: We're on Browse. I can see genre rows — Action is 4 rows down.

  → roku_press_key(key: "Down", times: 4)
  → roku_press_key(key: "Select")
  → roku_screenshot(save_path: "./screenshots/action_genre.png")

Agent: Done — screenshot saved. We're on the Action genre grid.

代理通过截图查看屏幕,决定按下什么键,并验证结果——所有这些都是通过自然对话完成的。

运作原理

关键端点是 GET /query/app-ui 它以XML格式返回完整的SceneGraph节点树。roku-ecp解析该XML,并允许您使用类似CSS的选择器进行查询。

需求

  • 同一网络上处于开发者模式的Roku设备
  • Node.js 18+

许可证

麻省理工学院

工具与能力

工具数量

26

资源数量

0

提示词数量

0

能力标签

Roku控制TypeScript本地部署UI自动化设备测试开发者工具MCP协议

支持客户端

ClaudeCursorWindsurf

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

  • 工具数量 26 个,一次接入能覆盖的操作比单点工具更全。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude、Cursor、Windsurf,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好 Node.js,换机器要重新装一遍。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
roku MCP

MCP World · 本页

26stdio有1 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

roku MCP 怎么安装?

公开资料给出的安装命令是 npx roku-mcp ui tree --device 192.168.0.30,运行环境为 Node.js。装完后按客户端要求写进 MCP 配置,重启客户端生效。

roku MCP 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Node.js;保存后完全退出客户端再打开,配置才会生效。

roku MCP 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

roku MCP 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

roku MCP 支持哪些客户端?

公开资料标注支持 Claude、Cursor、Windsurf;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP