Skip to main content

Hydrogen MCP Server

Hydrogen MCP Server banner with a charcoal drum sequencer and illuminated mint and amber pads

Sequence, mix, and render Hydrogen projects from your local MCP client.

Checks PyPI version Downloads GitHub stars Python 3.13–3.14 FastMCP 4.2.6 Hydrogen 1.2.7 MIT license

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

  1. Install uv and Hydrogen. The Windows Hydrogen installer includes hydrogen.exe and h2cli.exe. uv downloads Python 3.13 by itself when your system has none.

  2. Check that the server finds Hydrogen. The command prints the detected paths and exits with status 1 when the app or h2cli is missing.

    uvx hydrogen-mcp-server --check
    
  3. 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.2. 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:

  1. Open Preferences → OSC in Hydrogen.
  2. Enable OSC support and OSC feedback. Use port 9000 or set HYDROGEN_OSC_PORT to match your app.
  3. 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 source song to edit a copy of it, or omit it to start blank. Set drumkit to a drumkit.xml manifest from hydrogen_list to replace the instruments. Notes for instrument IDs missing from the new kit are removed.
  • Notes and timing. Use instrument IDs from hydrogen_read_song for offline edits. Hydrogen uses 48 ticks per quarter note and 192 ticks for a 4/4 bar. In a pattern edit, notes replaces every note and add_notes keeps the existing ones. remove_patterns deletes patterns from the song, its arrangement, and its virtual links. Live OSC indexes are zero-based except for one-based mixer strip positions.
  • 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_audio reports 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 a silent flag. 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_midi writes 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_notes counts 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 in columns_without_time_signature.
  • MIDI import. hydrogen_import_midi reads 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. Set pitched_instrument to play all other notes as keys of one instrument, for a bass line or melody. Set channel to read one channel, such as 10 for drums. Notes play their whole sample unless note_lengths keeps 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 in ignored_time_signatures, and the earlier one stays in effect.
  • Sample layers. sample_instruments adds instruments from existing audio files. sample_layers edits gain, pitch, velocity range, trim, loop, or sample assignment. Keep custom samples with the project for portable exports.
  • Drumkits. hydrogen_create_drumkit turns the instruments of a song into a drumkit folder with its samples, and returns a reference you can pass to drumkit. Import and export Hydrogen’s .h2drumkit archives. The import tool’s upgrade mode accepts a manifest or archive and writes the upgraded result to a new directory. hydrogen_read_instrument reads 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, workflow audits, and a wheel build on Windows. CodeQL scans the Python code and the workflows for security and quality problems, and pull requests get a dependency review. 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.

Changelog · Verification notes · Security policy · MIT license

Metadata

Release files for hydrogen-mcp-server 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hydrogen-mcp-server 0.3.2
File Size Uploaded Provenance Actions
hydrogen_mcp_server-0.3.2.tar.gz 318.6 kB Without provenance Details for hydrogen_mcp_server-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for hydrogen-mcp-server 0.3.2
File Interpreter ABI Platform Actions
hydrogen_mcp_server-0.3.2-py3-none-any.whl Python 3 none any Details for hydrogen_mcp_server-0.3.2-py3-none-any.whl

Total release size: 378.9 kB

Release files / hydrogen_mcp_server-0.3.2.tar.gz

Download URL hydrogen_mcp_server-0.3.2.tar.gz
Size 318.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7bebe90649c1198d7c91abac6328695e2d05e19a8e2dc36c441b8c6d725bd993
BLAKE2b-256 checksum
How to use checksums
c86a523afddd0a04a6dd7d7df7553a88ee775eefdbf0750ddffdb5c2aef10933
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.2-py3-none-any.whl

Download URL hydrogen_mcp_server-0.3.2-py3-none-any.whl
Size 60.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ad2009980092a7fa097f9308d328c3ffe034278bdfdb43a61e62b803ccd178b
BLAKE2b-256 checksum
How to use checksums
377d67ccef551fcfecb3ecee24c402af2c021f80b393f6800797235c8f6f0298
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.2

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.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page