lmms-mcp
# lmms-mcp
An MCP server that lets an MCP client (for example Claude Code) control a running
[LMMS](https://lmms.io) through the LMMS local control socket. You hear each change
live: the model can add instrument tracks, write MIDI clips, turn knobs, change the
tempo, play and loop the song, undo, and save.
**Status: work in progress.** The control socket is not in LMMS yet. It is proposed in a
pull request to LMMS/lmms. Until it is merged, build LMMS from the `control-socket`
branch of [abdyer/lmms](https://github.com/abdyer/lmms).
## Install
1. Install [uv](https://docs.astral.sh/uv/).
2. Add the bridge to Claude Code:
```bash
claude mcp add --transport stdio --scope user lmms -- uvx --from git+https://github.com/abdyer/lmms-mcp@v0.1.0 lmms-mcp
```
Other MCP clients: run the command after `--` as a stdio server.
3. Start LMMS with the control socket on:
```bash
lmms --control-socket
```
Or turn on the control socket in LMMS Settings, then restart LMMS.
You can start LMMS before or after the MCP client.
## How it connects
1. When the control socket is on, LMMS writes a connection file, `<name>.json`, in a
per-user runtime folder:
- macOS: `$TMPDIR/lmms/`
- Linux: `$XDG_RUNTIME_DIR/lmms/` (or `$TMPDIR` or `/tmp`, then `lmms-<uid>/`)
- Windows: `%LOCALAPPDATA%\LMMS\run\`
2. The bridge reads that file to get the socket address and the token. The default
name is `control`. If LMMS uses `--control-socket=<name>`, set `LMMS_CONTROL=<name>`
for the bridge.
The bridge connects on the first tool call, not at start-up. After LMMS restarts, the
next call connects again.
## Tools
There is one tool for each control socket method:
| Read | Edit |
|---|---|
| `get_project_summary` | `add_instrument_track`, `remove_track` |
| `list_tracks` | `add_midi_clip`, `set_notes` |
| `list_clips` | `set_param` |
| `get_notes` | `set_tempo`, `transport`, `set_loop` |
| `list_plugins` | `undo`, `redo` |
| `list_params` | `save_project` |
- Positions and lengths are in **beats**, where one beat is one quarter note. In 4/4 a
bar is 4 beats. Steps of 1/48 beat are allowed.
- A pitch is a MIDI number or a note name: `C4` is 60, `F#3`, `Bb2`.
- Note volume is 0 to 200 (100 is normal), and pan is -100 (left) to 100 (right).
- Tracks, clips and knobs have a handle and a path, for example `tracks/"Bass"/knobs/"Volume"`.
Each tool that takes an object accepts either.
- One edit call is one undo step. `undo` acts on the LMMS undo history, which also has
your own edits. `add_instrument_track`, `remove_track` and `set_loop` cannot be undone.
## Develop
```bash
uv run pytest
```
The tests use a fake LMMS server. They do not need LMMS.
**Windows:** tested against a fake pipe server only.
## License
MIT
TDQS
Scored across 17 tools
Each tool targets a clearly distinct resource and action: listing tracks vs clips, getting vs setting notes, listing plugins vs params, transport vs loop, and undo/redo are all unambiguous. Cross-references in descriptions further clarify when to use related tools like list_params and set_param.
All names use snake_case and most follow a verb_noun pattern (set_tempo, list_tracks, add_midi_clip, save_project). A few standard actions like transport, undo, and redo omit the noun, which is a minor deviation but still predictable.
The 17 tools cover the DAW's core operations with little redundancy, and each appears to earn its place. The count is slightly above the ideal 3–15 range but remains reasonable for a DAW control surface.
Core workflows are well covered: project summary, tempo, tracks, clips, notes, params, transport, loop, undo/redo, and save. However, clips can be added and read but not deleted or updated (no remove_clip or set_clip), which is a notable lifecycle gap.