Skip to main content
Glama
dominick253

roku-debug-mcp

by dominick253

roku-debug-mcp

CI Python License MCP

AI 에이전트에게 완전한 VS Code Roku 디버그 경험을 제공하는 MCP 서버입니다.

Roku의 BrightScript 디버깅 기능을 MCP 도구로 노출하여 AI 에이전트가 로그를 읽고, 씬 그래프를 검사하고, 코드를 단계별로 실행하고, 변수를 읽고, 중단점을 설정할 수 있게 합니다. 이는 개발자가 VS Code Roku 확장 프로그램에서 보는 것과 동일한 정보입니다.

아키텍처

graph TB
    subgraph "AI Agent (Hermes, VS Code, etc.)"
        MCP[<b>MCP Client</b><br/>stdio JSON-RPC]
    end

    subgraph "roku-debug-mcp (MCP Server)"
        Server[<b>MCP Server</b><br/>21 tools]
        Config[<b>Config</b><br/>ROKU_* env vars]
        Server --> Config
    end

    subgraph "Roku Device"
        direction LR

        subgraph "Port 80 — HTTP"
            Installer[<b>Sideloader</b><br/>Digest auth<br/>Expect: 100-continue]
        end

        subgraph "Port 8060 — ECP"
            ECP[<b>ECP Client</b><br/>Device info<br/>Scene graph<br/>Postback/keys]
        end

        subgraph "Port 8081 — Binary Debug"
            Debug[<b>Debug Client</b><br/>Binary protocol<br/>BSDBG magic]
        end

        subgraph "Port 8085 — Telnet"
            Console[<b>Text Console</b><br/>Fallback logs]
        end
    end

    MCP --> Server
    Server --> Installer
    Server --> ECP
    Server --> Debug
    Server --> Console

프로토콜 계층

포트

프로토콜

인증

용도

80

HTTP

Digest + Expect: 100-continue

채널 사이드로드

8060

ECP HTTP

없음

기기 정보, 씬 그래프, 스크린샷

8081

바이너리

없음

기본 디버그 프로토콜 (VS Code에서 사용)

8085

Telnet

없음

텍스트 콘솔(대체)

바이너리 디버그 프로토콜 (포트 8081)

sequenceDiagram
    participant C as Client (roku-debug-mcp)
    participant R as Roku Device (port 8081)

    C->>R: Handshake<br/>[magic(8)][protocol_version(4)]
    R-->>C: [magic(8)][protocol_version(4)][packet_len(4)][revision]

    Note over C,R: Request/Response Format:<br/>[packet_length(4)][request_id(4)][cmd_code(4)][payload]

    C->>R: GET_THREADS (cmd=3)
    R-->>C: THREADS response

    C->>R: STACKTRACE (cmd=4, thread_index)
    R-->>C: Stack frames

    C->>R: ADD_BREAKPOINTS (cmd=7)
    R-->>C: Confirmation

    Note over C,R: Update notifications (request_id=0):<br/>CONNECT_IO_PORT, ALL_THREADS_STOPPED, etc.

핸드셰이크 매직: 0x0067756564757362 (b"bsdebug\0" 리틀엔디언)

사이드로딩 흐름 (포트 80)

sequenceDiagram
    participant C as Client
    participant R as Roku (port 80)

    C->>R: POST /plugin_package (Expect: 100-continue)
    R-->>C: 401 Unauthorized (WWW-Authenticate: Digest)
    C->>C: Compute digest hash
    C->>R: POST /plugin_package (Authorization: Digest)
    R-->>C: 100 Continue
    C->>R: [ZIP payload]
    R-->>C: 200 OK [chunked response with Dev Kit HTML]

Related MCP server: Node.js Debugger MCP

AI가 할 수 있는 작업

  • 기기 정보 읽기 — 모델, 버전, 현재 실행 중인 앱

  • 씬 그래프 검사 — 실행 중인 앱의 전체 노드 계층 구조

  • 콘솔 로그 읽기 — 실행 중인 BrightScript 채널의 stdout

  • 스레드 나열 — 모든 실행 스레드와 중지 상태 확인

  • 스택 추적 읽기 — 중지된 스레드의 프레임별 호출 스택

  • 변수 검사 — 로컬, 전역 및 씬 그래프 구성 요소 상태

  • 코드 실행 — 중지된 프레임에서 임의의 BrightScript 실행

  • 중단점 관리 — 파일/줄별 중단점 추가, 나열, 제거

  • 단계별 실행 — 프로시저 단위 실행, 한 단계씩 실행, 프로시저 나가기 또는 계속

  • 채널 사이드로드 — 원격 디버그로 테스트 채널 업로드 및 설치

빠른 시작

1. 설치

cd /home/dom/src/roku-debug-mcp
pip install -e .

2. 환경 구성

export ROKU_DEVICE_IP=192.168.1.10      # Roku device IP
export ROKU_DEV_USER=rokudev            # Dev channel username
export ROKU_DEV_PASSWORD=your-password  # Dev channel password

3. Hermes에 등록

~/.hermes/mcp-servers.json에 추가:

