Skip to main content

music-assistant-client

Status: Active

A simple synchronous HTTP client for the Music Assistant API.

Installation

pip install ma-http-client

Usage

from ma_http_client import SimpleHTTPMusicAssistantClient

client = SimpleHTTPMusicAssistantClient(
    server_url="http://localhost:8095",
    token="YOUR_TOKEN",  # required for MA >= 2.7.2
)

# Get all players
players = client.get_players()

# Search for media
results = client.search_media("Radiohead", limit=5)

# Play media on a player
client.play_media(queue_id=players[0].player_id, media="library://artist/204")

# Queue controls
client.queue_command_pause(players[0].player_id)
client.queue_command_next(players[0].player_id)

# Volume
client.player_command_volume_set(players[0].player_id, 50)

Claude Code Skill

Control Music Assistant with natural language from Claude Code. See CLAUDE.md for full setup.

pip install ma-http-client
ma-install-skill

Then in any Claude Code session:

/music-assistant play some Radiohead

Or just ask naturally — Claude auto-invokes the skill when it matches.

Standalone Agent

For use outside Claude Code (scripts, OVOS, etc.), install the claude extra:

pip install "ma-http-client[claude]"
from ma_http_client.claude_tools import MusicAssistantAgent

agent = MusicAssistantAgent(
    ma_url="http://homeassistant.local:8095",
    ma_token="YOUR_MA_TOKEN",
    default_player="Living Room",
)
print(agent.run("Play some Radiohead"))

Debug Client

The DebugMusicAssistantClient extends the base client with fixture capture for troubleshooting:

from ma_http_client.debug import DebugMusicAssistantClient

client = DebugMusicAssistantClient(
    "http://localhost:8095",
    fixture_capture=True,
    fixture_dir="./debug_fixtures",
)

players = client.get_players()
# API responses are automatically saved to ./debug_fixtures/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ma_http_client-0.1.1.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ma_http_client-0.1.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file ma_http_client-0.1.1.tar.gz.

File metadata

  • Download URL: ma_http_client-0.1.1.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ma_http_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2343caf74d00c041b8dba81901c866a3de326c285b9a5747c687a58aeda4ce9f
MD5 8d264b33f7b8a39df4d0b701d001dd0e
BLAKE2b-256 893eb8933c9b051406c4c63b9518cc381145cae9220d92ee312f20c6a668fedb

See more details on using hashes here.

File details

Details for the file ma_http_client-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: ma_http_client-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ma_http_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea9c9fb4d3c9204b669a1e9f74afe0e51d2bd47f72eac5c679fcfbd87495aa62
MD5 637a62f5f0f5183b7b8d24bc7f2fe5f9
BLAKE2b-256 0dfc9996488aee946e76def8ba2b0e0c31cc61657df387d975370755a81d1a56

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page