Trickbeat

Trickbeat for agents

Make original music for a video, podcast, stream or game. Pick a style, a seed and up to seven choices. The same input gives the same output, so you can change one layer at a time.

Start here: HTTP API · Public CLI · WebMCP · Local MCP package · Recipes · Plain text docs

Ways to make music

InterfaceStatusUse it for
Public CLIAvailableShell and Node 18+, no checkout. Writes a finished WAV, MIDI or stems and prints JSON.
HTTP APILiveFor fetch-only agents. Send song JSON; get a finished WAV, MIDI or stems, with the duration and lead you ask for. No account or API key.
WebMCPBrowser onlyTwo tools on /make/, only if the browser exposes navigator.modelContext.
MCP stdioLocal package, not on npm yetFour local tools for styles, options, WAV and stems. Build the package from a checkout with npm pack.

HTTP render API

Base URL: https://api.trickbeat.org. The hosted endpoint is free within the daily limits below. If you have a checkout, run npm run server (Node only, no install) and use http://127.0.0.1:8787 instead. No authentication is required. Send all song settings in each request; there's no saved session or job to poll.

Copy-paste examples: curl for WAV, MIDI and stems, Node.js fetch and a health check.

Options: duration, lead, MIDI and stems (CLI, HTTP and MCP)

These four options work in the public CLI now, in the local MCP package and in the HTTP API. They let you finish a file without an external editor. See the recipes for complete commands.

Example: a 30-second loop request returns 32 seconds, 5 whole cycles of 6.4 seconds (8-bit, seed 12). A 24-second request for the organ-house intro (seed 21) returns exactly 24 seconds.

Render limits

How a song is described

The fourth pick changes the melody hook; lead plays the lead on another instrument, with the melody written for it. To lower drums without changing the other inputs, use "levels":{"drums":60} in HTTP or local MCP, or --levels drums=60 in the CLI. Levels are mix controls, not a promise of linear PCM amplitude.

A share link opens the same song in the editor, not the rendered WAV. The CLI, the HTTP API (JSON link and X-Trickbeat-Link header) and local MCP all write the editor's own link: style, seed and picks, plus levels=drums.bass.chords.lead when a level is not 100, and inst=lead:<id> when you asked for a lead (CLI, HTTP and MCP), dur=<seconds> when you passed a duration and loop=1 when you asked for a loop (for example &dur=24 or &dur=30&loop=1). A link without them opens the full song. The editor shows the length in one short line, for example "24 s version", with a button to switch to the full song, and keeps it while the person edits. It renders at 44.1 kHz, so the bytes match when you kept the default sample rate. A lead you ask for changes the melody the same way in your WAV and in the editor, so the link opens the song you heard. Keep style, seed, picks, levels, loop, duration and lead for an exact re-render.

Give the song to a person

A person opens the share link at /make/ and presses "Download as WAV": the link carries your duration and loop, so the file is byte-identical to yours.

If a call fails

Every route names the bad field and the allowed values, so you can fix the call without these docs.

Style idNameBPM
organ-house90s organ house124
lofiLo-fi80
rat-beatRat beat120
dembowReggaeton94
technoTechno130
bossaBossa nova136
cat-beatCat beat108
christmasChristmas128
pedal-popPedal pop105
odd-five5/4 groove140
border-dustDesert104
8-bit8-bit150

Public CLI

Download trickbeat.mjs and run it with Node 18 or newer. No checkout or install is needed. It fetches the engine on first use and caches it for a day. It writes WAV by default, MIDI with --format midi and one WAV per layer with --stems. Output is one line of JSON; errors are JSON on stderr with exit code 1.

curl -O https://trickbeat.org/make/app/trickbeat.mjs
node trickbeat.mjs styles --base https://trickbeat.org/make/app/
node trickbeat.mjs options --style lofi --seed 7 --picks AAA --base https://trickbeat.org/make/app/
node trickbeat.mjs make --style lofi --seed 7 --picks ABAAAAA --levels drums=80,lead=120 --loop --out song.wav --base https://trickbeat.org/make/app/

Finished files, with a length, a lead instrument, MIDI and stems:

node trickbeat.mjs make --style organ-house --seed 21 --picks AAAAABA --duration 24 --lead epiano --out intro-24s-epiano.wav --base https://trickbeat.org/make/app/
node trickbeat.mjs make --style 8-bit --seed 12 --picks AAAAAAA --loop --duration 30 --format midi --stems menu-stems --out menu-loop.mid --base https://trickbeat.org/make/app/

options shows only the next step: pass --picks AAA for melody options. Seven picks return done: true. The local MCP tool trickbeat_get_options returns all seven steps.

Commands: help, styles, options, make. Flags: --style, --seed, --picks, --levels (for example drums=80,lead=120), --loop, --duration (1 to 60 seconds), --lead (instrument id), --format (wav or midi), --stems (folder), --rate (sample rate), --out, --base. The make result includes the file path, duration, share link and credit. It also has review: warnings such as "lead buried under chords" are advice, and the file is still written. CLI and HTTP stems are drums.wav, bass.wav, chords.wav and lead.wav; they never include extras.wav. With --duration it also has requestedSeconds, seconds and, for loops, cycles; with --stems it lists the stem files.

WebMCP in the browser

When a browser supports WebMCP (navigator.modelContext), the /make/ page registers two tools:

The same functions are on window.trickbeat as styles(), options(), make() and download() for agents that run page scripts.

MCP stdio Local package, not on npm yet

