Strudel MCP Bridge logo

Strudel MCP Bridge

Community
phildougherty

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

Publisherphildougherty
Repositorystrudel-mcp-bridge
LanguageJavaScript
Forks
6
Stars
20
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    Strudel MCP Bridge exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    20 stars and 6 forks from the linked 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

Installation

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

Use Strudel MCP Bridge MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Strudel MCP Bridge is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Strudel MCP Bridge as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Strudel MCP Bridge MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "strudel-mcp-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Strudel MCP Bridge MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Strudel MCP Bridge MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Strudel MCP Bridge to help me with this task?
Strudel MCP Bridge
Sure. I read it.
Here is what I found using Strudel MCP Bridge.

Frequently asked questions

What is the Strudel MCP Bridge MCP server used for?

Strudel MCP Bridge is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Strudel MCP Bridge MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Strudel MCP Bridge with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Strudel MCP Bridge MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Strudel MCP Bridge connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Strudel MCP Bridge MCP to TypingMind?

Strudel MCP Bridge runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Strudel MCP Bridge MCP provide in TypingMind?

Strudel MCP Bridge exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Strudel MCP Bridge MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Strudel MCP Bridge requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