Logo vun Strudel MCP Bridge

Strudel MCP Bridge

Communautéit
phildougherty

MCP server and browser extension for using LLM's to create music on Strudel.cc

Editeurphildougherty
Repositorystrudel-mcp-bridge
SproochJavaScript
Forks
6
Stären
20
Disponibel Tools
0
Transporttypstdio
Kategorien
Linken
  • Tools mat KI-Workflows verbannen

    Strudel MCP Bridge stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    20 Stären an 6 Forks aus dem verlinkte Repository.

Strudel MCP Server

Bridge Claude Code and Claude Desktop to Strudel, the browser-based live coding music environment.

What is This?

This MCP server lets Claude AI assistants generate and play live-coded music directly in your browser using Strudel's powerful pattern language. Just describe what you want, and Claude will create the code and play it instantly.

Quick Start

1. Install dependencies:

bash
npm install

2. Build the server:

bash
npm run build

3. Install the MCP server:

bash
claude mcp add strudel node /path/to/strudel-mcp-bridge/mcp-server/dist/server.js -s user

4. Open strudel.cc in your browser and install the browser extension

5. Ask Claude to make music!

"Create a dark synthwave beat with heavy bass"
"Add UK garage drums"
"Make it faster and add reverb"

Architecture

User → Claude (generates Strudel code) → MCP Server (bridge) → Browser → 🎵

Key Design: This is a simple bridge. Claude generates the Strudel code, the server just forwards it to your browser.

Features

  • ✅ No AI dependencies - Claude generates the code itself
  • ✅ No API keys required - Zero configuration
  • ✅ Real-time - Instant music playback
  • ✅ Comprehensive docs - Embedded Strudel API reference
  • ✅ Fast & lightweight - 336 lines of code
  • ✅ Works everywhere - Claude Code, Claude Desktop, any MCP client

Installation

For Development / Local Use

bash
# Clone and install
git clone <repo-url>
cd mcp-server
npm install
npm run build
npm start

For Claude Desktop

1. Build the server:

bash
cd /path/to/strudel-mcp-bridge/mcp-server
npm install
npm run build

2. Add to Claude Desktop config:

Open your Claude Desktop MCP settings file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add this configuration:

json
{
  "mcpServers": {
    "strudel": {
      "command": "node",
      "args": ["/absolute/path/to/strudel-mcp-bridge/mcp-server/dist/server.js"]
    }
  }
}

3. Restart Claude Desktop

For Browser Extension

1. Install the extension:

  • Open Chrome/Edge and navigate to chrome://extensions/
  • Enable "Developer mode" in the top-right corner
  • Click "Load unpacked"
  • Select the browser-extension folder from this project
  • The extension should appear in your extensions list

2. Connect to strudel.cc:

  • Open strudel.cc in your browser
  • The extension will automatically connect to the MCP server
  • Look for a connection indicator (should turn green when connected)

3. Start making music!

"Create a jazzy beat with piano and brushed drums"
"Make a dark techno track with 808 drums"
"Add UK garage drums to this"

Usage

How It Works

  1. You ask Claude to create music (e.g., "make a techno beat")
  2. Claude reads the Strudel API reference (via MCP Resources)
  3. Claude generates valid Strudel code
  4. MCP server forwards the code to your browser via WebSocket
  5. Browser plays the music through Strudel

Browser Extension

The browser extension bridges the MCP server to strudel.cc:

  • Connects to WebSocket server at ws://localhost:3001
  • Injects code execution capabilities into Strudel
  • Provides visual connection status indicator
  • See installation instructions in the "Installation" section above

Example Session

