Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Audio Playback MCP Serverplay background_music.wav with loop"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Audio Playback MCP Server
This repository provides an MCP server named audio-playback-server that exposes a single audio_playback tool. The tool lets an MCP client start, stop, and inspect playback of local audio files routed through a configurable virtual audio output device.
Features
Play audio files from a configurable root directory using
ffplay.Stop current playback.
Query current status with a position estimate.
List audio files hosted locally under
AUDIO_ROOT_DIR.Path safety enforcement to prevent leaving the configured root directory.
Run as either a local stdio MCP server or a long-running HTTP MCP server.
Configuration
The server reads configuration from environment variables and an optional JSON file. Environment variables take precedence over JSON values.
Required:
AUDIO_ROOT_DIR: Root directory containing allowed audio files.AUDIO_OUTPUT_DEVICE: Identifier of the virtual output device.
Optional playback settings:
DEFAULT_FORMAT: File extension to append when none is provided (defaultwav).FFPLAY_PATH: Path to theffplaybinary (defaultffplay).AUDIO_PLAYBACK_CONFIG: Path to a JSON config file containing any of the above keys.
Optional MCP transport settings:
MCP_TRANSPORT:stdio(default) orhttp.MCP_HTTP_HOST: HTTP bind host forhttptransport (default0.0.0.0).MCP_HTTP_PORT: HTTP bind port forhttptransport (default8765).MCP_HTTP_PATH: MCP endpoint path forhttptransport (default/mcp).MCP_DNS_REBINDING_PROTECTION:true/false(defaulttrue).MCP_ALLOWED_HOSTS: Comma-separated allow-list of host headers for HTTP mode.
An example config file is provided at config/audio_playback_config.example.json.
Installation
python -m venv .venv
source .venv/bin/activate
pip install -e .Running the server (stdio)
AUDIO_ROOT_DIR=/path/to/audio \
AUDIO_OUTPUT_DEVICE="Virtual Cable" \
python -m audio_playback_serverRunning the server (HTTP, for remote clients)
AUDIO_ROOT_DIR=/path/to/audio \
AUDIO_OUTPUT_DEVICE="Virtual Cable" \
MCP_TRANSPORT=http \
MCP_HTTP_HOST=0.0.0.0 \
MCP_HTTP_PORT=8765 \
MCP_HTTP_PATH=/mcp \
python -m audio_playback_serverIn HTTP mode, the server stays running and accepts MCP requests at http://<host>:<port><path> (for example http://192.168.1.10:8765/mcp).
Remote access notes (Windows host + Raspberry Pi client)
Bind to
0.0.0.0so the server listens on your LAN interface.Allow inbound TCP on
MCP_HTTP_PORTin Windows Defender Firewall.If MCP host-header checks block requests, set
MCP_ALLOWED_HOSTSto include the hostname/IP your client uses, or disable checks withMCP_DNS_REBINDING_PROTECTION=falsefor trusted networks only.Configure your Raspberry Pi MCP client/Openclaw to call your Windows machine at
http://<windows-lan-ip>:8765/mcp.
Tool schema
The audio_playback tool accepts the following JSON input:
action:play,stop,status, orlist_files(required)filename: Relative path underAUDIO_ROOT_DIR(required forplay)loop: Loop playback until stopped (defaultfalse)start_offset_ms: Start offset in milliseconds (default0)list_limit: Maximum number of files returned whenaction=list_files(default200)
Responses always include success, message, and a state object with status, current_file, started_at_ms, and position_estimate_ms. For list_files, responses also include a files payload containing root_dir, count, limit, and files entries (filename, size_bytes).