Audio Playback MCP Server
Click on "Deploy 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 Server play 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.Get audio file duration (in seconds) when playing files using
ffprobe.Stop current playback.
Pause playback (saves position); resume continues from that position.
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.
Related MCP server: Filesystem 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,pause,resume,status, orlist_files(required)filename: Relative path underAUDIO_ROOT_DIR(required forplay)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. When playing a file, the response also includes duration_seconds (float) in the state object, indicating the total duration of the audio file in seconds. The duration is also included in the message text for convenience. For list_files, responses also include a files payload containing root_dir, count, limit, and files entries (filename, size_bytes).
Available Tools
1 toolaudio_playbackB
Control playback of local audio files for automated testing. Audio is played via a virtual audio output device that is routed into the Android emulator's microphone. Use this to simulate a human speaking into the mic by playing prerecorded files.
Inputs: action (required), filename, start_offset_ms, list_limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion or overlap between tools, as there are no other tools to compare it to. The single tool has a clear and distinct purpose focused on audio playback for testing.
Since there is only one tool, naming consistency is inherently perfect—there are no other tool names to be inconsistent with. The tool name 'audio_playback' follows a clear verb_noun pattern.
A single tool is too few for a server with the purpose of controlling audio playback for automated testing, as it suggests a very limited scope that may not cover essential operations like pausing, stopping, or managing audio files. This is borderline for the apparent domain.
The tool surface is severely incomplete for audio playback control; it only offers playback without supporting basic operations such as pause, stop, volume control, or file management. This will likely cause agent failures in handling more complex testing scenarios.
Maintenance
Related MCP Connectors
Your own computer's files from ChatGPT or Claude: folder rules, confirmations and undo.
AI-manageable audio CDN: upload, transcode, normalize, stream & deliver audio, plus grounded docs.
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that allows Claude to control audio playback on your computer, supporting MP3, WAV, and OGG files with features like play, list, and stop commands.9MIT
- FlicenseAqualityDmaintenanceEnables secure filesystem operations with directory sandboxing and optional read-only mode. Supports file reading/writing, directory management, file searching, and text operations while restricting access to specified directories.12-
- AlicenseNot gradedqualityBmaintenanceEnables playing and inspecting local audio files in an MCP host with an in-conversation UI showing waveform, spectrogram, and loudness metrics, while exposing playback state and metadata to the model.77 npm44ISC
- AlicenseNot gradedqualityBmaintenanceExposes local file system operations to AI assistants via Streamable HTTP with security features like auth, path whitelisting, and audit logging.312 npm2MIT