Set up your environment
This page gets a copy of the server on your machine, ready to run and test.
What you need
Section titled “What you need”- macOS or Linux. On Windows, use WSL 2, the Windows Subsystem for Linux; the code is not tested on Windows itself.
- Python 3.14 or newer.
pyproject.tomlhas the minimum version, and.python-versionthe version the project runs on. - ffmpeg 8.0 or newer, on your
PATH. - uv, which the setup script uses to create the environment.
There is no devcontainer: develop on your own machine.
Optional native libraries
Section titled “Optional native libraries”Install these only for the provider that needs them.
| Library | Needed for | Install |
|---|---|---|
| libchromaprint | The AcoustID provider (acoustid_lookup), which refuses to load without it. The tests do not need it. |
macOS: brew install chromaprint; Debian/Ubuntu: sudo apt-get install libchromaprint1 |
| shairport-sync | The AirPlay Receiver plugin (airplay_receiver). |
macOS: brew install shairport-sync; Linux: see its README for the version and build it needs |
On Apple Silicon, Homebrew installs into /opt/homebrew, where the dynamic loader does not look, and pyacoustid opens libchromaprint by its file name. Add this line to your shell profile:
export DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:/usr/local/lib:/usr/lib"Get the code
Section titled “Get the code”- Fork music-assistant/server and clone your fork.
- From the root of the repository, run
scripts/setup.sh. It:- creates the virtual environment
.venv, or reuses it; - downloads the
cliairplaybinary the AirPlay provider uses; - installs the server in editable mode with its test tools, and the requirements of every provider (
requirements_all.txt); - installs the pre-commit hooks;
- warns when ffmpeg or libchromaprint is missing.
- creates the virtual environment
- Activate the environment yourself:
source .venv/bin/activate. The script cannot do that for your shell. - Run
scripts/setup.shagain after every pull, because the requirements change often.
VS Code
Section titled “VS Code”Select .venv as the Python interpreter. .vscode/launch.json has three launch configurations:
- Music Assistant: Server starts the server with
--log-level debugin Python development mode, see Run and debug. - Music Assistant: Tests runs
pytest testsunder the debugger. - Python Debugger: Current File runs the open file.
Work on the shared models
Section titled “Work on the shared models”The data models that the server and its clients share are the package music_assistant_models, in music-assistant/models. The server installs a released version. To change them together with the server:
-
Clone music-assistant/models next to the server.
-
With
.venvactive, from the root of the server, install your clone in editable mode:Terminal window uv pip install -e ../models --config-settings editable_mode=strict -
Run that command again when you add or remove a file in the models, and after
scripts/setup.sh, which puts the released version back.
A change to the models is a pull request of its own in music-assistant/models. Link it from your server pull request.
Core maintainers: bundled credentials
Section titled “Core maintainers: bundled credentials”The official builds bundle the API credentials of some services, such as Spotify and Qobuz. A server run from source has none of them. With a checkout of the private appvars repository next to the server, the VS Code launch configuration reads ../appvars/app_vars.json. From the command line, point MASS_APP_VARS_FILE at that file. Without the variable, the server looks for ~/.musicassistant/app_vars.json. helpers/app_vars.py explains the rest.
Music Assistant is a project of the Open Home Foundation.