TV Remote MCP
Controls Android TV / Google TV devices over ADB, supporting power, volume, navigation, app launch, input switching, and Wake-on-LAN.
Controls Google TV devices over ADB, supporting power, volume, navigation, app launch, input switching, and Wake-on-LAN.
Controls Panasonic Viera TVs via HTTP SOAP, supporting power, volume, navigation, app launch, input switching, and Wake-on-LAN.
Controls Roku TVs via HTTP ECP, supporting power, volume, navigation, app launch, input switching, and Wake-on-LAN.
Controls Samsung Tizen TVs via HTTP REST and WebSocket, supporting power, volume, navigation, app launch, input switching, and Wake-on-LAN.
Controls Sony Bravia TVs via HTTP REST/IRCC-over-HTTP, supporting power, volume, navigation, app launch, input switching, and Wake-on-LAN.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@TV Remote MCPTurn up the volume on my living room TV to 30 and launch Netflix"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
πΊ TV Remote MCP
Universal Smart TV Web Remote + Model Context Protocol (MCP) Server for AI Assistants.
Control any smart TV on your local network β from your phone's browser or using natural language with AI coding assistants (Claude, Hermes, Antigravity, Cursor, ChatGPT, Codex). Zero app stores, zero accounts, zero cloud dependencies. Works completely over local Wi-Fi.
π Live Web Remote: projects.shivalgupta.me/tv-remote-mcp/remote/
π Project Home: projects.shivalgupta.me/tv-remote-mcp/ (Mirror: Shival-Gupta.github.io/tv-remote-mcp)
π Documentation: Complete Docs & Setup Guides
π€ For AI Assistants & Crawlers (1-Prompt Automated Setup)
If you are an AI assistant (Claude Code, Hermes, Antigravity, Cursor, Codex) given the prompt:"""Install this https://github.com/Shival-Gupta/tv-remote-mcp"""
Run this single command:
python install.py(On Linux/macOS, you can also run ./install.sh)
What python install.py does automatically:
Installs Dependencies: Installs
requirements.txt(pywebostv,requests,websockets,fastmcp).Registers MCP Server: Automatically detects and writes configuration for:
Claude Desktop (
%APPDATA%\Claude\claude_desktop_config.jsonon Windows,~/Library/Application Support/Claude/on macOS,~/.config/Claude/on Linux).Cursor (
.cursor/mcp.json).
Installs Agent Skills: Automatically registers
smart-tv-controlin:Project
.agents/skills/smart-tv-control/(for Antigravity / Hermes)Project
.claude/skills/smart-tv-control/(for Claude Code)Machine global skills:
~/.gemini/config/skills/and~/.claude/skills/
Runs Self-Verification: Executes
tests/test_mcp_server.pyto verify that all 7 MCP server endpoints pass.Discovers Local TVs: Performs an initial Wi-Fi subnet probe and reports any reachable smart TVs.
AI Control Reference
Agent Skill Instructions: Read
skills/smart-tv-control/SKILL.mdClaude Instructions: Read
CLAUDE.mdDeveloper Guidelines: Read
AGENTS.mdMCP Tools:
universal_action(host, brand, action, arg): Executes TV actions (power_on,power_off,volume_up,volume_down,mute,volume_set,up,down,left,right,enter,back,home,media_play,media_pause,launch_app,set_input).discover(network): Scans local subnet for active smart TVs.list_brands(): Returns list of supported smart TV brands.
Direct CLI Execution (Zero Background Daemon Required):
python skills/smart-tv-control/scripts/tv_cli.py discover python skills/smart-tv-control/scripts/tv_cli.py power_on <ip> python skills/smart-tv-control/scripts/tv_cli.py action <ip> <brand> volume_up python skills/smart-tv-control/scripts/tv_cli.py launch <ip> <brand> youtube
Related MCP server: MCP Roku Control
π€ For Humans: Quick Start Guide
You can use TV Remote MCP in two ways: as a phone web remote or as an AI assistant integration.
Option A: Use the Phone Web Remote (Zero Install for Roku)
Open projects.shivalgupta.me/tv-remote-mcp/remote/ on your phone (connected to your home Wi-Fi).
For Roku TVs, enter your TV's IP address and select Roku β it works directly from the browser!
For LG, Samsung, Android TV, Sony, or Vizio, start the lightweight companion relay on your computer:
git clone https://github.com/Shival-Gupta/tv-remote-mcp.git cd tv-remote-mcp python install.py python server/relay.pyOn your phone, the remote will auto-detect the relay server or let you enter your computer's IP (e.g.
http://192.168.1.12:7070/remote/).
Option B: Use with AI Assistants (Claude, Cursor, Gemini)
Clone this repository:
git clone https://github.com/Shival-Gupta/tv-remote-mcp.git cd tv-remote-mcpRun the automated installer:
python install.pyRestart Claude Desktop or Cursor. Your AI assistant can now control your TV natively!
"Turn down the TV volume by 5 steps"
"Switch TV to HDMI 2"
"Turn off the TV when this build completes"
πΊ Supported Brands & Protocols
Brand | Protocol | Default Port(s) | Pairing Method | Wake-on-LAN (Power On) |
LG WebOS (3.0+) | WebSocket ( |
| Click "Yes" on TV screen | β Supported |
Samsung Tizen | HTTP REST + WebSocket |
| Accept on-screen popup | β Supported |
Roku TV | HTTP ECP |
| Zero pairing required | β Supported |
Android TV / Google TV | ADB |
| Allow Network Debugging prompt | β Supported |
Fire TV | ADB |
| Allow Network Debugging prompt | β Supported |
Sony Bravia | HTTP REST / IRCC-over-HTTP |
| Pre-Shared Key (PSK) or PIN | β Supported |
Vizio SmartCast | HTTPS REST |
| On-screen PIN pair | β Supported |
Philips (JointSpace) | HTTP REST |
| Digest Auth / PIN | β Supported |
Panasonic Viera | HTTP SOAP |
| None / PIN | β Supported |
TCL / Hisense | ADB / Roku ECP |
| Depends on OS | β Supported |
β‘ How It Works
π± Phone Web Remote βββββHTTPβββββΆ π₯οΈ Local Relay (relay.py) ββββSocketβββββΆ πΊ Smart TV
Port 7070 (on LAN)
π€ AI Assistant (Claude/MCP) ββββΆ π₯οΈ MCP Server (mcp-server.py) ββDirectβββββΆ πΊ Smart TV
Port 8000Browser Remote UI: Built with vanilla HTML5, CSS (Tailwind CDN), and JavaScript (<200KB total, zero build step, PWA-enabled with offline caching).
Local Relay (
server/relay.py): Runs on port7070. Bridges the browser to smart TVs over raw TCP/WebSocket ports that web browsers block due to CORS and mixed-content security policies.MCP Server (
server/mcp-server.py): Runs on port8000. Exposes FastMCP tools and an HTTP JSON-RPC bridge (/rpc) for AI assistants to control TVs programmatically.Smart Power & Wake-on-LAN (WoL): When TVs are turned off, their network ports close. TV Remote MCP uses a 5-packet UDP magic packet burst (broadcast + subnet + unicast) to wake the TV up. The smart power button in the remote automatically turns ON when the TV is asleep and OFF when the TV is active.
π Project Structure
tv-remote-mcp/
βββ install.py # Unified cross-platform installer (dependencies + MCP + skills + tests)
βββ install.sh # Unix/macOS one-click installer wrapper
βββ requirements.txt # Python package dependencies
βββ CLAUDE.md # Claude Code & Hermes agent instructions
βββ AGENTS.md # Antigravity & AI pair programmer instructions
βββ index.html # Landing page (GitHub Pages root)
βββ manifest.json # PWA web manifest
βββ sw.js # Service Worker (offline shell cache)
βββ remote/
β βββ index.html # Universal Smart TV Remote Control web application
βββ server/
β βββ relay.py # Local relay server (browser β TV bridge, port 7070)
β βββ mcp-server.py # FastMCP server & HTTP RPC bridge (port 8000)
βββ skills/
β βββ smart-tv-control/ # AI Agent Skill package
β βββ SKILL.md # Instructions, MCP signatures, natural language scenarios
β βββ scripts/
β β βββ tv_cli.py # Standalone CLI helper (discover, action, power_on, launch)
β βββ references/
β βββ brand-protocols.md # Detailed brand network port & auth specifications
β βββ app-ids.md # Popular streaming app IDs & HDMI input mappings
βββ tests/
β βββ test_mcp_server.py # 7-step automated MCP server test suite
β βββ test_lg_tv.py # 9-step physical hardware validation suite
βββ docs/ # Detailed guides (setup, pairing, brands, troubleshooting, AI)
βββ assets/ # Shared icons, CSS, and stylingπ Privacy & Security
100% Local: All commands travel strictly across your local home Wi-Fi network. No telemetry, no external API calls, and no cloud relay servers.
Credentials & Tokens: Pairing keys and tokens are stored exclusively in
tv-tokens/tokens.jsonon your local PC.Git Protection:
tv-tokens/,*.token,*.key, and.envfiles are strictly gitignored to prevent accidental credential leakage.
π§ͺ Testing & Validation
TV Remote MCP includes automated test suites to ensure reliable performance across hardware and MCP bridges:
# Test MCP Server (7/7 tests PASS)
python tests/test_mcp_server.py
# Test Physical Hardware (e.g. LG WebOS TV at 192.168.1.11)
python tests/test_lg_tv.pyβ Frequently Asked Questions (FAQ)
π€ Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details on code standards, atomic commits, and testing.
π License
This project is open source and licensed under the MIT License.
This server cannot be deployed
Maintenance
Related MCP Connectors
Control Android TV from any AI. 38 MCP tools: playback, recap, recommend, smart-home, schedules.
Give your AI agent the power to cast to your home TV and control an interactive canvas. By ArdaBot.
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
- mytesla.ioOAuthio.mytesla
Control your Tesla from your AI assistant - climate, charging, access, and security.
Related MCP Servers
- AlicenseBqualityAmaintenanceControl any smart TV with natural language β play Netflix/YouTube/Spotify by name, cast URLs, scene presets, multi-room audio, and multi-TV sync. Supports LG, Samsung, Android TV, Roku.2392 PyPI54MIT
- FlicenseAqualityDmaintenanceEnables AI assistants to control Roku TVs on the local network via natural language commands.6-
- AlicenseBqualityDmaintenanceEnables AI assistants to discover and control IoT devices on local networks and via Bluetooth LE.71MIT
- AlicenseNot gradedqualityDmaintenanceTurns AI assistants like Claude and ChatGPT into a remote control for LG webOS smart TVs, enabling power control, volume, app launching, input switching, and more, all locally without cloud APIs.5MIT