strudel-mcp

strudel-mcp

Enables LLMs to interact with Strudel, a JavaScript live coding music environment, by executing patterns, retrieving states, and accessing documentation.

Category
Visit Server

README

Strudel MCP - Model Context Protocol Integration for Strudel

This project provides an MCP (Model Context Protocol) server that enables LLMs to interact with Strudel - a JavaScript port of the Tidal Cycles pattern language for live coding music.

Overview

Strudel MCP allows Large Language Models (LLMs) to:

  • Execute Strudel patterns via natural language commands
  • Retrieve current pattern states
  • Get Strudel documentation through Context7 integration
  • Access browser development tools for debugging

Architecture

┌─────────────┐    MCP     ┌──────────────┐    WebSocket    ┌─────────────┐
│   LLM       │ ◄──────► │ strudel-mcp  │ ◄─────────────► │  Strudel    │
│  (Qwen/     │  Protocol │   Server     │   Communication│  REPL/      │
│  etc.)      │           │ (Node.js ✨) │                │  Frontend   │
└─────────────┘           └──────────────┘                └─────────────┘

Server Options

Node.js Server

cd server-node
npm install
npm run dev

Components

  • strudel-mcp (Node.js): MCP server with WebSocket communication
  • WebSocket Server: Handles bidirectional communication between MCP and Strudel
  • Frontend: Web-based Strudel interface with synchronization capabilities
  • Context7 Integration: External documentation service for Strudel docs

Original Strudel Project

This project is based on and inspired by the original Strudel project:

Note:

  • The source_of_strudel/ directory was cloned from https://codeberg.org/uzu/strudel on 2025-10-12 for development reference.
  • Both directories were local development references and are not included in this GitHub repository.

License

This project follows the AGPL-3.0 license, consistent with the original Strudel project. See LICENSE file for details.

Features

MCP Tools

  • execute_strudel_code - Execute Strudel patterns
  • get_current_pattern - Get current active pattern
  • get_strudel_knowledge - Built-in Strudel documentation and knowledge base

Synchronization Features

  • BroadcastChannel API: Cross-tab pattern synchronization
  • Real-time Updates: Immediate pattern changes across multiple tabs/windows
  • Error Handling: Robust error recovery and fallback mechanisms

Quick Start

Prerequisites

  • Bun (>=1.0) - Recommended runtime
  • Modern browser with WebSocket and Web Audio API support

Note: This project is optimized for Bun. While it works with Node.js, we strongly recommend using Bun for better performance and developer experience.

Installation

  1. Clone the repository:

    git clone https://github.com/utenadev/strudel-mcp.git
    cd strudel-mcp
    
  2. Install server dependencies:

    cd server-node
    bun install
    cd ..
    
  3. Install frontend dependencies:

    cd frontend
    bun install
    cd ..
    
  4. Start the servers:

    # Terminal 1: Start MCP + WebSocket server
    cd server-node
    bun run dev
    
    # Terminal 2: Start frontend
    cd frontend
    bun run dev
    
  5. Run tests:

    cd frontend
    bun run test  # 23 tests
    

Usage with LLM

Qwen3-Coder + Qwen-code (MCP Configuration Required)

Create .qwen/settings.json in your project root:

Production (built version):

{
  "mcpServers": {
    "strudel-mcp": {
      "command": "node",
      "args": ["server-node/dist/index.js"],
      "env": {
        "NODE_ENV": "production"
      }
    }
  }
}

Development (npm dev):

{
  "mcpServers": {
    "strudel-mcp": {
      "command": "npm", 
      "args": ["run", "dev"],
      "cwd": "server-node",
      "env": {
        "NODE_ENV": "development",
        "DEBUG": "true"
      }
    }
  }
}

Pre-built settings provided in this repository:

  • .qwen/settings.json - Production ready
  • .qwen/settings.dev.json - Development mode

Build first for production: cd server-node && npm run build

Gemini CLI (MCP Configuration Required)

Configure ~/.gemini/settings.json:

{
  "selectedAuthType": "gemini-api-key",
  "theme": "Dracula",
  "mcpServers": {
    "strudel-mcp": {
      "command": "node",
      "args": ["/path/to/strudel-mcp/server-node/dist/index.js"],
      "cwd": "/path/to/strudel-mcp/server-node"
    }
  }
}

Build first: cd server-node && npm run build

Verify with /mcp command in Gemini CLI

Claude Desktop (MCP Configuration Required)

