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:
- Import hook (
MassProviderFinder): interceptsmusic_assistant.providers.<domain>imports and redirects them to the real plugin module. - Manifest patch: patches
MusicAssistant.__load_provider_manifeststo also injectmanifest.jsonfiles 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file music_assistant_plugin_manager-0.1.1a2.tar.gz.
File metadata
- Download URL: music_assistant_plugin_manager-0.1.1a2.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c91c4fd97c1db11b35808b8e16d77c1eb8c88d4413bffd1275aff7e3cd1859d9
|
|
| MD5 |
63ee500a267f398739da25fca0d71c2c
|
|
| BLAKE2b-256 |
c0f60dd6a19664facca835f824815d6e8c2659c6e60802cd25a9a525e6d01285
|
File details
Details for the file music_assistant_plugin_manager-0.1.1a2-py3-none-any.whl.
File metadata
- Download URL: music_assistant_plugin_manager-0.1.1a2-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22e0cce67da6511294c95a67740a9dfc5bbc6189878462136cedfacda9a7eb8d
|
|
| MD5 |
180a4bcf7d6f1f0690ac3bc79328e8a8
|
|
| BLAKE2b-256 |
208295770139e3393bfb55b6f11f4dba180d4ad348b1254091ad2c8a2f09b068
|