Logo Strudel MCP Bridge

Strudel MCP Bridge

Cộng đồng
phildougherty

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

Nhà phát hànhphildougherty
Kho mãstrudel-mcp-bridge
Ngôn ngữJavaScript
Bản fork
6
Sao
20
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Strudel MCP Bridge cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    20 sao và 6 bản fork từ kho mã được liên kết.

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

Cài đặt

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

Dùng MCP Strudel MCP Bridge với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Strudel MCP Bridge, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Strudel MCP Bridge làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Strudel MCP Bridge.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "strudel-mcp-bridge": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Strudel MCP Bridge, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Strudel MCP Bridge.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Strudel MCP Bridge giúp tôi làm việc này không?
Strudel MCP Bridge
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Strudel MCP Bridge.

Câu hỏi thường gặp

Máy chủ MCP Strudel MCP Bridge dùng để làm gì?

Strudel MCP Bridge là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Strudel MCP Bridge với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Strudel MCP Bridge với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Strudel MCP Bridge với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Strudel MCP Bridge, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Strudel MCP Bridge với TypingMind?

Strudel MCP Bridge hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Strudel MCP Bridge cung cấp những công cụ nào trong TypingMind?

Strudel MCP Bridge cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Strudel MCP Bridge không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Strudel MCP Bridge yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