Sponsored by Deepsite.site

Pure Data MCP Server

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

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.

Known Issues

The example patch (example patch.pd) is not working correctly.

Overview

The system consists of three core components:

  1. MCP Server (mcp_server.py): Implements the Model Context Protocol interface for Claude
  2. OSC Daemon (osc_daemon.py): Handles OSC communication with Pure Data
  3. Pure Data Patch (absolute_final_solution.pd): A dynamic patching solution that receives OSC messages

Features

  • Dynamic Object Creation: Create any Pure Data object on demand through Claude
  • Connection Management: Connect objects together to build complex signal flows
  • DSP 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-osc
    • fastmcp
    • jsonschema
  • uv package manager

Install uv

On macOS and 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"

Learn more: astral-sh/uv


🛠️ Usage

Clone the repository

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

Integration with Claude Desktop

  1. Open:

Claude > Settings > Developer > Edit Config > claude_desktop_config.json

  1. 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 uv command is not found, run which uv (Unix) or Get-Command uv (PowerShell) and use the full path in the "command" field.


Architecture

Message Flow

  1. Claude executes MCP tools based on user requests
  2. MCP Server processes the tool calls
  3. OSC messages are formatted and sent to Pure Data
  4. Pure Data executes the commands via the dynamic patch
  5. Feedback (if any) is returned via OSC callbacks

Troubleshooting

Common Issues

  1. Object Creation Fails: Ensure Pure Data is running and the patch is open
  2. Connection Issues: Verify that object IDs match exactly what was returned from create_object
  3. Port Conflicts: Check if port 5000 is already in use
  4. Message Format Errors: Ensure message formats match the expected format in the Pure Data patch
  5. Lost Objects: If object tracking gets confused, try restarting both the MCP server and Pure Data

JSON Schema

The pd-schema.json provides a comprehensive data model for Pure Data patches, supporting validation and serialization of patches. While not directly used in the current MCP tools, it serves as a reference for future development and potential integration with patch serialization/deserialization features.

Next Steps

  1. Enhanced Error Reporting: Improve feedback from Pure Data for better error messages
  2. Visualization Tools: Add tools to visualize the current patch state
  3. Object Library Integration: Support loading external libraries and abstractions
  4. Patch Persistence: Implement better state management for patches
  5. Audio File Support: Add tools for working with audio files and samples
  6. MIDI Integration: Add MIDI input/output capabilities
  7. GUI Object Support: Add support for GUI objects like sliders and number boxes
  8. Collaborative Features: Support multiple simultaneous connections
  9. Documentation Generator: Create automatic documentation from the JSON schema

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
WindsurfThe new purpose-built IDE to harness magic
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
DeepChatYour AI Partner on Desktop
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Playwright McpPlaywright MCP server
Tavily Mcp
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
ChatWiseThe second fastest AI chatbot™
CursorThe AI Code Editor
Amap Maps高德地图官方 MCP Server