A local MCP server (stdio, Node 18+) that lets an agent make original music with the Trickbeat engine. It runs on your machine, needs no account, and writes WAV files. The package carries its own copy of the engine, so the installed server needs no checkout, and by default it makes no network call. The same input always gives the same file.

Every song can be changed step by step: change one letter in picks (A, B or C for each of the 7 steps: beat, bass, chords, melody, tricks, arrangement, mix) or one layer level, render again, and repeat until the song feels exactly right.

There is no public npm package, source URL or remote MCP endpoint yet. Today you build the package once with npm pack in a checkout of the Trickbeat repo (not public yet), then install the tarball on any machine. Without a checkout, use the public CLI, or the HTTP API.

Tools

ToolWhat it doesInput
trickbeat_list_stylesThe 12 styles: id, name, bpm, description. Read-only.none
trickbeat_get_optionsThe 7 steps with their A/B/C options, the concept and sources of each step, and the current picks. Read-only.style, seed, picks
trickbeat_make_songWrites one WAV, or a MIDI file with format midi. Returns path, duration, share link, credit line and sources note.style, seed, picks, levels, loop, duration, lead, format, out
trickbeat_make_stemsWrites one WAV per layer: drums, bass, chords and lead, byte-identical to the CLI and the HTTP API for the same input.as trickbeat_make_song, without format, with out_dir instead of out

trickbeat_make_song overwrites the file at out if it exists, and trickbeat_make_stems overwrites files with the same names. Both tools work offline. Errors come back as tool errors with a hint (for example an unknown style tells the agent to call trickbeat_list_styles). The server does not crash on bad input.

Offline and deterministic

Install from a checkout

There is no public npm package yet. Build the tarball once, in a checkout of the Trickbeat repo. npm install is not needed for this step, and the tarball is git-ignored. Replace /absolute/path/to/checkout with its local path:

cd /absolute/path/to/checkout/mcp
npm pack

This writes trickbeat-mcp-0.1.0.tgz (about 70 kB) in mcp/. On any machine with Node 18+, install it into a folder of your choice. The install downloads the MCP dependencies from the npm registry once; after that the server renders offline:

mkdir ~/trickbeat-mcp && cd ~/trickbeat-mcp
npm install /absolute/path/to/checkout/mcp/trickbeat-mcp-0.1.0.tgz
echo "$(pwd)/node_modules/trickbeat-mcp/src/server.js"

Replace /ABSOLUTE/PATH/TO/node_modules/trickbeat-mcp/src/server.js in each snippet below with the output of the echo. To try the server inside a checkout without packing, run npm install in mcp/, then node "$PWD/src/server.js". To use another copy of the engine, set TRICKBEAT_APP=/path/to/app.

To check the install without an MCP client, run this in the install folder. It sends three JSON-RPC lines to the server and writes the 24-second intro; the second output line is the result. For the same input the WAV, MIDI and stems are byte-identical to the CLI files.

printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"check","version":"1"}}}' '{"jsonrpc":"2.0","method":"notifications/initialized"}' '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"trickbeat_make_song","arguments":{"style":"organ-house","seed":21,"picks":"AAAAABA","duration":24,"lead":"bell","out":"/tmp/intro-24s-bell.wav"}}}' | node node_modules/trickbeat-mcp/src/server.js

Claude Desktop

Add to claude_desktop_config.json (Settings, Developer, Edit Config), then restart Claude Desktop:

{
  "mcpServers": {
    "trickbeat": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/node_modules/trickbeat-mcp/src/server.js"]
    }
  }
}

Claude Code

claude mcp add trickbeat -- node /ABSOLUTE/PATH/TO/node_modules/trickbeat-mcp/src/server.js

Codex

Add to ~/.codex/config.toml:

[mcp_servers.trickbeat]
command = "node"
args = ["/ABSOLUTE/PATH/TO/node_modules/trickbeat-mcp/src/server.js"]

Cursor

Add to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

{
  "mcpServers": {
    "trickbeat": {
      "command": "node",
      "args": ["/ABSOLUTE/PATH/TO/node_modules/trickbeat-mcp/src/server.js"]
    }
  }
}

Remote mode (optional)

Set TRICKBEAT_API to make trickbeat_make_song and trickbeat_make_stems ask a Trickbeat render API instead of rendering locally. It is unset by default. Set it to https://api.trickbeat.org for the hosted API, or run npm run server in a checkout and set TRICKBEAT_API=http://127.0.0.1:8787; in a config, add "env": {"TRICKBEAT_API": "http://127.0.0.1:8787"} next to args.

The WAV is byte-identical to the local one. Stems come from the API: the same four WAVs as the local ones. duration, lead and format go to the API too. If the API cannot be reached, the tool error says so; unset TRICKBEAT_API to render locally.

First call

Call trickbeat_make_song with {"style":"lofi","seed":7,"picks":"ABAAAAA","loop":true,"out":"/absolute/path/song.wav"}. The result has the path, the duration in seconds and a share link a person can open at /make/ to keep changing the song. More in the examples.

Examples

Copy-paste HTTP API examples and recipes for HTTP or the public CLI. Each returns the finished file:

Licence and credit

Songs made with Trickbeat are free to use, including commercially in videos, podcasts, streams and games. Credit is appreciated, not required: Made with Trickbeat (trickbeat.org). The code licence is separate and not yet decided.

Tricks are common music-production techniques, described in our own words. The sources list gives the concept of each one and links to lessons that explain it.

For models and crawlers

/llms.txt is the short index. /llms-full.txt has everything on this page in one plain file. Crawlers are welcome: see /robots.txt.