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.1a1.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.1a1.tar.gz.

File metadata

File hashes

Hashes for music_assistant_plugin_manager-0.1.1a1.tar.gz
Algorithm Hash digest
SHA256 a8b642dcb797c68b4fe038efd22b22a7439196fe6cf555a9e8c7b5ae354ef011
MD5 03fed6b73a8caa126636d2bd95e54d35
BLAKE2b-256 bf6ddfda112938c51cd6afcccdbb1962611764f5745bb1d6a2b305f4eabbf9ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for music_assistant_plugin_manager-0.1.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ec881f86f448a67b1d9f433225c920bedb496ec135b6f7623624f7d06fe5f6e
MD5 c50709c080fb00e0065d0950896bc024
BLAKE2b-256 ce391e5a07d69ff0959c699085d131b5da0a5512f4468d9b22fd0e4020d2f9e3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

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