reklawdbox
AI-powered Rekordbox metadata tool for genre tagging, classification, and library management.
reklawdbox
MCP server for Rekordbox 7.x library management. Reads directly from the encrypted master.db,
stages metadata changes in memory, and writes Rekordbox-compatible XML for safe reimport.
Built as a single Rust binary. Primary operation is through an MCP host (Codex, Claude Code,
etc.), with CLI subcommands for local batch audio analysis and native tag read/write.
Why MCP as the primary interface?
A shell-invoked CLI works from hosts with terminal access, but Claude Desktop and other MCP hosts
cannot execute shell commands and can only call MCP tools. MCP keeps reklawdbox usable from
any compliant host while still allowing local CLI workflows when needed.
Build
cargo build --release
The binary is at ./target/release/reklawdbox.
Development
Common local development and validation commands:
cargo build --release
cargo test
cargo test -- --ignored
bash docs/rekordbox/validate-corpus.sh
python3 docs/rekordbox/verify-phase-b.py
Agent workflow notes:
- Generic/Codex agents:
AGENTS.md - Claude Code:
CLAUDE.md - Repo docs index:
docs/README.md
MCP Host Setup
- Configure your MCP host to run this server over stdio with command
./target/release/reklawdbox. - Use
mcp-config.example.jsonas the baseline for local host configuration. - Keep real credentials in local environment variables or untracked local config only.
The server auto-detects the Rekordbox database at ~/Library/Pioneer/rekordbox/master.db.
To override, set the REKORDBOX_DB_PATH environment variable.
Optional enrichment and analysis environment variables:
REKLAWDBOX_DISCOGS_BROKER_URLREKLAWDBOX_DISCOGS_BROKER_TOKENCRATE_DIG_ESSENTIA_PYTHONCRATE_DIG_STORE_PATH(optional override for internal cache SQLite path)
Essentia probe behavior:
- The server only probes
CRATE_DIG_ESSENTIA_PYTHONand~/.local/share/reklawdbox/essentia-venv/bin/python. - If neither imports Essentia, tools report Essentia as unavailable and continue with stratum-dsp only.
- Probe result is memoized for process lifetime, so restart the MCP server after changing Essentia install/config (or run
setup_essentia, which installs and activates Essentia immediately).
Codex Quickstart
- Build the binary:
cargo build --release
- (Recommended) Set up a persistent local env file + launcher (one-time):
mkdir -p ~/.config/reklawdbox
cp mcp.env.example ~/.config/reklawdbox/mcp.env
# edit ~/.config/reklawdbox/mcp.env for your machine
chmod +x scripts/run-reklawdbox-mcp.sh
- Register once with the launcher script:
codex mcp remove reklawdbox 2>/dev/null || true
codex mcp add reklawdbox -- ./scripts/run-reklawdbox-mcp.sh
After this, you only update ~/.config/reklawdbox/mcp.env and restart MCP when env changes.
- Alternative: create local MCP config from template:
cp mcp-config.example.json .mcp.json
- Edit
.mcp.jsonand set:
REKORDBOX_DB_PATH(if you are not using the default Rekordbox path)- optional broker Discogs / Essentia env vars
- Register or load that config in your Codex MCP host so it starts:
- command:
./target/release/reklawdbox - transport:
stdio
- Verify wiring by running a simple tool call from Codex (for example
read_library).
Optional CLI Subcommands
The binary runs MCP server mode by default. Subcommands are available for local workflows
outside your MCP host.
Batch Audio Analysis
./target/release/reklawdbox analyze --max-tracks 200
./target/release/reklawdbox analyze --playlist <playlist_id> --genre Techno --bpm-min 126 --bpm-max 134
Tag Read/Write
Read, write, and manage metadata tags directly on audio files (FLAC, MP3, WAV, M4A, AAC, AIFF).
# Read tags (human-readable or --json)
./target/release/reklawdbox read-tags track.flac
./target/release/reklawdbox read-tags /music/album/ --fields artist,title,bpm --json
# Write tags (with dry-run preview)
./target/release/reklawdbox write-tags track.mp3 --artist "New Artist" --year 2026
./target/release/reklawdbox write-tags track.wav --genre Techno --wav-targets id3v2,riff_info --dry-run
# Cover art
./target/release/reklawdbox extract-art track.flac --output cover.jpg
./target/release/reklawdbox embed-art cover.jpg track1.mp3 track2.flac
WAV files support dual-layer tagging (ID3v2 + RIFF INFO). Use --wav-targets to control
which layers are written. See site/src/content/docs/reference/tools.mdx
for full tool parameter reference.
Essentia Setup (Recommended)
Install Essentia for advanced audio features (danceability, energy, spectral analysis):
reklawdbox setup
This creates a managed Python venv at ~/.local/share/reklawdbox/essentia-venv which is auto-detected — no env vars needed.
Discogs Auth Flow
- Call
lookup_discogsfor any track. The built-in broker is preconfigured — no env vars needed. - On first use, the tool returns an actionable message with an
auth_url. - Open the
auth_url, approve Discogs access, then runlookup_discogsagain. - The broker session token is stored in local internal SQLite; Discogs OAuth secrets remain broker-side only.
Tools
| Tool | Description |
|---|---|
read_library |
Get library summary: track count, genre distribution, stats |
search_tracks |
Search and filter tracks in the Rekordbox library |
get_track |
Get full details for a specific track by ID |
get_playlists |
List all playlists with track counts |
get_playlist_tracks |
List tracks in a specific playlist |
get_genre_taxonomy |
Get the configured genre taxonomy |
update_tracks |
Stage changes to track metadata (genre, comments, rating, color) |
preview_changes |
Preview all staged changes, showing what will differ from current state |
write_xml |
Write staged changes to a Rekordbox-compatible XML file |
clear_changes |
Clear staged changes for specific tracks or all |
suggest_normalizations |
Analyze genres and suggest normalizations to canonical taxonomy |
lookup_discogs |
Look up a track on Discogs for genre/style enrichment |
lookup_beatport |
Look up a track on Beatport for genre/BPM/key enrichment |
enrich_tracks |
Batch enrich tracks via Discogs/Beatport using IDs, playlist, or filters |
analyze_track_audio |
Analyze one track with stratum-dsp and optional Essentia (cached) |
analyze_audio_batch |
Batch audio analysis with stratum-dsp and optional Essentia (cached) |
setup_essentia |
Install/validate Essentia in a local venv and activate it for the running server |
score_transition |
Score a single transition between two tracks (key/BPM/energy/genre/rhythm) |
build_set |
Generate 2-3 candidate set orderings from a track pool |
resolve_track_data |
Return all cached + staged data for one track without external calls |
resolve_tracks_data |
Batched resolve_track_data over IDs, playlist, or search scope |
cache_coverage |
Report enrichment/audio cache completeness for a selected track scope |
read_file_tags |
Read metadata tags from audio files (FLAC, MP3, WAV, M4A, AAC, AIFF) |
write_file_tags |
Write/delete metadata tags on audio files with optional dry-run preview |
extract_cover_art |
Extract embedded cover art from an audio file to disk |
embed_cover_art |
Embed cover art into one or more audio files |
Response Contract Notes
write_xmlreturns a JSON payload on both write and no-change paths.- The no-change path includes
"message": "No changes to write."withtrack_count,changes_applied, and provenance fields. - Legacy consumers that previously parsed plain text should read the
messagefield from the JSON payload.
Genre Taxonomy
Starter set for consistency (not a closed list — arbitrary genres are accepted):
Acid, Afro House, Ambient, Ambient Techno, Bassline, Breakbeat, Broken Beat,
Dancehall, Deep House, Deep Techno, Disco, Downtempo, Drum & Bass, Dub,
Dub Techno, Dubstep, Electro, Experimental, Garage, Grime, Hard Techno,
Hip Hop, House, IDM, Jungle, Minimal, Psytrance, R&B, Reggae, Speed Garage,
Synth-pop, Tech House, Techno, Trance, UK Bass
Workflow
- Search — use
search_tracksorget_playlist_tracksto find tracks to tag - Update — use
update_tracksto stage genre, comments, rating, or color changes - Preview — use
preview_changesto review what will change vs. current state - Write — use
write_xmlto generate the XML file (runs backup automatically) - Import in Rekordbox — File > Import > Import Playlist/Collection, select the XML
For enrichment/audio/set workflows, the common sequence is:
- Scope tracks —
search_tracks,get_playlist_tracks, orresolve_tracks_data - Populate cache —
enrich_tracksand/oranalyze_audio_batch - Inspect completeness —
resolve_track_data/resolve_tracks_dataandcache_coverage - Plan transitions/sets —
score_transitionandbuild_set
Documentation
- reklawdbox.com — Astro Starlight docs site
docs/README.md— Documentation index by areadocs/rekordbox/README.md— Rekordbox corpus map and manifest-first usagedocs/conventions.md— Collection naming, directory structure, and tagging conventionsdocs/rekordbox-internals.md— Rekordbox file formats, database schema, XML structure, ecosystem toolsdocs/rekordbox-gotchas.md— Rekordbox schema/XML edge cases and invariants used by code pathsdocs/rekordbox-gotchas.md#queries— Query-building and binding patterns used in DB access codedocs/backup-and-restore.md— Backup usage and restore proceduresREADME.md#discogs-auth-flow— Discogs broker setup, first-run auth, and re-auth/reset guidanceCONTRIBUTING.md— Development workflow, testing expectations, and pull request checklistSECURITY.md— Supported versions and vulnerability reporting processAGENTS.md— Agent/operator workflow notes for Codex and compatible hostsCLAUDE.md— Claude Code-specific operator/developer workflow notes
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found