Get the FREE Ultimate OpenClaw Setup Guide →

Pd

A Model Context Protocol (MCP) server for Pure Data, an open-source visual programming language and patchable environment for real-time computer music.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nikmaniatis-pd-mcp-server uv --directory PATH_TO_PD_MCP_SERVER run main.py \
  --env PD_OSC_HOST="127.0.0.1" \
  --env PD_OSC_PORT="5000" \
  --env PD_FEEDBACK_PORT="5001"

How to use

This MCP server provides a bridge between Claude AI and Pure Data (Pd) via the Model Context Protocol. It enables Claude to dynamically create and configure Pd objects, connect them to build signal flows, control DSP on/off, and adjust object parameters in real time using natural language requests. The system relies on three components: the MCP server (Python), the OSC daemon that talks to Pd, and a Pd patch that accepts OSC commands to enact the requested changes. You can send MCP tool calls from Claude to create Pd objects, wire connections, and update parameters, with OSC messages flowing to Pd to enact those changes and return feedback when available.

How to install

Prerequisites:

  • Python 3.7+
  • Pure Data (vanilla) 0.51+
  • Required Python packages: python-osc, fastmcp, jsonschema
  • uv package manager

Install uv:

On macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

On Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Install Python dependencies for the MCP server:

pip install python-osc fastmcp jsonschema

Clone the repository (if not already):

git clone https://github.com/nikmaniatis/Pd-MCP-Server.git
cd Pd-MCP-Server

Note: Ensure Pd is running and the provided Pd patch is loaded before starting the MCP server.

Additional notes

Environment variables and configuration:

  • PD_OSC_HOST: Pd OSC host (default 127.0.0.1)
  • PD_OSC_PORT: Pd OSC receive port (default 5000)
  • PD_FEEDBACK_PORT: OSC feedback port (default 5001)

Troubleshooting tips:

  • If object creation or connections fail, check that Pd is running and the patch is open.
  • Verify that the object IDs match exactly what was returned from create_object.
  • Ensure the OSC ports (e.g., 5000) are not in use by another process.
  • If you see message format errors, confirm your OSC messages conform to the patch’s expected format.

This server uses a knowledge of Pd state via the patch and maintains an index-based tracking system to reliably wire objects. If tracking gets inconsistent, restarting both the MCP server and Pd often helps.

Related MCP Servers

Sponsor this space

Reach thousands of developers