Skip to main content
Glama
williamzujkowski

Strudel MCP Server

init

Initialize Strudel in the browser to enable AI-powered music generation and live coding for creating TidalCycles patterns.

Instructions

Initialize Strudel in browser

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registration of the 'init' tool in the getTools() method, including name, description, and empty input schema (no parameters required).
    {
      name: 'init',
      description: 'Initialize Strudel in browser',
      inputSchema: { type: 'object', properties: {} }
    },
  • Input schema for 'init' tool: empty object, no input parameters required.
    inputSchema: { type: 'object', properties: {} }
  • Handler implementation in executeTool switch statement: calls StrudelController.initialize(), sets isInitialized=true, and writes any pending generated patterns.
    case 'init':
      const initResult = await this.controller.initialize();
      this.isInitialized = true;
      
      // Write any pending patterns
      if (this.generatedPatterns.size > 0) {
        const lastPattern = Array.from(this.generatedPatterns.values()).pop();
        if (lastPattern) {
          await this.controller.writePattern(lastPattern);
          return `${initResult}. Loaded generated pattern.`;
        }
      }
      return initResult;
  • Core initialization logic delegated by MCP handler: launches headless Chromium browser, navigates to strudel.cc, optimizes loading, sets up console monitoring and audio analyzer.
    async initialize(): Promise<string> {
      if (this.browser) {
        return 'Already initialized';
      }
    
      this.browser = await chromium.launch({
        headless: this.isHeadless,
        args: [
          '--use-fake-ui-for-media-stream',
          '--disable-dev-shm-usage',
          '--no-sandbox',
          '--disable-setuid-sandbox',
          '--disable-gpu',
          '--disable-software-rasterizer'
        ],
      });
    
      const context = await this.browser.newContext({
        permissions: ['microphone'],
        viewport: { width: 1280, height: 720 },
        reducedMotion: 'reduce',
      });
    
      this._page = await context.newPage();
    
      // Optimize page loading
      await this._page.route('**/*', (route) => {
        const resourceType = route.request().resourceType();
        // Block unnecessary resources
        if (['image', 'font', 'media'].includes(resourceType)) {
          route.abort();
        } else {
          route.continue();
        }
      });
    
      await this._page.goto('https://strudel.cc/', {
        waitUntil: 'domcontentloaded', // Changed from networkidle for faster load
        timeout: 15000,
      });
    
      // Wait for editor with optimized timeout
      await this._page.waitForSelector('.cm-content', { timeout: 8000 });
    
      // Set up console monitoring for runtime errors
      this.setupConsoleMonitoring();
    
      await this.analyzer.inject(this._page);
    
      return 'Strudel initialized successfully';
    }
  • State flag tracking whether the browser has been initialized by the 'init' tool.
    private isInitialized: boolean = false;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Initialize' implies a setup/configuration action, but the description doesn't reveal whether this is idempotent, what side effects occur, whether it requires specific conditions, or what happens on failure. For a zero-parameter tool with no annotation coverage, this leaves significant behavioral questions unanswered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient phrase with zero wasted words. It's appropriately sized for a simple initialization tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's apparent simplicity (0 parameters, no output schema), the description is minimally adequate but leaves gaps. Without annotations or output schema, it doesn't clarify what 'initialization' entails, what state changes occur, or what success/failure looks like. For a tool in a complex musical environment with many siblings, more context would be helpful.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0 parameters and 100% schema description coverage, the baseline is 4. The description doesn't need to explain parameters since none exist, and it correctly avoids mentioning any.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Initialize Strudel in browser' clearly states the action (initialize) and target (Strudel in browser), providing a specific verb+resource combination. However, it doesn't distinguish this tool from its many siblings (like 'load', 'restore_history', or 'show_browser'), which might also involve initialization or browser-related operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With siblings like 'load', 'restore_history', and 'show_browser' that might relate to initialization or browser setup, there's no indication of prerequisites, timing, or distinctions between these tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/williamzujkowski/strudel-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server