Strudel MCP Server

Strudel MCP Server

Enables AI assistants to work with Strudel live coding patterns for music creation, including parsing mini notation, generating rhythmic patterns, accessing music theory (scales/chords), and applying pattern transformations.

Category
访问服务器

README

Strudel MCP Server

MCP License: MIT Node.js

한국어 | English

An MCP (Model Context Protocol) server that enables LLMs to work with Strudel - a live coding environment for music patterns. This server allows AI assistants to parse, analyze, generate, and transform Strudel patterns.

What is Strudel?

Strudel is a JavaScript port of TidalCycles, a live coding environment for creating music through code. It uses a concise "mini notation" to express complex rhythmic patterns:

s("bd sd [hh hh] cp")  // kick, snare, two hi-hats, clap

What is MCP?

Model Context Protocol (MCP) is an open protocol that enables AI assistants to interact with external tools and services. This server exposes Strudel's pattern engine to any MCP-compatible client.

Features

  • Pattern Analysis - Parse mini notation, query pattern events, validate syntax
  • Music Theory - Access scales, chords, and voicings
  • Code Generation - Generate patterns by style (drums, bass, melody, chords, ambient)
  • Pattern Transformation - Apply transformations like fast, slow, rev, jux
  • Reference - List available functions, sounds, and samples

Installation

Prerequisites

  • Node.js 18 or higher
  • npm or pnpm

Setup

# Clone the repository
git clone https://github.com/YOUR_USERNAME/strudel-mcp.git
cd strudel-mcp

# Install dependencies
npm install

# Build the project
npm run build

Usage

With Claude Desktop

Add to your Claude Desktop configuration:

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

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

Then restart Claude Desktop.

With Claude Code

claude mcp add strudel node /absolute/path/to/strudel-mcp/dist/index.js

With MCP Inspector

Test the server interactively:

npm run inspect

Available Tools

Pattern Analysis

Tool Description Example Input
strudel_parse_mini Parse mini notation to AST {"notation": "bd sd [hh hh] cp"}
strudel_query_pattern Query events in time range {"code": "bd sd", "startCycle": 0, "endCycle": 2}
strudel_validate_code Validate syntax {"code": "bd sd [hh hh]"}
strudel_explain_pattern Human-readable explanation {"notation": "bd(3,8)"}

Music Theory

Tool Description Example Input
strudel_list_scales List available scales {"filter": "minor"}
strudel_get_scale Get notes in a scale {"scale": "pentatonic minor", "root": "A"}
strudel_list_chords List chord types {}
strudel_get_voicing Get chord voicing {"chord": "Cmaj7"}

Code Generation

Tool Description Example Input
strudel_generate_pattern Generate pattern by style {"style": "drums", "complexity": "medium"}
strudel_transform_pattern Apply transformations {"code": "bd sd", "transformations": ["fast(2)", "rev"]}

Reference

Tool Description Example Input
strudel_list_functions List pattern functions {"category": "timing"}
strudel_list_sounds List built-in sounds {"category": "drums"}

Examples

Parse a Pattern

User: Parse the pattern "bd sd [hh hh] cp"

Tool: strudel_parse_mini
Input: {"notation": "bd sd [hh hh] cp"}

Output:

{
  "notation": "bd sd [hh hh] cp",
  "eventCount": 5,
  "events": [
    {"value": "bd", "whole": "0 -> 0.25"},
    {"value": "sd", "whole": "0.25 -> 0.5"},
    {"value": "hh", "whole": "0.5 -> 0.625"},
    {"value": "hh", "whole": "0.625 -> 0.75"},
    {"value": "cp", "whole": "0.75 -> 1"}
  ]
}

Generate a Drum Pattern

User: Generate a complex drum pattern

Tool: strudel_generate_pattern
Input: {"style": "drums", "complexity": "complex"}

Output:

{
  "style": "drums",
  "complexity": "complex",
  "code": "s(\"bd(3,8), sd(2,8,1), hh*16?0.3, cp(1,4,2)\")",
  "explanation": "Complex polyrhythmic drums using Euclidean patterns"
}

Get Scale Notes

User: What notes are in A minor pentatonic?

Tool: strudel_get_scale
Input: {"scale": "pentatonic minor", "root": "A"}

Output:

{
  "name": "A pentatonic minor",
  "notes": ["A", "C", "D", "E", "G"],
  "usage": "n(\"0 1 2 3 4\").scale(\"A:pentatonic_minor\")"
}

Development

# Build
npm run build

# Run directly
npm start

# Watch mode (rebuild on changes)
npm run dev

# Test with MCP Inspector
npm run inspect

Project Structure

strudel-mcp/
├── src/
│   ├── index.ts        # Main server with all tools
│   └── types.d.ts      # TypeScript declarations for Strudel
├── dist/               # Compiled output
├── package.json
├── tsconfig.json
└── README.md

Dependencies

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details.

Links

Acknowledgments

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选