Official · MODEL CONTEXT PROTOCOL

abhishekjairath sonic pi mcp

Model Context Protocol (MCP) server for controlling Sonic Pi through AI assistants

WHAT IT CONNECTS

abhishekjairath sonic pi mcp 为 AI Agent 提供什么

  • Play individual notes with customizable synth parameters
  • Execute arbitrary Sonic Pi code
  • Works with any MCP-compatible client (Claude Desktop, Cursor, etc.)
  • [Bun](https://bun.sh)
  • [Sonic Pi](https://sonic-pi.net/) (v4.0 or higher)
  • An MCP-compatible client (Cursor, Claude Desktop, etc.)
  • `note` (required): MIDI note number (0-127)
  • `synth` (optional): Synth to use (e.g., ":saw", ":beep", ":prophet")
  • `sustain` (optional): Note duration in seconds (default: 1)
  • `cutoff` (optional): Filter cutoff frequency (default: 100)
  • `code` (required): Sonic Pi code to execute
  • **No Sound**
  • Ensure Sonic Pi is running
  • Check that the OSC handler code is running in Sonic Pi
  • Verify Sonic Pi is listening on port 4560 (default)
  • **Connection Errors**
  • Check if another instance of the server is running
  • Restart Sonic Pi
  • Ensure no other applications are using port 4560
  • **Code Execution Errors**
  • Check the Sonic Pi log window for error messages
  • Verify the syntax of your Sonic Pi code
  • Ensure all required synths and samples are available
  • Install and start the MCP Inspector:
  • Open your browser and navigate to http://localhost:3000
  • In the MCP Inspector UI, configure the connection:
  • Command: `bun`
  • Arguments: `run src/server.ts`
  • Working Directory: `/path/to/your/sonic-pi-mcp` (use your actual project path)
  • Transport Type: stdio
  • Test the `play_note` tool:
  • Test the `run_code` tool:
  • **Bun Installation Issues**
  • Make sure Bun is in your PATH
  • Try running `bun --version` to verify the installation
  • If using Claude Desktop, use the full path to Bun in the config
  • **MCP Inspector Connection Issues**
  • Verify the server is running (`bun run dev`)
  • Check that the working directory path is correct
  • Ensure no other instances of the server are running
  • **OSC Communication Issues**
  • Confirm Sonic Pi is running and the OSC handler code is active
  • Check the server logs for connection errors
  • Verify port 4560 is available and not blocked
  • Fork the repository
  • Create your feature branch (`git checkout -b feature/amazing-feature`)
  • Commit your changes (`git commit -m 'Add some amazing feature'`)
  • Push to the branch (`git push origin feature/amazing-feature`)
  • Open a Pull Request

SECURITY

MCP 收录不等于安全审核

MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。