MCP Media Player is an MCP server that exposes playback controls for Home Assistant media players to AI agents. It connects directly to Home Assistant instances using REST endpoints and long-lived access tokens, enabling AI assistants such as Cursor to trigger playback actions on connected TVs, speakers, and projectors. Developers use this server to automate work breaks, pausing or playing media content in sync with their coding sessions. When integrated with development environments, the agent can automatically initiate playback while performing automated tasks or code generation, and pause the media player once the response or build is complete. By exposing simple media control tools over the Model Context Protocol, the server provides a straightforward mechanism to bridge smart home entertainment hardware with local development workflows without requiring full smart home management suites.
Category: Cloud & Infrastructure
Tags: home-assistant, iot, media-control, smart-home
sh git clone https://github.com/danielsims/mcp-media-player cd mcp-media-player 2. Install the necessary dependencies using Node.js 18 or higher: sh npm install 3. Copy mcp.json.example to your MCP configuration file (such as ~/.cursor/mcp.json) and configure the server path and environment variables: json { "mcpServers": { "MediaPlayer": { "command": "node", "args": [ "/absolute/path/to/your/media-player-mcp.js" ], "env": { "HA_URL": "http://your-ha-url:8123", "HA_TOKEN": "your_home_assistant_long_lived_token", "ENTITY_ID": "media_player.your_media_player_entity" } } } } 4. Optionally add the rules from cursor-rules.example into your Cursor rules configuration to automate play and pause actions during agent tasks. 5. Start the server directly using npm start or let your MCP client launch it automatically.Part of MCP Servers
MCP Media Player exposes play and pause tools over the Model Context Protocol for any media player entity managed by Home Assistant. This allows AI assistants to start or stop playback on smart TVs, speakers, and projectors automatically during active sessions.
The server works with any MCP-compliant client that supports command execution over standard input and output. It is specifically designed and documented for use within the Cursor editor, but it can run with other clients that accept standard environment configurations.
Running the server requires Node.js version 18 or higher to support native fetch and ES modules, an active Home Assistant instance accessible over your network, and a valid Home Assistant long-lived access token configured in your environment.
Yes, MCP Media Player is open source software released under the MIT license. You can inspect, modify, and contribute to the source code on GitHub.