How Mopidy Extensions Add Music Sources and Features

Updated

Mopidy extensions are the mechanism that turns a basic local-file and Internet-radio player into a server that can pull music from cloud services and be controlled from almost any device. Out of the box, Mopidy plays music from files and Internet radio; installing an extension adds a backend for a new music source, a frontend for controlling playback, or both. This applies to anyone running Mopidy on Linux, macOS, or a Raspberry Pi who wants more sources or more control than the default setup provides.

What Mopidy does without any extensions

Mopidy is a Python application that runs in a terminal or in the background on Linux computers or Macs that have network connectivity and audio output. In its base form:

  • It plays music from local files and Internet radio.
  • It runs as an HTTP server.
  • It has no MPD interface until you add one.

So the starting point is deliberately minimal. Everything beyond local playback and radio comes from extensions.

How extensions add music sources (backends)

Through extensions, Mopidy can play music from many cloud services and radio networks. Each extension that adds a source acts as a backend: it teaches the server how to talk to that service and expose its tracks to clients.

The practical effect is that you install the extension for the service you want, configure it, and that service's music becomes playable alongside your local files. The site names Spotify, SoundCloud, and Internet radio as examples of what Mopidy can play, and states that with extension support you can easily add backends for new music sources.

Adding an MPD interface

A specific, commonly needed extension is Mopidy-MPD. Out of the box Mopidy is an HTTP server; if you install the Mopidy-MPD extension, it becomes an MPD server too. That single extension is what lets standard MPD clients connect.

How extensions add control interfaces (frontends)

Many additional frontends for controlling Mopidy are available as extensions. These are the pieces that let you and the people around you connect your favorite MPD or web client to the Mopidy server to search for music and manage the playlist together.

Because MPD clients exist for all popular operating systems, and web clients run in a browser, you can control the music from any phone, tablet, or computer. One example shown on the site is Mopidy-Iris by James Barnsley, a web frontend.

The key point: the server and the interface are separate. You choose the frontend as an extension rather than being locked into one app.

Why Mopidy is described as hackable

Mopidy's extension support and its Python, JSON-RPC, and JavaScript APIs make it a base for custom projects, not just a finished player. The site gives a concrete example: a Raspberry Pi embedded in an old cassette player, where the buttons and volume control are wired up with GPIO on the Pi and used to control playback through a custom Mopidy extension, and the cassettes carry NFC tags used to select playlists from Spotify (hack by Matt Brailsford).

That example shows the two extension directions working together — a custom backend/control path plus the existing service integration — which is why the APIs matter if you want to build something beyond the standard setup.

Running it on a Raspberry Pi

The Raspberry Pi is an approachable single-board computer to run Mopidy on, using Raspberry Pi OS, Ubuntu, or Arch Linux. Pimoroni recommends Mopidy for use with their Pirate Audio audio gear for Raspberry Pi. If your goal is a small always-on music server, this is the documented path.

Getting started

The site's own entry points are:

  • Install Mopidy — the base server.
  • Browse extensions — to find backends for your music sources and frontends for control.

A reasonable order of operations: install Mopidy first, confirm it plays local files and radio, then add the backend extension for each service you want and a frontend extension for the client you prefer. If you need standard MPD clients to connect, add Mopidy-MPD as well.