mcp-gtv

mcp-gtv

MCP server for controlling Google TV devices via natural language. Enables key presses, text input, and app launching on paired devices.

Category
访问服务器

README

<div align="center">

TypeScript Node.js npm Experimental MIT

MCP server for Google TV — control paired devices (keys, text, app launch) via @kud/gtv.

FeaturesQuick StartMCP Client SetupTools ReferenceDevelopment

</div>

Proof of concept — experimental and unfinished. This package is not yet published to npm. The API, tool names, and behaviour may change or break at any time. Run it from source (see Development). Do not use in production.

@kud/mcp-gtv exposes Google TV control to any MCP client, letting an assistant open apps, control playback, type into search fields, and read back what's currently on the TV.

🌟 Features

  • 🔌 Zero credentials — reads paired devices from ~/.config/gtv/config.json; no API key, no token, no extra setup
  • 📺 Device switching — list all paired TVs and switch the active target at any time during a session
  • 🎮 Full remote control — send any key from navigation and media to volume, power, and input
  • ⌨️ IME text input — type arbitrary text into the focused field directly, without keycode mapping
  • 🚀 App launcher — launch Netflix, YouTube, Prime Video, Spotify, and more by name, or pass any raw deep-link URI
  • 📡 State feedback — every control tool returns the TV's resulting state (power, volume, foreground app) so the model can confirm its action landed
  • 🤖 Broad MCP client support — stdio transport works with Claude Desktop, Claude Code, Cursor, and any MCP-compatible client

🚀 Quick Start

1. Pair your TV first

Pairing is handled by @kud/gtv-cli, not this server. If you have not paired a device yet:

npx @kud/gtv-cli pair

Follow the PIN prompt on the TV. The paired device is written to ~/.config/gtv/config.json — the shared config store that mcp-gtv reads automatically. You only need to do this once per device.

2. Run the server from source

The package is not yet on npm. Clone the repo and run with tsx:

git clone https://github.com/kud/mcp-gtv.git
cd mcp-gtv
npm install
npm run dev

3. Ask naturally

Once an MCP client has the server connected:

"What's playing on the TV right now?" "Open Netflix" "Turn up the volume" "Go back to the home screen" "Type 'Blade Runner' into the search field"

What it's good at

This server works well for discrete, confirmable actions: opening apps, controlling playback, adjusting volume, typing into search, and checking what's currently on screen. It is not suited to navigating menus or lists inside an app — see Known Limitations.

🔧 MCP Client Setup

The server uses stdio transport and requires no environment variables.

Not yet on npm. The npx @kud/mcp-gtv form shown below will not work until the first publish. For now, use the local dev config instead.

Local development (current)

Add to .mcp.json in your project root, pointing at your local clone:

{
  "mcpServers": {
    "mcp-gtv": {
      "command": "npx",
      "args": ["tsx", "/path/to/mcp-gtv/src/index.ts"]
    }
  }
}

The repo also ships a .mcp.json at the root — open the repo in Claude Code and it will be picked up automatically.

Claude Desktop / Claude Code (once published)

{
  "mcpServers": {
    "mcp-gtv": {
      "command": "npx",
      "args": ["-y", "@kud/mcp-gtv"]
    }
  }
}

Claude Desktop — edit ~/Library/Application Support/Claude/claude_desktop_config.json.

Claude Code — add to .mcp.json in your project root, or to ~/.claude/mcp.json for global availability.

Cursor / other MCP clients

Use the same npx -y @kud/mcp-gtv command with stdio transport once published. Consult your client's documentation for the exact config location.

🛠 Tools Reference

Every control tool returns the TV's resulting state (connected, powered, foreground app, volume) so the model can confirm its action landed.

Tool Description Arguments
gtv_list_devices List all paired devices, marking the current one
gtv_set_device Switch the active device by host (IP) or name device: string
gtv_get_state Read live state: connected, powered, foreground app (package + friendly name), volume
gtv_send_key Send a remote key press; power and volume keys wait for the state echo key: string
gtv_type_text Type text into the focused field via IME text: string
gtv_launch_app Launch an app by catalog name/id or deep-link URI; waits for and returns the foreground app with a confirmed flag app: string

