Skip to main content
Glama
libsonare-mcp

libsonare-mcp

Official
by libraz
README.md
# libsonare-mcp

[![CI](https://img.shields.io/github/actions/workflow/status/libraz/libsonare-mcp/ci.yml?branch=main&label=CI)](https://github.com/libraz/libsonare-mcp/actions)
[![License](https://img.shields.io/badge/license-MIT-blue)](https://github.com/libraz/libsonare-mcp/blob/main/LICENSE)
[![Python](https://img.shields.io/badge/python-3.11%2B-blue?logo=python&logoColor=white)](https://www.python.org/)
[![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS-lightgrey)](https://github.com/libraz/libsonare-mcp)

**libsonare-mcp is an MCP server for analyzing, editing, mastering, mixing and composing audio and MIDI with an AI assistant.** Its 34 tools process files locally with libsonare and use libcantus for music theory. It returns measurements, text and images in the client and writes audio or MIDI files for playback and editing.

šŸ“– **[Documentation](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/introduction.md)**  Ā·  **[Getting started](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/getting-started.md)**  Ā·  **[Tool reference](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/tools/index.md)**

> Install the alpha from a source checkout with libsonare 2.x and libcantus from PyPI. Tool names, arguments and the project file format may change between releases.

## What it does

- **Analysis** — BPM with alternatives, beats, meter, key candidates, chords with bar and beat, sections, melody, pitch and intonation. [Tools and how to choose](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/tools.md)
- **Loudness and diagnosis** — LUFS, true peak, LRA, streaming-platform previews, and detection of clipping, clicks, hum, noise and band limits. [Tools and how to choose](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/tools.md)
- **Conversion and editing** — WAV, FLAC, Ogg, Opus, MP3, AIFF and M4A; trim, cut, fade, normalize, pitch shift, time stretch, split. [Audio formats](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/audio-formats.md)
- **Effects, mastering and repair** — processor chains from the catalog, mastering to a LUFS target, platform or reference, denoise, declick and dehum. [Tools and how to choose](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/tools.md)
- **Seeing and hearing** — spectrograms, chroma, piano rolls and other PNGs for the agent; playback on the local speakers for the person. [Tool reference](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/tools/index.md)
- **MIDI and projects** — read, write, transpose, quantize, humanize, transcribe from audio, arrange tracks and clips in a project file, mix them with a mixer scene, render with General MIDI, synth presets or a SoundFont. [Project files](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/project-files.md)
- **Theory and generation** — key and Roman-numeral analysis, cadences, part-writing and playability checks, and seeded generation of progressions, bass, drums and melodies. [Tools and how to choose](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/tools.md)
- **Safe file handling** — outputs are new, atomically written files; nothing is overwritten without `overwrite: true`, and `dry_run` shows the plan first. [Files and the output directory](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/files-and-output.md)

## Installation

Use Python 3.11 or later on macOS 26 or later (Apple silicon) or Linux (x86-64 or arm64 with glibc 2.27 or later). Install the server from a checkout. pip installs libsonare 2.x and libcantus from PyPI.

```sh
git clone https://github.com/libraz/libsonare-mcp && cd libsonare-mcp
python -m venv .venv && .venv/bin/pip install .
.venv/bin/python -m libsonare_mcp init     # register with Claude Code, Claude Desktop and Codex
```

`init` writes the absolute path of `.venv/bin/python` with `-m libsonare_mcp` into every client configuration it finds; `--client claude-code|claude-desktop|codex` picks one, and `uninstall` removes the entry. To run the stdio server without a checkout, use `uvx --from git+https://github.com/libraz/libsonare-mcp libsonare-mcp`. Optional: `ffmpeg` on `PATH` reads M4A, AAC and other formats and writes M4A.

## Getting started

Restart the client and ask in plain words:

| Ask | Tool |
| --- | --- |
| "What tempo and key is `~/Music/song.wav`?" | `audio_analyze` |
| "Is it ready for Spotify?" | `audio_loudness` |
| "Master it to āˆ’14 LUFS with a āˆ’1 dBTP ceiling." | `audio_master` |
| "Convert it to MP3 and fade out the last 3 seconds." | `audio_edit` |
| "Show me a spectrogram of the chorus." | `audio_visualize` |
| "Make an 8-bar backing in A minor and play it." | `midi_compose`, `project_render`, `audio_play` |

Written files land in `./sonare-out/` under the client's working directory, or in `$SONARE_MCP_OUTPUT_DIR`; `SONARE_MCP_MAX_SECONDS` and the other limits are in [Configuration](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/configuration.md). → [Getting started](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/getting-started.md)

## Build from source

Development uses [uv](https://docs.astral.sh/uv/); `uv sync` installs the server with libsonare and libcantus from PyPI.

```sh
make format         # ruff format and safe lint fixes
make lint           # ruff check and pyright
make test           # pytest
make docs           # regenerate the tool reference from the tool definitions
make ci             # format-check, lint, test and docs-check
```

The environment variables that change limits and the output directory are listed in [Configuration](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/configuration.md).

## Documentation

The guides are available in English and Japanese, with a generated tool reference in English.

- **Learn** — [Introduction](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/introduction.md) Ā· [Getting started](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/getting-started.md) Ā· [Tools and how to choose](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/tools.md)
- **Guides** — [Time units](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/time-units.md) Ā· [Files and the output directory](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/files-and-output.md) Ā· [Audio formats](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/audio-formats.md) Ā· [Project files](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/project-files.md) Ā· [Limits and response size](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/limits-and-budget.md)
- **Reference** — [Tool reference](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/tools/index.md) Ā· [Configuration](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/configuration.md) Ā· [Questions and limitations](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/faq.md)

## Non-goals

The server measures, edits and generates; it does not judge mood or genre, separate vocals or instruments with learned models, align lyrics, synthesize speech or singing, keep real-time sessions open, hold a DAW session between calls, read or write notation (MusicXML, ABC, LilyPond), handle MP3 ID3 tags or cover art, or fetch audio from URLs. `audio_device` refuses every operation with an explanation until libsonare has a device backend. See the [Introduction](https://github.com/libraz/libsonare-mcp/blob/main/docs/en/introduction.md#what-the-server-does-not-do) for the reasons.

## License

[MIT](LICENSE)

TDQS

A4.2/5.0

Scored across 34 tools

Disambiguation4/5

Most tools target clearly distinct resources or actions, and descriptions proactively redirect to alternatives such as audio_info vs audio_loudness or audio_process vs audio_master. A few boundaries still blur, especially audio_analyze vs theory_analyze on audio and audio_info vs audio_loudness, so not every tool is perfectly separable.

Naming Consistency4/5

All names use snake_case with predictable domain prefixes (audio_, midi_, project_, theory_, music_) and readable action/resource suffixes. Some tools are noun-like (audio_info, audio_features, music_catalog) while others are verb-like (audio_analyze, midi_compose), a minor inconsistency but still easy to follow.

Tool Count2/5

34 tools is well above both the 3-15 sweet spot and the 16-25 heavy range, creating substantial selection overhead even for a broad audio/MIDI production suite. Several workflow families could likely be consolidated or exposed as sub-operations rather than top-level tools.

Completeness5/5

The surface covers the full lifecycle: inspection and analysis, diagnosis and repair, processing and mastering, editing and splitting, separation, transcription and vocal tuning, playback and device I/O, MIDI read/write/edit/compose, project CRUD/render, and theory lookup/analyze/check. No obvious workflow dead ends are present.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues