This MCP server exposes BraviaRC functionality as tools for controlling Sony Bravia TVs through the Model Context Protocol.
The server provides the following tools for controlling Sony Bravia TVs:
- bravia_connect: Connect to a Sony Bravia TV using PIN authentication
- bravia_get_power_status: Get the power status of the TV
- bravia_turn_on: Turn on the TV (supports Wake-on-LAN)
- bravia_turn_off: Turn off the TV
- bravia_get_volume_info: Get volume information
- bravia_set_volume: Set volume level (0.0 to 1.0)
- bravia_volume_up: Increase volume
- bravia_volume_down: Decrease volume
- bravia_mute_toggle: Toggle mute
- bravia_get_playing_info: Get information about currently playing content
- bravia_send_command: Send remote control commands
- bravia_get_apps: Get list of installed applications
- bravia_start_app: Start an application
- bravia_get_sources: Get list of available input sources
- bravia_select_source: Select an input source
- bravia_get_system_info: Get system information
Install the required dependencies:
pip install -r requirements.txt
Before using the MCP server, you need to enable remote control on your Sony Bravia TV:
- On your Sony Bravia TV, go to Settings
- Navigate to Network & Internet → Home Network
- Enable IP Control or Remote Start
- Enable Authentication and set it to Normal and Pre-Shared Key
- Some models: Settings → Network → Professional Display Settings → IP Control
- Restart the TV after making these changes
Once the MCP server is configured and running, you can use the tools through your MCP client:
{
"tool": "bravia_connect",
"arguments": {
"host": "192.168.1.100",
"pin": "0000"
}
}
Note: Use PIN "0000" to get a pairing request displayed on the TV screen, then use the PIN shown on the TV.
{
"tool": "bravia_get_power_status",
"arguments": {
"host": "192.168.1.100"
}
}
{
"tool": "bravia_turn_on",
"arguments": {
"host": "192.168.1.100",
"mac": "AA:BB:CC:DD:EE:FF"
}
}
{
"tool": "bravia_set_volume",
"arguments": {
"host": "192.168.1.100",
"volume": 0.5
}
}
{
"tool": "bravia_send_command",
"arguments": {
"host": "192.168.1.100",
"command": "Home"
}
}
{
"tool": "bravia_start_app",
"arguments": {
"host": "192.168.1.100",
"app_name": "Netflix"
}
}
Common remote control commands include:
- Navigation:
Home
,Up
,Down
,Left
,Right
,Confirm
,Back
- Media:
Play
,Pause
,Stop
,Next
,Prev
- Volume:
VolumeUp
,VolumeDown
,Mute
- Power:
TvPower
- Numbers:
Num1
,Num2
,Num3
, etc. - Colors:
Red
,Green
,Yellow
,Blue
- Verify the TV is powered on and connected to the network
- Check if the IP address is correct
- Ensure the TV's remote control API is enabled in settings
- Try pinging the TV to verify network connectivity
- Check if any firewall is blocking the connection
- Use PIN "0000" to initiate pairing and get the actual PIN from the TV screen
- Make sure "Authentication" is enabled in TV settings
- Try restarting the TV after changing network settings
- Ensure you're connected to the TV before sending commands
- Some commands may only work when the TV is in specific states
- Check the TV's current input source if media commands aren't working
The project includes a comprehensive test suite to verify both MCP server functionality and TV connectivity:
python test_mcp_server.py
This tests:
- Tool listing functionality
- Error handling for invalid tools
- Parameter validation
- Basic MCP protocol compliance
python test_mcp_server.py <TV_IP_ADDRESS>
Example:
python test_mcp_server.py 192.168.1.100
This tests:
- Basic MCP server functionality
- TV connectivity and power status
- System information retrieval
- Volume control functionality
- Available sources and apps
- Remote command sending
- Authentication flow (with PIN pairing)
python test_mcp_server.py <TV_IP_ADDRESS> --interactive
Example:
python test_mcp_server.py 192.168.1.100 --interactive
This enables interactive PIN entry during authentication testing:
- First attempts connection with PIN "0000" to trigger pairing request on TV
- Prompts you to enter the actual PIN displayed on your TV screen
- Tests the connection with the real PIN
- Verifies the authenticated connection works properly
--skip-auth
: Skip the authentication test to avoid triggering TV pairing requests--interactive
: Enable interactive PIN entry for authentication test (allows you to enter the PIN shown on TV)--help
: Show usage information
The test suite provides detailed output showing:
- ✅ PASS/❌ FAIL status for each test
- Detailed error messages for failures
- JSON responses from successful API calls
- Summary statistics and recommendations
- Python 3.7+
- mcp >= 1.9.0
- requests >= 2.25.0
- bravia_tv >= 1.0.0
This MCP server uses the BraviaRC library which is licensed under MIT License.