Pure Data MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Pure Data MCP Server add a sine wave oscillator and connect to output"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Pure Data MCP Server
This project provides integration between Claude AI and Pure Data through the Model Context Protocol (MCP). With this integration, Claude can dynamically create, modify, and control Pure Data patches through natural language.
Overview
The system consists of three core components:
MCP Server (
mcp_server.py): Implements the Model Context Protocol interface for ClaudeOSC Daemon (
osc_daemon.py): Handles OSC communication with Pure DataPure Data Patch (
example_patch.pd): A dynamic patching solution that receives OSC messages
Related MCP server: synthlab-mcp
Features
Dynamic Object Creation: Create any Pure Data object on demand through Claude
Connection Management: Connect objects together to build complex signal flows
Workspace Management: Clear all objects and reset state with
clear_workspaceDSP Control: Start and stop audio processing remotely
Parameter Control: Modify parameters of objects in real-time
Global Object Tracking: Reliable index-based connection system
Error Handling: Robust error detection and reporting
Debugging Tools: Comprehensive logging system
Recent Updates
Installation
Prerequisites
Python 3.7+
Pure Data (vanilla) 0.51+
Required Python packages:
python-oscfastmcpjsonschema
Install uv
On macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | shOn Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Learn more: astral-sh/uv
🛠️ Usage
Clone the repository
git clone https://github.com/nikmaniatis/Pd-MCP-Server.gitIntegration with Claude Desktop
Open:
Claude > Settings > Developer > Edit Config > claude_desktop_config.json
Add the following block:
{
"mcpServers": {
"Pure Data MCP Server": {
"command": "uv",
"args": [
"--directory",
"PATH_TO_PD_MCP_SERVER",
"run",
"main.py"
],
"env": {
"PD_OSC_HOST": "127.0.0.1",
"PD_OSC_PORT": "5000",
"PD_FEEDBACK_PORT": "5001"
}
}
}
}Note: If the
uvcommand is not found, runwhich uv(Unix) orGet-Command uv(PowerShell) and use the full path in the"command"field.
Quick Example
Once the MCP server is connected and the Pd patch is listening, you can ask Claude to build patches using natural language:
"Create an osc~ at 440 Hz, connect it to a dac~, and start DSP."
Claude will call the MCP tools to produce something like:
create_object("osc~", ["440"], {"x": 100, "y": 50}) → index 0
create_object("*~", ["0.25"], {"x": 100, "y": 110}) → index 1
create_object("dac~", [], {"x": 100, "y": 170}) → index 2
connect_objects({"id": "osc~_100_50", "port": 0}, {"id": "*~_100_110", "port": 0})
connect_objects({"id": "*~_100_110", "port": 0}, {"id": "dac~_100_170", "port": 0})
connect_objects({"id": "*~_100_110", "port": 0}, {"id": "dac~_100_170", "port": 1})
start_dsp()This creates the following patch in the workspace subpatch:
osc~ 440
|
*~ 0.25 (volume)
/ \
dac~ L+RYou can then ask Claude to modify the patch, add effects, change frequencies, or build more complex signal chains — all through conversation.
Architecture
Message Flow
Claude executes MCP tools based on user requests
MCP Server processes the tool calls
OSC messages are formatted and sent to Pure Data
Pure Data executes the commands via the dynamic patch
Feedback (if any) is returned via OSC callbacks
Troubleshooting
Common Issues
Object Creation Fails: Ensure Pure Data is running and the patch is open
Connection Issues: Verify that object IDs match exactly what was returned from
create_objectPort Conflicts: Check if port 5000 is already in use
Message Format Errors: Ensure message formats match the expected format in the Pure Data patch
Lost Objects: If object tracking gets confused, try restarting both the MCP server and Pure Data
Known Limitations
No delete or disconnect support: The Pd patch (
example_patch.pd) only handles/pd/create,/pd/connect,/pd/dsp, and/pd/clear. Objects and connections cannot be individually removed — useclear_workspaceto reset the entire workspace instead.Signal objects with zero arguments: When signal objects like
+~or*~are created with a0argument via dynamic patching (e.g.,obj 100 100 +~ 0), Pd 0.55+ treats the second inlet as a float inlet instead of a signal inlet, breaking signal connections. The MCP server automatically strips trailing zero arguments from signal objects to avoid this issue.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgements
Pure Data - The open source visual programming language
Model Context Protocol - The protocol enabling AI tools
Python-OSC - Python implementation of OSC
Available Tools
11 toolsclear_workspaceA
Clear all objects from the Pd workspace subpatch and reset index tracking.
This sends /pd/clear to Pure Data, which clears the workspace subpatch,
and resets the server-side object index counter so new objects start from 0.
Args:
ctx: MCP context
Returns:
Response with status and number of objects cleared
Inputs: no named parameters.
connect_objectsA
Create a connection between two Pd objects.
This tool connects two objects in the Pure Data patch by creating a
patch cord between the specified outlet and inlet.
The connection system uses numeric indices rather than string IDs,
as required by the Pure Data patch. The global object_indices
dictionary maps from the user-friendly string IDs to these numeric indices.
Args:
source: Source object with id and port
e.g., {"id": "osc~_100_100", "port": 0}
destination: Destination object with id and port
e.g., {"id": "dac~_200_100", "port": 0}
ctx: MCP context
Returns:
Response with status
Example:
connect_objects({"id": "osc~_100_100", "port": 0}, {"id": "dac~_200_100", "port": 0}, ctx)
Inputs: source (required), destination (required).
create_objectA
Create a new Pd object.
This tool creates a new object in the Pure Data patch at the specified position.
The object can be any valid Pd object type (e.g., osc~, dac~) with optional arguments.
The implementation handles:
1. Creating the object in Pure Data via OSC
2. Assigning a unique numeric index to the object for connection tracking
3. Returning an object_id that can be used in subsequent API calls
The object_id follows the format "{object_type}_{x}_{y}" to provide
a predictable way to reference objects.
Args:
object_type: Type of Pd object (e.g., osc~, dac~)
args: Arguments for the object (e.g., ["440"] for an oscillator)
position: Position on the canvas (x, y coordinates)
ctx: MCP context
Returns:
Response with object ID and status
Example:
create_object("osc~", ["440"], {"x": 100, "y": 100}, ctx)
Inputs: args (required), position (required), object_type (required).
delete_objectA
Delete a Pd object.
This tool removes an existing object from the Pure Data patch.
It also removes the object's entry from the index tracking system
to maintain consistency.
Args:
object_id: ID of the object to delete
ctx: MCP context
Returns:
Response with status
Example:
delete_object("osc~_100_100", ctx)
Inputs: object_id (required).
disconnect_objectsB
Remove an existing connection between two Pd objects.
This tool disconnects two objects in the Pure Data patch.
It handles the translation from string IDs to numeric indices
required by the Pure Data patch.
Args:
source_id: ID of the source object
destination_id: ID of the destination object
ctx: MCP context
Returns:
Response with status
Inputs: source_id (required), destination_id (required).
get_paramB
Retrieve the current value of an object's parameter.
Args:
object_id: ID of the object
parameter: Parameter name to retrieve
ctx: MCP context
Returns:
Response with status and value
Inputs: object_id (required), parameter (required).
load_patchC
Load a Pd patch from a file.
This tool loads a Pure Data patch from the specified file path.
It will replace the current patch state.
Args:
file_path: Path to the patch file to load
ctx: MCP context
Returns:
Response with status
Inputs: file_path (required).
save_patchB
Save the current Pd patch.
This tool saves the current state of the Pure Data patch
to a file at the specified path.
Args:
file_path: Path to save the patch file
ctx: MCP context
Returns:
Response with status
Inputs: file_path (required).
set_paramA
Modify a parameter of an existing Pd object.
Args:
object_id: ID of the object
parameter: Parameter name to modify
value: New value for the parameter
ctx: MCP context
Returns:
Response with status
Inputs: value (required), object_id (required), parameter (required).
start_dspB
Enable DSP processing in Pure Data.
This turns on audio processing in Pure Data so that
sound can be generated or processed.
Args:
ctx: MCP context
Returns:
Response with status
Inputs: no named parameters.
stop_dspA
Disable DSP processing in Pure Data.
This turns off audio processing in Pure Data to
conserve CPU when audio is not needed.
Args:
ctx: MCP context
Returns:
Response with status
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clearly distinct purpose: object creation/deletion, connection management, parameter access, file operations, DSP control, and workspace clearing. There is no overlap or ambiguity among the tools.
All tools follow a consistent verb_noun pattern using snake_case (e.g., create_object, get_param, start_dsp). No mixed conventions or deviations are present.
With 11 tools covering object lifecycle, connections, parameters, file persistence, and DSP state, the count is well-scoped for a Pure Data server. Every tool serves a necessary function without redundancy.
The tool set covers core operations (CRUD for objects, connections, parameters, patch files, DSP) but lacks a tool to list all objects or send arbitrary messages. These minor gaps are acceptable for many use cases.
Maintenance
Related MCP Connectors
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Generate AI music via the Lacuna Music API from MCP clients like Claude Desktop & Code.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseBqualityDmaintenanceConnects Ableton Live to Claude AI via the Model Context Protocol for prompt-assisted music production and session manipulation. It enables users to create tracks, load instruments, and manage MIDI clips using natural language commands.161MIT
- AlicenseAqualityDmaintenanceEnables AI-powered music composition and synthesis by generating Pure Data patches, VCV Rack modules, and MIDI controller mappings through natural language.1012 npm5MIT
- AlicenseBqualityDmaintenanceControl and live-patch Pure Data from AI agents via the Model Context Protocol.2118 npm2MIT
- AlicenseBqualityDmaintenanceConnects Ableton Live to Claude AI via the Model Context Protocol, enabling prompt-assisted music production, track creation, and Live session manipulation.16MIT