# Haku MCP server

> Allows AI agents to compose lofi music by drawing strokes on a canvas that translate into melodies and rhythmic patterns.

- Repository: https://github.com/pinkpixel-dev/haku
- Page: https://hostedmcp.org/servers/pinkpixel-dev/haku
- Official: yes
- Transport: stdio
- Stars: 1
- License: Apache-2.0

## Install

### Claude Code

```sh
claude mcp add haku -- npx -y @pinkpixel/haku
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "haku": {
      "command": "npx",
      "args": [
        "-y",
        "@pinkpixel/haku"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "haku": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@pinkpixel/haku"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"haku","type":"stdio","command":"npx","args":["-y","@pinkpixel/haku"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "haku": {
      "command": "npx",
      "args": [
        "-y",
        "@pinkpixel/haku"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add haku -- npx -y @pinkpixel/haku
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.haku]
command = "npx"
args = ["-y", "@pinkpixel/haku"]
```

### Gemini CLI

```sh
gemini mcp add -s user haku npx -- -y @pinkpixel/haku
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "haku": {
      "command": "npx",
      "args": [
        "-y",
        "@pinkpixel/haku"
      ]
    }
  }
}
```

## FAQ

### Can AI agents use Haku?

Yes, Haku includes an MCP server and CLI that allow AI agents to draw music, take snapshots, analyze projects, and export audio using the same tools as the canvas.

### How does drawing translate to music?

The system reads strokes where the horizontal axis represents time and the vertical axis represents pitch, automatically snapping notes to chords and scales.

### What file formats can I export?

You can export your compositions as MIDI files or render them as WAV files.

### Does the music sound the same in the browser and the CLI?

Yes, the browser and Node.js use the same audio code to ensure consistent sound.