Valid keys for gtv_send_key

home  back  power  up  down  left  right  select
play  stop  next   prev  fwd  rwd
vol-up  vol-down  mute
menu  search  sleep  wakeup  input  enter
channel-up  channel-down  info  guide  settings

App catalogue for gtv_launch_app

ID App
netflix Netflix
youtube YouTube
primevideo Prime Video
plex Plex
putio Put.io
arte Arte
disney Disney+
spotify Spotify
twitch Twitch
max Max

You can also pass any raw deep-link URI directly (e.g. intent://... or market://launch?id=com.example.app).

⚠️ Known Limitations

  • No screen awareness. The Android TV Remote protocol only streams power state, volume, and foreground app package — never screen contents, focus position, or menu structure. The server can launch apps, control playback, type into search, and confirm those actions landed. It cannot see the screen, so navigating menus, folders, or lists inside an app is not reliably possible. Deep in-app navigation would require an ADB or computer-vision channel; that is deliberately out of scope.

  • Store-mediated app launching. App launch uses market://launch?id=<package>, which the Play Store may auto-launch OR simply display as a store listing (showing an "Open" button) even when the app is installed. Reliable direct launch is not available over the remote protocol. When the store page opens instead, send select to open the app.

  • Current device only. All tools act on the device selected by gtv_set_device (or the default from the config). Interactive pairing over MCP is not implemented — pair first with npx @kud/gtv-cli pair.

  • First-call latency. The first tool call in a session opens a TLS connection and waits for the TV's telemetry burst to settle (~350 ms quiet, capped at 2 s). Subsequent calls reuse the warm session and are near-instant.

🔧 Development

Project layout

mcp-gtv/
├── src/
│   └── index.ts        # MCP server — session management, all tool handlers
├── test/
│   └── tools.test.ts   # Unit tests (Node built-in test runner)
├── dist/               # Compiled output (tsup, gitignored)
├── .mcp.json           # Local MCP client config for dev (auto-loaded by Claude Code)
├── TESTING.md          # Manual test plan — run against a real TV before publishing
└── tsup.config.ts

Scripts

Script Purpose
npm run dev Run source directly with tsx
npm run build Compile to dist/ via tsup
npm run build:watch Watch mode
npm run test Run test suite (Node built-in runner)
npm run typecheck TypeScript type check only
npm run inspect Open MCP Inspector for interactive tool testing

Clone and run

git clone https://github.com/kud/mcp-gtv.git
cd mcp-gtv
npm install
npm run dev

Use npm run inspect to open the MCP Inspector and exercise all tools interactively without a full MCP client.

Testing

A manual test plan that covers every tool against a real TV lives in TESTING.md. Run through it before any publish.

Releasing

Releases are tag-driven via GitHub Actions with OIDC Trusted Publishers — no manual npm publish needed. The first publish has not happened yet; once the initial OTP bootstrap is done, subsequent releases will follow the tag workflow:

git tag v0.2.0
git push origin v0.2.0

🏗 Tech Stack

Package Role
@kud/gtv Google TV domain library — device store, key codes, app catalogue, remote connection
@modelcontextprotocol/sdk MCP server primitives (McpServer, StdioServerTransport)
zod Tool input schema validation
tsup ESM bundler / compiler
tsx TypeScript execution for dev and tests

Ecosystem

@kud/androidtv-remote   ← low-level pairing & remote protocol
       ↑
  @kud/gtv              ← domain library (devices, keys, apps)
       ↑
  ┌────┴────┐
  │         │
mcp-gtv   gtv-cli       ← MCP surface / terminal surface

This server is the MCP client surface of the ecosystem. @kud/gtv-cli is the interactive terminal counterpart — and the tool you use to pair devices before this server can control them.


MIT © kud — Made with ❤️

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选