8000 GitHub - pigeek/braviamcp: This MCP server exposes BraviaRC functionality as tools for controlling Sony Bravia TVs through the Model Context Protocol.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

This MCP server exposes BraviaRC functionality as tools for controlling Sony Bravia TVs through the Model Context Protocol.

Notifications You must be signed in to change notification settings

pigeek/braviamcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Sony Bravia TV MCP Server

This MCP server exposes BraviaRC functionality as tools for controlling Sony Bravia TVs through the Model Context Protocol.

Features

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

Installation

Install the required dependencies:

pip install -r requirements.txt

Sony Bravia TV Setup

Before using the MCP server, you need to enable remote control on your Sony Bravia TV:

  1. On your Sony Bravia TV, go to Settings
  2. Navigate to Network & InternetHome Network
  3. Enable IP Control or Remote Start
  4. Enable Authentication and set it to Normal and Pre-Shared Key
  5. Some models: SettingsNetworkProfessional Display SettingsIP Control
  6. Restart the TV after making these changes

Usage Examples

Once the MCP server is configured and running, you can use the tools through your MCP client:

Connect to TV

{
  "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.

Get Power Status

{
  "tool": "bravia_get_power_status",
  "arguments": {
    "host": "192.168.1.100"
  }
}

Turn On TV

{
  "tool": "bravia_turn_on",
  "arguments": {
    "host": "192.168.1.100",
    "mac": "AA:BB:CC:DD:EE:FF"
  }
}

Set Volume

{
  "tool": "bravia_set_volume",
  "arguments": {
    "host": "192.168.1.100",
    "volume": 0.5
  }
}

Send Remote Command

{
  "tool": "bravia_send_command",
  "arguments": {
    "host": "192.168.1.100",
    "command": "Home"
  }
}

Start Netflix

{
  "tool": "bravia_start_app",
  "arguments": {
    "host": "192.168.1.100",
    "app_name": "Netflix"
  }
}

Available Remote Commands

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

Troubleshooting

Connection Issues

  • 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

Authentication Issues

  • 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

Command Issues

  • 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

Testing

The project includes a comprehensive test suite to verify both MCP server functionality and TV connectivity:

Basic MCP Server Testing

python test_mcp_server.py

This tests:

  • Tool listing functionality
  • Error handling for invalid tools
  • Parameter validation
  • Basic MCP protocol compliance

Full TV Connectivity Testing

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)

Interactive Authentication Testing

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:

  1. First attempts connection with PIN "0000" to trigger pairing request on TV
  2. Prompts you to enter the actual PIN displayed on your TV screen
  3. Tests the connection with the real PIN
  4. Verifies the authenticated connection works properly

Test Options

  • --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

Test Output

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

Dependencies

  • Python 3.7+
  • mcp >= 1.9.0
  • requests >= 2.25.0
  • bravia_tv >= 1.0.0

License

This MCP server uses the BraviaRC library which is licensed under MIT License.

About

This MCP server exposes BraviaRC functionality as tools for controlling Sony Bravia TVs through the Model Context Protocol.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0