Skip to content

Set up your environment

This page gets a copy of the server on your machine, ready to run and test.

  • 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.toml has the minimum version, and .python-version the 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.

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:

Terminal window
export DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix)/lib:/usr/local/lib:/usr/lib"
  1. Fork music-assistant/server and clone your fork.
  2. From the root of the repository, run scripts/setup.sh. It:
    • creates the virtual environment .venv, or reuses it;
    • downloads the cliairplay binary 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.
  3. Activate the environment yourself: source .venv/bin/activate. The script cannot do that for your shell.
  4. Run scripts/setup.sh again after every pull, because the requirements change often.

Select .venv as the Python interpreter. .vscode/launch.json has three launch configurations:

  • Music Assistant: Server starts the server with --log-level debug in Python development mode, see Run and debug.
  • Music Assistant: Tests runs pytest tests under the debugger.
  • Python Debugger: Current File runs the open file.

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:

  1. Clone music-assistant/models next to the server.

  2. With .venv active, from the root of the server, install your clone in editable mode:

    Terminal window
    uv pip install -e ../models --config-settings editable_mode=strict
  3. 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.

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.