Skip to content
Conduit

mcp server

sonic-pi-mcp

TrippingKelsea/sonic-pi-mcpcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

This project does not publish an install method we can turn into a config. Follow the README instead.

README

synced Oct 24, 2026

Sonic Pi MCP Server

A Model Context Protocol (MCP) server that enables AI assistants like Amazon Q to interact with Sonic Pi for code-based music creation and performance.

Overview

This project implements an MCP server that bridges the gap between AI assistants and Sonic Pi, allowing for programmatic music creation through natural language requests. By leveraging the Rust MCP SDK, this server provides a set of tools that can be invoked by AI assistants to control Sonic Pi's synthesizers, samples, and musical patterns.

Key capabilities include:

  • Playing notes, chords, and scales
  • Creating and manipulating loops and patterns
  • Controlling BPM, synth parameters, and effects
  • Loading and playing samples
  • Generating musical sequences based on parameters

Technical Architecture

The Sonic Pi MCP server is built with the following components:

  1. MCP Server Layer: Implements the Model Context Protocol using the Rust MCP SDK
  2. Sonic Pi Interface: Communicates with Sonic Pi via OSC (Open Sound Control)
  3. Tool Definitions: A set of music creation and control functions exposed to AI assistants
  4. Request/Response Handling: Processes incoming requests and returns appropriate responses

Implementation Details

Transport Modes

The server supports two transport modes:

  1. stdio: Uses standard input/output for communication (default)
  2. tcp: Uses TCP for communication, listening on a specified address

Tool Namespace

The server exposes its tools under the namespace sonic-pi, which is important for Amazon Q to correctly identify and use the tools.

Error Handling

The server includes comprehensive error handling for:

  • Connection issues with Sonic Pi
  • Invalid parameters
  • Malformed requests

Getting Started

Prerequisites

  • Rust and Cargo
  • Sonic Pi installed and running
  • MCP-compatible AI assistant (e.g., Amazon Q)

Installation

# Clone the repository
git clone https://github.com/yourusername/sonic-pi-mcp.git
cd sonic-pi-mcp

# Build the project
cargo build --release

# Run the server with stdio transport (default)
cargo run --release

# Or run with TCP transport
cargo run --release -- --transport tcp --address 127.0.0.1:8080

Usage with Amazon Q

To use the server with Amazon Q:

  1. Start Sonic Pi
  2. Run the MCP server
  3. Connect Amazon Q to the MCP server
  4. Use natural language to create music through Sonic Pi

Example interactions:

  • "Play a C major chord"
  • "Create a drum loop at 120 BPM"
  • "Add reverb to the current track"

Testing

The project includes both unit tests and integration tests:

# Run all tests
cargo test

# Run only unit tests
cargo test --lib

# Run only integration tests
cargo test --test integration_tests

Note: Integration tests that require Sonic Pi to be running are marked with #[ignore] by default. To run them:

cargo test -- --ignored

License

GPL V2.1

↑↓ navigate openesc close