You: "Create a house beat with 808 drums"
Claude: [reads strudel://reference resource]
Claude: [generates Strudel code]
Claude: [calls execute_pattern]
Browser: 🎵 Music plays!

You: "Add a deep bass line"
Claude: [modifies the code]
Claude: [calls execute_pattern]
Browser: 🎵 Updated music plays!

MCP Resources

strudel://reference

The complete Strudel API reference is exposed as an MCP Resource. This allows Claude Code and Claude Desktop to automatically access the documentation without needing file system access.

Resource Details:

  • URI: strudel://reference
  • Name: Strudel API Reference
  • MIME Type: text/markdown
  • Description: Complete Strudel live coding API reference with syntax, sounds, effects, and examples

Usage: MCP clients can fetch this resource at session start to provide the LLM with complete Strudel API knowledge. The documentation is embedded directly in the compiled server, making it fully portable even when installed via npm globally.

How to Fetch:

json
{
  "method": "resources/read",
  "params": {
    "uri": "strudel://reference"
  }
}

The resource returns the complete markdown documentation including:

  • Mini-notation syntax and operators
  • 300+ sound sources (drums, synths, GM instruments, samples)
  • 70+ audio effects with parameters
  • Pattern structure and factories
  • Time modifiers and transformations
  • Style templates with examples
  • Critical rules and best practices

MCP Tools

execute_pattern

Execute raw Strudel code in the connected browser.

Parameters:

  • code (string): Raw Strudel code to execute

Example:

javascript
execute_pattern({
  code: `setcps(0.5)
stack(
  s("bd*4, ~ sd ~ sd, hh*8").bank("tr808"),
  note("c2*8").s("sawtooth").lpf(300)
)`
});

stop_pattern

Stop all currently playing patterns.

Parameters: None

get_connection_status

Check if browser is connected and ready.

Parameters: None

Returns: Connection status information

Project Structure

strudel-mcp-bridge/
├── mcp-server/                # MCP server (bridge to browser)
│   ├── src/
│   │   ├── server.ts          # Main MCP server
│   │   └── websocket/
│   │       └── bridge-server.ts  # WebSocket communication
│   ├── STRUDEL_REFERENCE.md   # Strudel API docs (embedded in server)
│   ├── MIGRATION_GUIDE.md     # v1.0 → v2.0 migration guide
│   └── package.json
├── browser-extension/         # Chrome extension (connects strudel.cc)
│   ├── manifest.json
│   ├── content-script.js
│   ├── background.js
│   └── popup.html
└── README.md                  # This file

Why This Architecture?

Simple Bridge = Reliable:

  • Claude generates the code (it's good at this!)
  • Server just forwards it (keeps it simple)
  • No double-AI translation issues
  • No API keys or configuration needed

Previous version had AI-in-server which caused:

  • Double AI calls (slow, expensive)
  • Pattern complexity loss in translation
  • API key requirements
  • 1600+ lines of fragile validation code

Current version: Direct execution = Fast, reliable, simple.

See MIGRATION_GUIDE.md if upgrading from v1.0.

Development

MCP Server Development

bash
cd mcp-server

# Install dependencies
npm install

# Build
npm run build

# Development mode with watch
npm run dev

# Clean build
rm -rf dist
npm run build

Browser Extension Development

bash
cd browser-extension

# No build step needed - just load the extension in Chrome:
# 1. Open chrome://extensions/
# 2. Enable "Developer mode"
# 3. Click "Load unpacked"
# 4. Select the browser-extension folder

Testing the Full Stack

  1. Start MCP server (via Claude Desktop or manually)
  2. Install browser extension (developer mode)
  3. Open strudel.cc
  4. Check connection status (indicator should be green)
  5. Ask Claude to create music
  6. Verify pattern plays in browser

Strudel Reference

The complete Strudel API documentation is available in two ways:

  1. MCP Resource (Recommended): Access via strudel://reference resource - no file system access needed
  2. File: Read STRUDEL_REFERENCE.md if you have file system access

The documentation includes:

  • Mini-notation syntax
  • 300+ sound sources (drums, synths, instruments, samples)
  • 70+ audio effects
  • Pattern factories and time modifiers
  • Style templates and examples
  • Critical rules and best practices

Troubleshooting

No Browser Connected

Symptoms: execute_pattern returns "No browser connected"

Solutions:

  1. Open strudel.cc in your browser
  2. Install the browser extension
  3. Check that WebSocket server is running on port 3001
  4. Use get_connection_status to verify

Invalid Strudel Code

Symptoms: Pattern doesn't play or errors in browser

Solutions:

  1. Ensure code starts with setcps(NUMBER)
  2. Check all sound names are valid (see STRUDEL_REFERENCE.md)
  3. Validate mini-notation syntax
  4. Check for balanced brackets and quotes

Build Errors

Solutions:

bash
rm -rf node_modules package-lock.json
npm install
npm run build

Architecture Details

WebSocket Protocol

Server → Browser:

json
{
  "type": "execute_code",
  "code": "setcps(0.5)\\nstack(...)"
}
json
{
  "type": "stop_all"
}

Browser → Server:

json
{
  "type": "execution_result",
  "data": { "success": true }
}
json
{
  "type": "browser_ready"
}

MCP Protocol

Standard MCP protocol via stdio:

  • tools/list - List available tools
  • tools/call - Execute a tool

Contributing

Keep It Simple! This server should remain a simple bridge.

Do NOT add:

  • ❌ AI generation logic (Claude does this)
  • ❌ Pattern validation (adds complexity)
  • ❌ Code transformation (fragile)
  • ❌ API dependencies (increases setup friction)

Do add:

  • ✅ Better WebSocket reliability
  • ✅ Improved error messages
  • ✅ Additional MCP resources (if useful)
  • ✅ Documentation improvements

Philosophy: The intelligence is in Claude, not in this server.

FAQ

Q: Do I need an API key? A: No! Zero configuration required.

Q: Can I use this with other LLMs besides Claude? A: Yes! Any MCP-compatible AI can use this server. They'll need to read the strudel://reference resource and generate valid Strudel code.

Q: Does this work offline? A: The MCP server works offline, but you need internet to access strudel.cc in your browser.

Q: Can I use a different port? A: Currently hardcoded to 3001. Open an issue if you need this configurable.

Q: Does the browser extension work with Firefox/Safari? A: Currently Chrome/Edge only (Manifest V3). Firefox support planned.

Q: Can I publish patterns to share with others? A: Yes! Strudel has built-in sharing features. The patterns are just Strudel code.

Q: What if I want to use a different live coding environment? A: The architecture is extensible - you could create a bridge to other environments like TidalCycles, Sonic Pi, etc.

License

MIT

Credits

  • Strudel - Alex McLean, Felix Roos, and contributors
  • MCP - Anthropic
  • Built with ❤️ for live coding music

Installatioun

TypingMind
{
  "mcpServers": {
    "strudel-mcp-bridge": {
      "command": "node",
      "args": [
        "dist/server.js"
      ]
    }
  }
}

Strudel MCP Bridge MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Strudel MCP Bridge verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Strudel MCP Bridge als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Strudel MCP Bridge an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "strudel-mcp-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Strudel MCP Bridge. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Strudel MCP Bridge.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Strudel MCP Bridge?
Strudel MCP Bridge
Jo. Ech hunn et gelies.
Dat hunn ech mat Strudel MCP Bridge fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Strudel MCP Bridge benotzt?

Strudel MCP Bridge ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Strudel MCP Bridge MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Strudel MCP Bridge mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Strudel MCP Bridge MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Strudel MCP Bridge verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Strudel MCP Bridge MCP mat TypingMind?

Strudel MCP Bridge leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Strudel MCP Bridge MCP an TypingMind zur Verfügung?

Strudel MCP Bridge stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Strudel MCP Bridge MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Strudel MCP Bridge eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