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

COPY . /build/
RUN /app/venv/bin/uv pip install --prerelease=allow \
    /build/music-assistant-plugin-manager \
    /build/music-assistant-plugin-manager/examples/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 build context is the directory that holds the checkouts, so COPY . /build/ puts each repository under its own name. The entrypoint script is written by the RUN layer in examples/Dockerfile: 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.1a2.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.1a2.tar.gz.

File metadata

File hashes

Hashes for music_assistant_plugin_manager-0.1.1a2.tar.gz
Algorithm Hash digest
SHA256 c91c4fd97c1db11b35808b8e16d77c1eb8c88d4413bffd1275aff7e3cd1859d9
MD5 63ee500a267f398739da25fca0d71c2c
BLAKE2b-256 c0f60dd6a19664facca835f824815d6e8c2659c6e60802cd25a9a525e6d01285

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for music_assistant_plugin_manager-0.1.1a2-py3-none-any.whl
Algorithm Hash digest
SHA256 22e0cce67da6511294c95a67740a9dfc5bbc6189878462136cedfacda9a7eb8d
MD5 180a4bcf7d6f1f0690ac3bc79328e8a8
BLAKE2b-256 208295770139e3393bfb55b6f11f4dba180d4ad348b1254091ad2c8a2f09b068

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1a2 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