Hydrogen MCP Server
Sequence, mix, and render Hydrogen projects from your local MCP client.
Quick start · Add it to your agent · Tool overview · First groove · Configuration
This independent integration exposes 31 MCP tools and maps 67 OSC action names from Hydrogen 1.2.7. It supports live transport and mixer control, native project editing with any installed drumkit, drumkit creation, MIDI import and export, audio rendering and inspection, and Windows desktop controls for Hydrogen menus and dialogs.
Quick start
-
Install uv and Hydrogen. The Windows Hydrogen installer includes
hydrogen.exeandh2cli.exe. uv downloads Python 3.13 by itself when your system has none. -
Check that the server finds Hydrogen. The command prints the detected paths and exits with status 1 when the app or
h2cliis missing.uvx hydrogen-mcp-server --check
-
Add the server to your agent, then ask it for a beat: "Make a two-bar rock groove with the GM kit and render it to WAV."
The server runs on your machine over stdio. It needs no account, API key, or network service. It is tested against Hydrogen 1.2.7 on Windows, Linux, and macOS. See platform support for what each platform offers.
Add it to your agent
Every MCP client starts the same command. uvx fetches the package from PyPI once and caches it.
uvx hydrogen-mcp-server
| Agent | Setup |
|---|---|
| Claude Code | claude mcp add --scope user hydrogen -- uvx hydrogen-mcp-server |
| Codex CLI | codex mcp add hydrogen -- uvx hydrogen-mcp-server |
| Gemini CLI | gemini mcp add --scope user hydrogen uvx hydrogen-mcp-server |
| Grok CLI | grok mcp add hydrogen uvx hydrogen-mcp-server |
| VS Code and GitHub Copilot | Add the servers entry below to .vscode/mcp.json |
| Claude Desktop, Cursor, and other clients | Add the mcpServers entry below to the client's MCP settings file |
Clients with an mcpServers block share one format. Claude Desktop opens its file from Settings → Developer → Edit Config. Cursor reads ~/.cursor/mcp.json or .cursor/mcp.json in a project, and Gemini CLI reads ~/.gemini/settings.json.
{
"mcpServers": {
"hydrogen": {
"command": "uvx",
"args": ["hydrogen-mcp-server"]
}
}
}
VS Code names the block servers and states the transport.
{
"servers": {
"hydrogen": {
"type": "stdio",
"command": "uvx",
"args": ["hydrogen-mcp-server"]
}
}
}
An installed package keeps your songs and renders in ~/Hydrogen Projects. Add an env block to change that folder or any other setting. uvx keeps the version it fetched first: run uvx hydrogen-mcp-server@latest once to upgrade, or pin a version with uvx hydrogen-mcp-server@0.3.1. Each GitHub release carries the same wheel with its checksums. To follow unreleased work, use uvx --from git+https://github.com/RandyNorthrup/hydrogen-mcp-server hydrogen-mcp.
Run from a checkout
git clone https://github.com/RandyNorthrup/hydrogen-mcp-server.git
cd hydrogen-mcp-server
uv sync --locked --no-dev
Register the absolute path of .venv/Scripts/hydrogen-mcp.exe on Windows, or .venv/bin/hydrogen-mcp on Linux and macOS, as the command with no arguments. A checkout keeps projects in its own projects folder.
Connect to Hydrogen for live control
Ask your agent to open Hydrogen, or call hydrogen_launch. It starts the app with OSC enabled, waits until Hydrogen answers and its interface has loaded, and reports osc_ready and interface_ready. When your saved preferences have OSC off or use another port, the launch uses a copy of them with OSC on. The copy lives in your projects folder, and your own preferences file stays unchanged. The launch declines to start a second Hydrogen while one already answers on the OSC port.
To control a Hydrogen that you start yourself:
- Open Preferences → OSC in Hydrogen.
- Enable OSC support and OSC feedback. Use port
9000or setHYDROGEN_OSC_PORTto match your app. - Restart Hydrogen. It opens its OSC listener at startup.
hydrogen_status shows a timestamp in osc.last_feedback_received_at once Hydrogen answers. Until then, osc.hint names the setting to change, and osc_supported tells you whether this Hydrogen build has OSC at all. Offline project editing and h2cli audio export work with the desktop app closed. Keep trusted source files in the configured project or library roots.
Tool overview
| Workflow | Tools |
|---|---|
| Discover files, live controls, and feedback | hydrogen_list, hydrogen_status, hydrogen_controls |
| Control transport, recording, BPM, mixer, timeline, MIDI triggers, and JACK | hydrogen_live |
| Launch Hydrogen and work with the active song | hydrogen_launch, hydrogen_open_song, hydrogen_new_song, hydrogen_save_as |
| Compose and inspect songs, patterns, instruments, and layered samples | hydrogen_read_song, hydrogen_edit_song, hydrogen_read_instrument, hydrogen_read_pattern, hydrogen_write_pattern, hydrogen_add_live_pattern, hydrogen_open_pattern |
| Read and create playlists | hydrogen_read_playlist, hydrogen_write_playlist |
| Create, load, inspect, validate, import, upgrade, and export drumkits | hydrogen_create_drumkit, hydrogen_load_drumkit, hydrogen_read_drumkit, hydrogen_validate_drumkit, hydrogen_import_drumkit, hydrogen_export_drumkit |
| Render a mix, export isolated stereo stems, and check the result | hydrogen_render, hydrogen_render_stems, hydrogen_read_audio |
| Convert between songs and Standard MIDI Files | hydrogen_import_midi, hydrogen_export_midi |
| View and interact with a Hydrogen window on Windows | hydrogen_desktop_windows, hydrogen_desktop_image, hydrogen_desktop_input |
The hydrogen://reference/osc resource lists the action signatures. For live controls, sent_unconfirmed means the UDP datagram was sent. Mixer feedback comes back through hydrogen_status. hydrogen_save_as verifies the saved song file and changes the active save path. Save current edits before opening or creating another live song. To change the notes or instruments of the open song, call hydrogen_save_as, edit that file with hydrogen_edit_song, and open the result with hydrogen_open_song.
For Windows desktop control, list the windows, capture a selected window, then send client-relative pointer coordinates or keyboard input to that window. The feature requires an interactive Windows session. Plugins and JACK operations depend on support in the installed Hydrogen build.
Make a two-bar groove
Ask your MCP client to create two bars with the factory GM kit and export a stereo WAV. To call the tools directly, send this payload to hydrogen_edit_song. With no source, the song starts blank and takes its instruments from the drumkit.
{
"output": "Grooves/first-beat.h2song",
"edit": {
"name": "First beat",
"bpm": 110,
"drumkit": { "scope": "factory", "path": "drumkits/GMRockKit/drumkit.xml" },
"patterns": [
{
"name": "Beat",
"notes": [
{ "instrument": 0, "position": 0 },
{ "instrument": 0, "position": 48 },
{ "instrument": 0, "position": 96 },
{ "instrument": 0, "position": 144 }
]
}
],
"arrangement": [["Beat"], ["Beat"]]
}
}
Then send this payload to hydrogen_render.
{
"source": { "path": "Grooves/first-beat.h2song" },
"output": "Grooves/first-beat.wav"
}
Send { "source": { "path": "Grooves/first-beat.wav" } } to hydrogen_read_audio to confirm the length and peak level. Both files appear in the Grooves folder of your projects folder. File references use paths relative to projects, user, or factory. Discover those paths with hydrogen_list. Every edit writes a new file and leaves existing files untouched, so choose a new output path for each version. Drumkit imports can also create a folder in the user library.
Editing and rendering details
- Templates and drumkits. Pass a
sourcesong to edit a copy of it, or omit it to start blank. Setdrumkitto adrumkit.xmlmanifest fromhydrogen_listto replace the instruments. Notes for instrument IDs missing from the new kit are removed. - Notes and timing. Use instrument IDs from
hydrogen_read_songfor offline edits. Hydrogen uses 48 ticks per quarter note and 192 ticks for a 4/4 bar. In a pattern edit,notesreplaces every note andadd_noteskeeps the existing ones.remove_patternsdeletes patterns from the song, its arrangement, and its virtual links. Live OSC indexes are zero-based except for one-based mixerstrippositions. - Audio. Hydrogen renders WAV, AIFF, FLAC, Ogg Vorbis, Opus, AU, CAF, Wave64, VOC, and MP3. MP3 and Opus need a Hydrogen build whose audio library includes those codecs, as the Windows build does. Use 48 kHz for Opus and 8-bit PCM for VOC. Stems are separate stereo WAVs rendered by Hydrogen.
- Audio checks.
hydrogen_read_audioreports channels, sample rate, frames, and duration for every format Hydrogen renders. PCM and float files in WAV, Wave64, AIFF, AU, and CAF also report peak level and asilentflag. A silent render usually means Hydrogen could not find the samples. Use the frame count of a sample when you trim or loop it. - MIDI export.
hydrogen_export_midiwrites what the MIDI export of Hydrogen writes: the arrangement on the grid, each note on the MIDI output note and channel of its instrument, and channel 10 for instruments without a channel. A note that plays its whole sample lasts 12 ticks. The file also carries tempo markers, time signatures taken from the pattern sizes, timeline tags as markers, and velocity automation. Swing, humanize, and lead or lag belong to playback and stay out of the file.skipped_notescounts notes that make no sound (zero velocity, zero probability, or automation at zero), notes outside their pattern or without an instrument, and notes outside the MIDI pitch range. A column whose length is no multiple of three ticks has no MIDI time signature and is counted incolumns_without_time_signature. - MIDI import.
hydrogen_import_midireads format 0 and 1 files and writes one pattern per distinct bar. Instruments come from a template song or a drumkit. A MIDI note plays the instrument with that MIDI output note, and the result lists unmapped note numbers. Setpitched_instrumentto play all other notes as keys of one instrument, for a bass line or melody. Setchannelto read one channel, such as 10 for drums. Notes play their whole sample unlessnote_lengthskeeps the MIDI durations. Time signatures set the pattern sizes, and tempo changes and markers snap to bar starts. A time signature that no Hydrogen pattern can hold is counted inignored_time_signatures, and the earlier one stays in effect. - Sample layers.
sample_instrumentsadds instruments from existing audio files.sample_layersedits gain, pitch, velocity range, trim, loop, or sample assignment. Keep custom samples with the project for portable exports. - Drumkits.
hydrogen_create_drumkitturns the instruments of a song into a drumkit folder with its samples, and returns a reference you can pass todrumkit. Import and export Hydrogen’s.h2drumkitarchives. The import tool’s upgrade mode accepts a manifest or archive and writes the upgraded result to a new directory.hydrogen_read_instrumentreads the layers of a song instrument or of a kit instrument.
Configuration
Set these variables in your MCP client's env block. From a checkout, you can also copy .env.example to .env and run uv run --env-file .env hydrogen-mcp. Reconnect the client after changing settings. Run hydrogen-mcp --check to see the values in effect.
| Environment variable | Windows default | macOS default | Linux default |
|---|---|---|---|
HYDROGEN_INSTALL_DIR |
C:/Program Files/Hydrogen |
/Applications/Hydrogen.app |
Unset. Point it at an extracted AppImage or at a prefix such as /usr/local |
HYDROGEN_APP |
hydrogen.exe in the install directory |
Contents/MacOS/hydrogen in the bundle |
hydrogen on PATH, or AppRun in the install directory |
HYDROGEN_CLI |
h2cli.exe in the install directory |
h2cli on PATH |
h2cli on PATH, or usr/bin/h2cli in the install directory |
HYDROGEN_SYSTEM_DATA |
data in the install directory |
Contents/Resources/data in the bundle |
/usr/share/hydrogen/data, or usr/share/hydrogen/data in the install directory |
HYDROGEN_USER_DATA |
~/.hydrogen/data |
~/Library/Application Support/Hydrogen/data |
~/.hydrogen/data |
HYDROGEN_CONFIG |
~/.hydrogen/hydrogen.conf |
~/Library/Application Support/Hydrogen/hydrogen.conf |
~/.hydrogen/hydrogen.conf |
HYDROGEN_OSC_PORT |
9000 |
9000 |
9000 |
HYDROGEN_PROJECT_DIR |
~/Hydrogen Projects for an installed package, or projects inside a checkout |
Same | Same |
The MCP server sends OSC over loopback. Hydrogen controls its own listener, so check its firewall access before using OSC on an untrusted network. Hydrogen resolves the asset references inside songs and kits used for native rendering.
Platform support
| Platform | Hydrogen package | What works |
|---|---|---|
| Windows | Official installer | Everything, including desktop controls |
| Linux | Official AppImage, or a distribution package of 1.2.7 | Everything except desktop controls |
| macOS | Official app | Song editing, MIDI conversion, audio checks, and opening songs in the app. The official macOS app is built without OSC and without h2cli. Live control, rendering, stems, and drumkit validation, creation, and archives work with a Hydrogen build that includes them |
The official AppImage holds h2cli and the factory data inside the image. Extract it once and point the server at the folder:
./Hydrogen-1.2.7-x86_64.AppImage --appimage-extract
export HYDROGEN_INSTALL_DIR="$PWD/squashfs-root"
Verification
CI runs formatting, lint, types, protocol tests, security and dependency checks, and a wheel build on Windows. It runs the protocol tests on Linux and macOS with Python 3.13 and 3.14. It also installs the official Hydrogen 1.2.7 packages on Linux and macOS and runs the native suite there. That suite verifies live OSC, app launch, song and kit operations, MIDI round trips, rendering in every format, and stem isolation against Hydrogen itself. On Windows it runs locally and also covers desktop capture and input.
uv sync --locked
uv run --locked ruff format --check .
uv run --locked ruff check .
uv run --locked mypy
uv run --locked pytest -q
uv run --locked bandit -q -r src
uv run --locked deptry .
uv run --locked vulture src tests --min-confidence 80
uv run --locked pip-audit --local --progress-spinner off
uv build --no-sources
Run the native suite on a machine with Hydrogen installed. The launch and desktop tests open disposable Hydrogen windows with their own preferences and data folders.
$env:HYDROGEN_NATIVE_TESTS = '1'
uv run --locked pytest -q
A release is cut by pushing a v tag that matches the package version. The release workflow tests the tag, builds the wheel and source archive, attaches them with checksums to the GitHub release, and publishes the same files to PyPI through trusted publishing.
Metadata
Release files for hydrogen-mcp-server 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hydrogen_mcp_server-0.3.1.tar.gz | 316.9 kB | Without provenance | Details for hydrogen_mcp_server-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hydrogen_mcp_server-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for hydrogen_mcp_server-0.3.1-py3-none-any.whl |
Total release size: 377.2 kB
Release files / hydrogen_mcp_server-0.3.1.tar.gz
| Download URL | hydrogen_mcp_server-0.3.1.tar.gz |
|---|---|
| Size | 316.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
82a2ad53a561b50db8002525355b4ee217074bb35d49620be3eba0e381e0893c
|
|
BLAKE2b-256 checksum How to use checksums |
f24571b64c856cf4acd1db79f64a7fdec37f5479d95ad600eb3a7240be41f37e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / hydrogen_mcp_server-0.3.1-py3-none-any.whl
| Download URL | hydrogen_mcp_server-0.3.1-py3-none-any.whl |
|---|---|
| Size | 60.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e557bc58597c5cfcae6f7b14d162deeef95eb25967325c59c1f940e77956a905
|
|
BLAKE2b-256 checksum How to use checksums |
ef81cfd5e9e5c5ab219459ea2ff49f432315c2f55eeabf5e745bf26bc99d28a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for hydrogen-mcp-server 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.