Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

music-assistant-plugin-manager

Ship a Music Assistant provider as a standalone pip package. No PR to the MA core repository is required.

MA requires all providers to live inside the server's music_assistant/providers/ directory. This library patches MA's provider discovery at runtime so that any pip-installable package registered under the music_assistant.provider entrypoint group is automatically found and loaded.

How it works

Two patches are applied before MA starts:

  1. Import hook (MassProviderFinder): intercepts music_assistant.providers.<domain> imports and redirects them to the real plugin module.
  2. Manifest patch: patches MusicAssistant.__load_provider_manifests to also inject manifest.json files from entrypoint-registered packages.

A wrapper launcher applies both patches. Users run python -m music_assistant_plugin_manager (or the music-assistant-community script) instead of the normal MA entry point. This needs no .pth files and no edits to MA source.

Install

pip install music-assistant-plugin-manager

Requires Python >= 3.11 and a working Music Assistant installation.

Quick start

# Install your community provider alongside this library
pip install my-ma-provider

# Start Music Assistant through the wrapper
python -m music_assistant_plugin_manager
# or equivalently:
music-assistant-community

Docker

The recommended way to run community providers in a container is to extend the official MA server image.

Dockerfile (see examples/Dockerfile for a working copy):

FROM ghcr.io/music-assistant/server:beta

RUN /app/venv/bin/uv pip install --prerelease=allow music-assistant-plugin-manager

# For developing plugins, copy them into the image and install from the local checkout.
COPY ./examples/radiosoma_provider /build/radiosoma_provider
RUN /app/venv/bin/uv pip install --prerelease=allow /build/radiosoma_provider

RUN printf '%s\n' \
 '#!/bin/sh' \
 'for path in /usr/lib/*/libjemalloc.so.2; do' \
 '  [ -f "$path" ] && export LD_PRELOAD="$path" MALLOC_CONF="background_thread:true,dirty_decay_ms:5000,muzzy_decay_ms:5000" && break' \
 'done' \
 'exec /app/venv/bin/python -m music_assistant_plugin_manager "$@"' \
 > /usr/local/bin/community-entrypoint.sh && chmod +x /usr/local/bin/community-entrypoint.sh

ENTRYPOINT ["/usr/local/bin/community-entrypoint.sh", "--data-dir", "/data", "--cache-dir", "/data/.cache"]

The entrypoint script is written by the RUN layer: overriding the base image's ENTRYPOINT drops the --data-dir/--cache-dir arguments it passed to mass, and without them MA stores its database inside the container and loses every setting on restart.

Note: the MA server image ships only uv inside the venv, not pip. Use /app/venv/bin/uv pip install.

docker-compose.yml (see examples/docker-compose.yml):

services:
  music-assistant-server:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: music-assistant-server
    restart: always
    network_mode: host
    volumes:
      - ${DATA_BASE_DIR}/music-assistant:/data/
    environment:
      LOG_LEVEL: info

See docs/deployment.md for a full compose snippet and local-run instructions.

Writing a provider plugin

Declare the entrypoint in your pyproject.toml:

[project.entry-points."music_assistant.provider"]
my_provider_domain = "my_provider_module"

Your module must contain:

Item Type Description
manifest.json file MA provider manifest (domain, name, type, …)
setup async def Instantiates and returns the provider
setup_flow.py module Optional. Collects one-time setup input (async def run_setup(session))
SUPPORTED_FEATURES set[ProviderFeature] Feature flags the provider advertises

See docs/plugin-authors.md for the full guide, manifest field reference, and a worked example.

Examples

Example What it shows
examples/demo_provider/ Minimal scaffold with no real functionality
examples/radiosoma_provider/ Full MusicProvider subclass: SomaFM internet radio via stdlib XML + aiohttp, SEARCH and BROWSE features

License

Apache 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

music_assistant_plugin_manager-0.1.1a3.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file music_assistant_plugin_manager-0.1.1a3.tar.gz.

File metadata

File hashes

Hashes for music_assistant_plugin_manager-0.1.1a3.tar.gz
Algorithm Hash digest
SHA256 04c4e289656582ab0a5041b450b88f585d70855918e4bf7981ba3785081cd996
MD5 1fe90acbf9eeab0b70c38994efc9b83e
BLAKE2b-256 32810b12473e0137bdfcdc1d4b0f4417963e9d8864173b8311953710645dc5ad

See more details on using hashes here.

File details

Details for the file music_assistant_plugin_manager-0.1.1a3-py3-none-any.whl.

File metadata

File hashes

Hashes for music_assistant_plugin_manager-0.1.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 ff97de8c7336b0462cd525059c8f8a2a98881af5c2ef06e71c250f2f4ad0e3df
MD5 921656433b67662f209a0c5911f8f61c
BLAKE2b-256 aac11599f05b44fd57e9f6bdf87133c90d13ba4cbd1d48fd1e1d354a6e5c748e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1a3 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page