Skip to main content
Glama
SuperCollider Headless MCP Server

SuperCollider Headless MCP Server

by dheerajstvpm

play_code

Evaluates arbitrary SuperCollider sclang code and returns console output or errors, syncing automatically before and after execution to support safe SynthDef compilation.

Instructions

Evaluate arbitrary sclang code (SynthDef, Pdef, Tdef, Ndef, patterns, buffers, microtonal scales, etc.) and return console output/errors. Automatically syncs before/after for safe SynthDef compilation.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "code": "<code>"
    },
    "name": "play_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesSuperCollider code to evaluate
timeoutNoEvaluation timeout in ms

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.6

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose two valuable behaviors: automatic sync before and after execution, and that console output and errors are returned. It omits the biggest risk: evaluated sclang mutates persistent server/session state (starts synths, defines classes), and there is no mention of whether execution is destructive or how the supplied timeout interacts with long-running code.

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?

Two sentences, both earning their place: the first defines the operation, scope, and return value; the second front-loads the safety behavior. No filler or restatement of the title.

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?

For a code-evaluation tool with zero annotations and no output schema, the definition covers input and return reasonably but leaves the mutation profile vague. An agent cannot tell from this text whether the evaluated code persists, whether repeated calls compound state, or what happens on timeout.

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

Parameters3/5

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

Schema description coverage is 100%, so both parameters are already documented, establishing a baseline of 3. The description adds modest value by clarifying that 'code' means arbitrary sclang (including microtonal scales and buffer work), but gives no extra guidance on tuning the timeout for heavy operations like SynthDef compilation.

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?

States a specific verb and resource ('Evaluate arbitrary sclang code') and enumerates what that covers (SynthDef, Pdef, Tdef, Ndef, patterns, buffers, microtonal scales), plus the return (console output/errors). The purpose is unmistakable and clearly distinct from stop_all or get_status, though no sibling is named to reinforce the contrast.

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

Usage Guidelines3/5

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

Usage is only implied: the word 'arbitrary' hints that this is the general-purpose escape hatch, and safe SynthDef compilation is framed as the main job. There is no explicit when-to-use versus when to prefer setup_engine, stop_all, or export_wav, and no stated preconditions (must the engine be running?).

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