skillfed

python-mpd2

A Python MPD client library

python-mpd2 v3.1.1 120.9K downloads/30d#12,002 on PyPI368
Copyleft license GNU Lesser General Public License v3 (LGPLv3) Active released

What it is and what it does

python-mpd2 is a Python client library for Music Player Daemon (MPD), a lightweight music server. It lets you control MPD playback, manage playlists, and query server state from Python code. The library supports both synchronous blocking calls and asynchronous patterns via asyncio or twisted, making it suitable for simple scripts, web applications, and event-driven systems.

The package started as a fork of python-mpd and has evolved to support Python 3.6+, client-to-client protocol messaging, and newer MPD commands including seekcur, prio, config, mount, and others. It includes explicit command declarations for IDE autocomplete, configurable connection timeouts, logging support, and improved Unicode handling. With zero runtime dependencies and a pure-Python wheel, it installs quickly and runs anywhere Python 3.6+ is available.

Use it for:

  • Build a web dashboard or REST API to control MPD playback and queue from a browser.
  • Write a command-line tool to automate playlist management and music library operations.
  • Create a home automation script that integrates MPD with other services via asyncio.
  • Develop a music client application with custom UI that talks to a remote MPD server.
  • Monitor and log MPD server state and playback events for analytics or debugging.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a Python client library to communicate with Music Player Daemon (MPD) servers, supporting both synchronous and asynchronous operations.

Yes. This is a mature, actively maintained library with zero dependencies, a permissive copyleft license, and no known vulnerabilities. Install it if you need to control MPD from Python—whether for a simple script, web service, or async application. The only prerequisite is having an MPD server running; the library itself is straightforward to integrate.

Install

python-mpd2 on PyPI

pip

pip install python-mpd2

uv

uv add python-mpd2

poetry

poetry add python-mpd2

Installing python-mpd2

Before you install

Low friction: pure Python wheel with no runtime dependencies. Actively maintained with recent commits; last release was 2024-01-13 and repository shows ongoing development.

License in practice

LGPLv3 copyleft license: you may use this library freely in proprietary software, but any modifications to the library itself must be released under the same license.

Quickstart

pip install python-mpd2

import python_mpd2
client = python_mpd2.MPDClient()
client.connect('localhost')
status = client.status()
client.close()

Requires Python 3.6 or later and a running Music Player Daemon server to connect to.

Verify before relying

  • Whether asyncio/twisted support is production-ready or still experimental.
  • Performance characteristics when controlling large playlists or music libraries.
  • Compatibility matrix with specific MPD server versions.
  • Default port and connection parameters for MPD server connections.

Package facts

License GNU Lesser General Public License v3 (LGPLv3) (copyleft)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 944 days since the last release
Last repo commit
First released
Downloads 120,946/month — #12,002 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_mpd2-3.1.1-py2.py3-none-any.whl

Keywords: mpd

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)Natural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Software Development :: Libraries :: Python Modules

Tags

mpd client library pythonmusic player daemon clientasyncio mpd controlpython mpd interfacetwisted mpd support
music-serverasyncio-ready

More Python Modules packages