{
  "roku-debug-mcp": {
    "command": "roku-debug-mcp",
    "args": []
  }
}

4. Hermes 세션에서 사용

이제 AI 에이전트가 21개의 새로운 도구에 액세스할 수 있습니다:

roku_device_info()
roku_scene_graph()
roku_debug_threads()
roku_debug_stacktrace(thread_index=0)
roku_debug_variables(thread_index=0, frame_index=0)
roku_debug_execute(thread_index=0, frame_index=0, code="x = 42")
roku_debug_breakpoints_add(breakpoints=[{...}])
roku_debug_console_output()

사용 가능한 도구

기기 / UI 도구 (ECP — 포트 8060)

도구

설명

roku_device_info

기기 모델, 버전 등

roku_current_app

현재 실행 중인 앱

roku_scene_graph

전체 씬 그래프 노드 계층 구조

roku_postback

채널에 포스트백 전송

roku_launch_uri

URI 실행

roku_key

리모컨 키 전송

roku_screenshot

화면 이미지 캡처

디버그 도구 (바이너리 프로토콜 — 포트 8081)

도구

설명

roku_debug_threads

모든 스레드 나열

roku_debug_stacktrace

스택 프레임 가져오기

roku_debug_variables

프레임의 변수 읽기

roku_debug_execute

BrightScript 코드 실행

roku_debug_breakpoints_add

중단점 추가

roku_debug_breakpoints_list

활성 중단점 나열

roku_debug_breakpoints_remove

특정 중단점 제거

roku_debug_breakpoints_remove_all

모든 중단점 지우기

roku_debug_continue

실행 재개

roku_debug_step

단계별 실행

roku_debug_stop

실행 일시 중지

roku_debug_console_output

stdout 줄 가져오기

roku_debug_protocol_info

디버그 프로토콜 버전

설치 프로그램 도구 (HTTP — 포트 80)

도구

설명

roku_install

채널 ZIP 사이드로드

roku_launch_remote_debug

원격 디버깅을 활성화하여 실행

테스트

단위 테스트 (목 Roku 서버)

# Run all tests (uses mock server on ephemeral ports)
pytest tests/ -v

# Mock server runs automatically via conftest fixtures
# No manual setup required

통합 테스트 (실제 Roku 기기)

# Requires env vars set
ROKU_DEV_IP=10.71.71.151 \
ROKU_DEV_PASSWORD=your-password \
pytest tests/test_integration_real_device.py -v

CI/CD

  • 단위 테스트는 GitHub Actions Ubuntu 러너에서 실행

  • 통합 테스트는 실제 Roku에 LAN으로 접근 가능한 자체 호스팅 러너(10.71.71.90)에서 실행

프로젝트 구조

src/rokumcp/
  config.py          # Environment-based configuration
  protocol.py        # Binary protocol constants and Stream I/O
  debug_client.py    # Synchronous binary debug client (port 8081)
  text_console.py    # Telnet text console client (port 8085)
  ecp.py             # ECP HTTP client (port 8060)
  installer.py       # HTTP Digest-auth sideloader (port 80)
  server.py          # MCP server entrypoint — 21 tools

tests/
  conftest.py                  # Pytest fixtures (mock server setup)
  mock_roku_server.py          # Mock Roku device simulator
  test_protocol.py             # Stream round-trips, ProtocolVersion
  test_config.py               # Config defaults, from_env
  test_ecp.py                  # ECP HTTP client
  test_text_console.py         # Telnet console client
  test_installer.py            # Digest auth + multipart
  test_debug_client.py         # Full E2E vs mock binary server
  test_integration_real_device.py  # Real device (gated on env vars)
  fixtures/                    # Test channel ZIP fixtures

프로토콜 참조

Roku 공식 참조 자료에서 파생된 구현입니다:

전체 프로토콜 사양과 와이어 형식은 AGENTS.md를 참조하세요.

개발

프로토콜 디버깅

# Run mock server manually
python tests/mock_roku_server.py

# Test specific protocol interaction
ROKU_DEVICE_IP=127.0.0.1 ROKU_DEBUG_PORT=8081 python -m rokumcp.server

빌드

pip install -e .
roku-debug-mcp  # runs MCP server over stdio

라이선스

Apache-2.0

Install Server
A
license - permissive license
A
quality
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 Servers

  • A
    license
    C
    quality
    A
    maintenance
    Enables AI agents to perform step-through debugging of Python, JavaScript/Node.js, and Rust programs using the Debug Adapter Protocol, with support for breakpoints, variable inspection, and stack traces.
    21
    159
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI agents to develop, test, and certify Roku applications by providing direct control over device functions like app deployment, remote input, and SceneGraph inspection. It supports automated workflows including real-time log collection, media monitoring, and certification verification.
    1

View all related MCP servers

Related MCP Connectors

  • Live browser debugging for AI assistants — DOM, console, network via MCP.

  • Agent Replay Debugger MCP — record every agent step + deterministic replay. Step-debugger for

  • Shared debugging memory for AI coding agents

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/dominick253/roku-debug-mcp'

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