Configure Claude Desktop settings:

  1. Open Claude Desktop → Settings → Developer → Edit Config
  2. Add to mcpServers:
{
  "mcpServers": {
    "strudel-mcp": {
      "command": "node",
      "args": ["/path/to/strudel-mcp/server-node/dist/index.js"],
      "cwd": "/path/to/strudel-mcp/server-node"
    }
  }
}
  1. Restart Claude Desktop
  2. Verify tools are available in new chat

GitHub Copilot (MCP Configuration Required)

In VS Code with GitHub Copilot (v1.99+):

  1. Open Settings → Extensions → GitHub Copilot
  2. Enable "MCP servers in Copilot" policy
  3. Use GitHub MCP Registry or manual configuration
{
  "mcpServers": {
    "strudel-mcp": {
      "command": "node",
      "args": ["/path/to/strudel-mcp/server-node/dist/index.js"],
      "cwd": "/path/to/strudel-mcp/server-node"
    }
  }
}

Note: Replace /path/to/strudel-mcp with your actual repository path

Development

Project Structure

strudel-mcp/
├── server-node/               # Node.js MCP server
│   ├── src/
│   │   ├── index.ts          # Main server entry
│   │   ├── mcp/              # MCP protocol handlers
│   │   ├── websocket/        # WebSocket manager
│   │   └── utils/            # Utilities (logger, config)
│   ├── test/                 # Server tests
│   ├── package.json          # Dependencies
│   └── tsconfig.json         # TypeScript config
├── frontend/                  # React-based Strudel interface
│   ├── src/
│   │   ├── App.tsx           # Main application component
│   │   ├── hooks/            # React hooks (useStrudel, useWebSocket)
│   │   ├── presets/          # Genre-based pattern presets
│   │   ├── types/            # TypeScript type declarations
│   │   └── test/             # Frontend tests
│   ├── package.json          # Dependencies
│   └── vitest.config.ts      # Test configuration
├── docs/                      # Documentation
├── source_of_strudel/         # Strudel source reference (git submodule)
└── images/                    # Screenshots and assets

Key Technologies

  • Runtime: Bun (recommended)
  • Backend: TypeScript + Express + @modelcontextprotocol/sdk
  • Frontend: React + TypeScript + Vite
  • Audio: Strudel packages (@strudel/core, @strudel/webaudio, @strudel/transpiler)
  • Communication: WebSocket protocol
  • Testing: Vitest + React Testing Library

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code style and conventions
  • Add appropriate error handling
  • Update documentation for new features
  • Test cross-browser compatibility

Roadmap

  • [ ] Enhanced pattern synchronization across multiple tabs
  • [ ] Improved error handling and recovery
  • [ ] Additional LLM tools for advanced pattern manipulation
  • [ ] Performance optimizations
  • [ ] Mobile browser support
  • [ ] Plugin system for extensions

API Reference

WebSocket Endpoints

  • ws://localhost:8081/ws?type=mcp - MCP client connection
  • ws://localhost:8081/ws?type=strudel - Strudel frontend connection

MCP Tool Reference

execute_strudel_code

Execute Strudel pattern code

{
  "name": "execute_strudel_code",
  "arguments": {
    "code": "s('bd hh sd oh').fast(2)"
  }
}

get_current_pattern

Get currently executing pattern

{
  "name": "get_current_pattern",
  "arguments": {}
}

get_strudel_knowledge

Built-in Strudel documentation

{
  "name": "get_strudel_knowledge",
  "arguments": {
    "topic": "basics",
    "query": "drum patterns"
  }
}

Available topics: basics, patterns, effects, troubleshooting

Troubleshooting

Common Issues

  1. WebSocket Connection Failed

    • Ensure port 8081 is available
    • Check firewall settings
    • Verify server and frontend are running
  2. Audio Not Playing

    • Check browser audio permissions
    • Ensure user interaction initiated audio context
    • Verify Web Audio API support
  3. MCP Connection Issues

    • Verify MCP server is running
    • Check LLM client configuration
    • Ensure stdio communication is working

Logging

  • Server logs: Console output
  • Frontend logs: Browser developer console
  • WebSocket logs: Server console with verbose mode

Acknowledgments

  • Original Strudel Team: For creating an amazing live coding environment
  • TidalCycles Community: For the pattern language inspiration
  • MCP Contributors: For the Model Context Protocol standard

License

This project is licensed under the AGPL-3.0 License - see the LICENSE file for details, consistent with the original Strudel project.


Note: This is an independent implementation inspired by Strudel. For the official Strudel project, please visit strudel.cc.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured