lg-tv-mcp
Turns 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.
README
lg-tv-mcp
עברית: מדריך למשתמש בעברית בהמשך העמוד ומדריך התקנה מלא ב־docs/client-installation-he.md.
A local MCP server that turns an AI assistant — Claude Code, Claude Desktop, ChatGPT Work, or any MCP client — into a remote control for LG webOS smart TVs.
Everything runs on your home network: a hand-rolled SSAP websocket client with first-run pairing, the webOS button-input socket, Wake-on-LAN power-on, and mDNS re-discovery when the TV's IP changes. No cloud APIs, no accounts, no telemetry.
Tools
| Tool | What it does |
|---|---|
get_status |
Power, pairing state, current app, volume — no side effects |
power_on |
Wake-on-LAN magic packet; TV boots in ~15 s |
power_off |
Turn the TV off over SSAP |
set_volume |
Set level 0–100, or mute/unmute |
press_button |
Remote buttons (arrows, OK, back, play/pause, digits…), with optional repeat |
list_apps / launch_app |
Enumerate and open apps (Netflix, YouTube, …) |
switch_input |
Switch HDMI inputs |
set_channel |
Change Live TV channels |
type_text |
Type into the focused text field |
show_notification |
Toast message on the TV screen |
screenshot |
960×540 JPEG of the current screen (DRM-protected video captures as black; app UI renders fine) |
measure_sound_level |
Room loudness via the laptop microphone: approximate dB SPL + band (silent/quiet/moderate/loud/very-loud). Loop it with set_volume to hit a target level |
calibrate_sound_meter |
One-time mic calibration against a phone SPL-meter reading; the offset persists in config.json |
Requirements
- Node.js ≥ 22.13
- An LG webOS TV on the same network as the machine running the server
- For powering on while the TV is off: enable Settings → General → Turn on via Wi-Fi on the TV (wording varies by webOS version), and set your TV's MAC address in the config — see Configuration
ffmpegfor the sound-meter tools (brew install ffmpeg); macOS microphone permission is requested from the hosting app on first capture.
Install
Not yet on npm — install from a clone:
git clone https://github.com/OmerLapidot/lg-tv-mcp.git
cd lg-tv-mcp
npm ci
Claude Code
claude mcp add lg-tv-remote --scope user -- node /absolute/path/to/lg-tv-mcp/server/index.js
Claude Desktop / any MCP client
{
"mcpServers": {
"lg-tv-remote": {
"command": "node",
"args": ["/absolute/path/to/lg-tv-mcp/server/index.js"]
}
}
}
ChatGPT Work (desktop plugin)
npm run plugin:release builds dist/plugin/ with the plugin manifest, skill, and icon; the release runtime pins npx -y @omerlapidot/lg-tv-mcp@<version> (npm publish is a separate release step). Installation walkthrough (Hebrew): docs/client-installation-he.md.
First run — pairing
- Turn the TV on with the physical remote (first time only) and ask the assistant something harmless like "what's the TV status?" —
get_statusworks unpaired. - The first control call (volume, buttons, apps…) pops a pairing prompt on the TV screen. Accept it with the physical remote within a minute.
- That's it — the TV issues a client key, saved locally. The prompt never appears again unless you revoke the pairing on the TV (Settings → General → External Devices → Connection Manager).
Configuration
State lives in a single JSON file (created and updated automatically):
- macOS:
~/Library/Application Support/lg-tv-mcp/config.json - Windows:
%APPDATA%\lg-tv-mcp\config.json
| Field | Meaning |
|---|---|
hostname |
mDNS name tried when the last-known IP stops answering. LGwebOSTV.local is the LG factory default, so this usually just works. |
ip |
Last-known IPv4 of the TV. Auto-updated whenever discovery finds the TV at a new address. |
mac |
The TV's Wi-Fi MAC, used only for Wake-on-LAN. The repo default is a placeholder — set your own (shown on the TV under Settings → Network → Wi-Fi Connection → Advanced) or power_on cannot wake a TV that is fully off. |
clientKey |
Pairing key issued by the TV on first approval; null until paired. |
micCalibrationOffsetDb |
Optional. dBFS→dB SPL offset stored by calibrate_sound_meter; absent until first calibration (a rough default of +100 is used, flagged calibrated: false). |
Environment overrides: LG_TV_DATA_DIR (config directory), LG_TV_URL (skip discovery and connect to a fixed ws:///wss:// URL — used to point at the fake TV in tests), LG_TV_REGISTER_TIMEOUT_MS (pairing prompt timeout).
Security notes
- The client key works only from inside your LAN and can only control this TV; it contains no account credentials.
- The TV serves SSAP and screen captures over TLS with a self-signed certificate, so certificate validation is intentionally disabled for those LAN-only connections.
- Nothing leaves your network; there is no cloud relay.
Development
npm ci
npm test # full suite against an in-process fake TV — no hardware needed
npm run plugin:release # build dist/plugin for ChatGPT Work
Layout: server/ (config, discovery, SSAP client, input socket, Wake-on-LAN, MCP server), test/ (node:test suite plus test/fixtures/fake-tv.mjs, a scripted SSAP TV), skills/ (assistant-facing usage skill), docs/superpowers/ (original design spec and implementation plan).
Quirks worth knowing: the reported model string is a constant (LG 65NANO80VNA — the TV this was built for), and user-facing error messages are in Hebrew, since that's the household it serves. PRs welcome.
License
MIT © Omer Lapidot
<div dir="rtl">
שלט לטלוויזיה — עברית
תוסף מקומי שהופך את ChatGPT (או Claude) לשלט רחוק לטלוויזיית LG webOS ברשת הביתית: הדלקה וכיבוי, ווליום, פתיחת אפליקציות כמו נטפליקס ויוטיוב, החלפת כניסות HDMI, ערוצים, הקלדת טקסט, הודעות על המסך וצילום של מה שמוצג על המסך.
הכול מקומי. התקשורת היא ישירות מהמחשב לטלוויזיה ברשת הביתית (websocket מקומי + Wake-on-LAN). שום דבר לא עובר בענן.
התקנה
המדריך המלא: docs/client-installation-he.md. בקצרה:
- מתקינים את התוסף שלט לטלוויזיה ביישום ChatGPT Work למחשב.
- מפעילים מחדש את ChatGPT, פותחים משימה וכותבים: "מה מצב הטלוויזיה?".
- בפקודת השליטה הראשונה יופיע על מסך הטלוויזיה חלון אישור — מאשרים פעם אחת עם השלט הפיזי, וזהו.
- כדי שההדלקה מרחוק תעבוד, מפעילים בטלוויזיה את ההגדרה Turn on via Wi-Fi.
</div>
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。