Skip to main content

CDP MCP Server - Direct access to Composers' Desktop Project sound transformation programs

Project description

CDP MCP Server

A Model Context Protocol (MCP) server that provides direct access to the Composers' Desktop Project (CDP) sound transformation programs. This server offers an ultra-rigid workflow with zero interpretation, exposing CDP's raw functionality through simple, reliable tools.

Overview

CDP MCP Server v7 implements a minimalist approach to CDP integration:

  • Direct execution - No command parsing or interpretation
  • Raw usage text - See exactly what CDP shows
  • Simple tools - Just 6 core functions
  • Data file support - Create parameter files for complex operations

Features

  • 🎵 Full CDP Access - Execute any CDP program with complete control
  • 📚 Program Discovery - List all available CDP programs by category
  • 📖 Usage Information - Get raw usage text directly from CDP
  • 📄 Data File Creation - Create parameter files required by CDP programs
  • 🎛️ Spectral Preparation - Helper for PVOC analysis
  • 📊 Sound Analysis - Get basic properties of audio files

Requirements

System Requirements

  • macOS, Linux, or Windows
  • Python 3.8 or higher
  • CDP (Composers' Desktop Project) installed

Python Dependencies

mcp
soundfile
numpy

CDP Installation

  1. Download CDP from the official website
  2. Install CDP following the platform-specific instructions
  3. Set the CDP_PATH environment variable to your CDP programs directory:
    export CDP_PATH="/path/to/cdp/programs"
    

Installation

1. Clone the Repository

git clone https://github.com/DavidPiazza/CDP_MCP.git
cd CDP_MCP

2. Install Dependencies

pip install -r requirements.txt

Or install individually:

pip install mcp soundfile numpy

3. Configure CDP Path

Set your CDP installation path:

export CDP_PATH="/Users/yourname/cdpr8/_cdp/_cdprogs"  # macOS example

4. Run the Server

python CDP_MCP_v7.py

MCP Client Configuration

To use this server with an MCP client (like Claude Desktop), add to your configuration:

{
  "mcpServers": {
    "cdp": {
      "command": "python",
      "args": ["/path/to/CDP_MCP_v7.py"],
      "env": {
        "CDP_PATH": "/path/to/cdp/programs"
      }
    }
  }
}

Usage

Basic Workflow

  1. List Available Programs

    list_cdp_programs()
    # Returns categorized list of all CDP programs
    
  2. Get Program Usage

    get_cdp_usage('blur')
    # Returns exact CDP usage text
    
  3. Execute Commands

    execute_cdp(['blur', 'blur', 'input.ana', 'output.ana', '50'])
    # Direct execution with no interpretation
    

Example Operations

Time Stretch

# Check usage
get_cdp_usage('stretch')

# Execute
execute_cdp(['stretch', 'time', '1', 'input.ana', 'output.ana', '2.0'])

Spectral Blur

# Note the double syntax for blur
execute_cdp(['blur', 'blur', 'input.ana', 'output.ana', '50'])

Granular Synthesis

execute_cdp(['modify', 'brassage', '4', 'input.wav', 'output.wav', '0.02', '-0.5', '-r200'])

Using Data Files

# Create data file for tesselate
create_data_file('tess_data.txt', '5 5 5 5\n0.0 0.1 0.2 0.3')

# Execute with data file
execute_cdp(['tesselate', 'tesselate', '1', 'in1.wav', 'in2.wav', 'in3.wav', 'in4.wav', 'output.wav', '0.5', 'tess_data.txt'])

Tools Reference

list_cdp_programs()

Lists all available CDP programs organized by category (Spectral Processing, Time Domain, Synthesis, etc.)

get_cdp_usage(program, subprogram=None)

Returns raw usage information for a CDP program by running it without arguments.

execute_cdp(command)

Executes a CDP command given as an array of strings. No parsing or interpretation.

create_data_file(filepath, content)

Creates text data files required by certain CDP programs.

prepare_spectral(input_file, output_file, window_size=2048)

Helper function to perform PVOC analysis for spectral processing.

analyze_sound(filepath)

Returns basic properties of a sound file (duration, sample rate, channels, etc.)

Architecture

The server follows an ultra-rigid design philosophy:

  • No command parsing - Commands are arrays, not strings
  • No parameter validation - CDP handles all validation
  • No output interpretation - Raw CDP output is returned
  • Minimal abstraction - Direct CDP access only

Tips

  • Always check usage with get_cdp_usage() before executing
  • CDP may return non-zero exit codes even on success
  • Check if output files exist to verify successful execution
  • Use exact command arrays - the server does no interpretation
  • Create data files when CDP usage mentions DATAFILE requirements

Troubleshooting

CDP Not Found

Ensure CDP_PATH environment variable points to your CDP programs directory.

Apple Silicon Issues

The server automatically handles x86_64 emulation on Apple Silicon Macs using arch -x86_64.

Command Failures

  1. Check the exact usage with get_cdp_usage()
  2. Verify all file paths exist
  3. Ensure proper command array format
  4. Check CDP's stderr output for specific errors

License

MIT License - See LICENSE file for details

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_davidpiazza_cdp_mcp-1.0.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iflow_mcp_davidpiazza_cdp_mcp-1.0.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file iflow_mcp_davidpiazza_cdp_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_davidpiazza_cdp_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_davidpiazza_cdp_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 da48ff128f5982df271124cc0530c53a5f14b86f198f575bbd7074a926afd33d
MD5 8fbaa1436c29378359066583b5e19f6a
BLAKE2b-256 62feac0b8e2007a47ec437e05409c201989522be84141e4cc2552ec86420eda9

See more details on using hashes here.

File details

Details for the file iflow_mcp_davidpiazza_cdp_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_davidpiazza_cdp_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_davidpiazza_cdp_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26c0a624d46da8732c45b2af01af85db3ab4d9bf9b965b4abbfc922f187f26c1
MD5 a9a2252e001e3a2a18e9086970b6a1c3
BLAKE2b-256 b7db5697300206683dcf1f54511f91b769468b425dc110c7da8f6e2ec3b8a3c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page