WS

winstonfassett/sonos-mcp-server

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

11 stars 3 forks 品質 69 トレンド 26

このプロジェクトは、Sonos MCP (Model Context Protocol) サーバーで、ネットワーク上のSonos デバイスと操作できます.

概要

このプロジェクトは、Sonos MCP (Model Context Protocol) サーバーで、ネットワーク上のSonos デバイスと操作できます。 デバイス発見、再生の制御、デバイスの状態の取得、キューの管理など、さまざまな機能を提供します。 - ネットワーク上のSonosデバイスを発見 - デバイスの再生状態の取得と制御 - 再生キューを管理する - MCPツールとしての機能を公開する - Python 3.12 + - Pythonプロジェクトを管理するためのuv 2。 uvを使用して必要な依存関係をインストールします。 サーバは、ネイティブ(mcp SDK >=1.12)のMCPの合理化-httpトランスポートをサポートしています。 プロキシは必要ありません: 古い代替(非推奨 — 上記のストリーム可能な http を好む): MCP インスペクタで「開発」モードでサーバーを実行するには: このコマンドは、MCP のインスペクターをテストおよびデバッグ目的でホストします.

概要(AI 翻訳)

このプロジェクトは、Sonos MCP (Model Context Protocol) サーバーで、ネットワーク上のSonos デバイスと操作できます。 デバイス発見、再生の制御、デバイスの状態の取得、キューの管理など、さまざまな機能を提供します。

##特徴

  • ネットワーク上のSonosデバイスを発見する
  • デバイスの再生状態の取得と制御
  • 再生キューの管理
  • MCPツールとしての機能を公開

要件

  • Python 3.12 +
  • Pythonプロジェクトを管理するための[uv

インストール

##Git から (直接インストール)

開発のための####

  1. リポジトリのクローン化:

  2. [uvを使用して必要な依存関係をインストールします。

使用法

サーバーの実行

##########Stdio#############Stdio############################################Stdio############################Stdio##################################################################################################stdio#####################################################

stdio を使用してサーバーを実行します。

####HTTP(streamable-http)

サーバは、ネイティブ(mcp SDK >=1.12)のMCPの合理化-httpトランスポートをサポートしています。 プロキシは必要ありません:

エンドポイント: [[T2]

環境変数:

| ヴァル | デフォルト | ノート | お問い合わせ | [SONOS_MCP_TRANSPORT | [stdio | [stdio, [sse], [[streamable-http]] | | [SONOS_MCP_HOST | [127.0.0.1 | HTTP バインドアドレス | | [SONOS_MCP_PORT | [[[T11] | HTTPポート(パス/mcp) |

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Sonos MCP Server

This project is a Sonos MCP (Model Context Protocol) server that allows you to control and interact with Sonos devices on your network. It provides various functionalities such as discovering devices, controlling playback, retrieving device states, and managing queues.

Features

  • Discover Sonos devices on the network
  • Retrieve and control playback state for devices
  • Manage playback queues
  • Expose functionalities as MCP tools

Requirements

  • Python 3.12+
  • uv for managing Python projects

Installation

From Git (Direct Install)

pip install git+https://github.com/WinstonFassett/sonos-mcp-server.git

For Development

  1. Clone the repository:

    git clone https://github.com/WinstonFassett/sonos-mcp-server.git
    cd sonos-mcp-server
    
  2. Install the required dependencies using uv:

    uv sync
    

Usage

Running the Server

Stdio

Run the server using stdio:

uv run mcp run server.py

HTTP (streamable-http)

The server supports the MCP streamable-http transport natively (mcp SDK >= 1.12). No proxy needed:

SONOS_MCP_TRANSPORT=streamable-http \
SONOS_MCP_HOST=127.0.0.1 \
SONOS_MCP_PORT=8090 \
uv run sonos-mcp-server

Endpoint: http://127.0.0.1:8090/mcp

Environment variables:

Var Default Notes
SONOS_MCP_TRANSPORT stdio stdio, sse, or streamable-http
SONOS_MCP_HOST 127.0.0.1 HTTP bind address
SONOS_MCP_PORT 8000 HTTP port (path is /mcp)
SONOS_MCP_ALLOWED_HOSTS (localhost only) Extra Host headers to accept, comma-separated. Needed when serving behind a proxy with a different hostname (e.g. mac-mini.tailc3138.ts.net:*).
SONOS_DEVICE_IPS (SSDP discovery) Comma-separated speaker IPs. Skips SSDP multicast and resolves names over unicast SOAP — required when the process can’t multicast (e.g. launchd without Local Network permission).

Legacy: SSE with supergateway

Older alternative (deprecated — prefer streamable-http above):

npx -y supergateway --port 8000 --stdio "uv run mcp run server.py"

Development

To run the server in “development” mode with the MCP Inspector:

uv run mcp dev server.py

This command hosts an MCP Inspector for testing and debugging purposes.

To run the server with SSE in development mode, use the SSE command for supergateway, and in a second terminal window run:

npx @modelcontextprotocol/inspector

Install in Claude Desktop

After publishing to git, users can install directly:

mcp install git+https://github.com/WinstonFassett/sonos-mcp-server.git

Or add to Claude Desktop config:

{
  "mcpServers": {
    "sonos": {
      "command": "sonos-mcp-server"
    }
  }
}

Available MCP Tools

Use the exposed MCP tools to interact with Sonos devices. The available tools include:

GitHub で README 全文を見る

インストール

npx -y supergateway --port 8000 --stdio "uv run mcp run server.py"
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "sonos": { "command": "sonos-mcp-server" } } }