Agentic Max/MSP Programming with LLMs and MCP
Haokun Tian, Shuoyang Zheng, Mathieu Lagrange, Stefan Lattner, Charalampos Saitis
Primary Subject: Software/Library Demo
Some of the required materials for this paper do not exist: Video
The recently introduced Model Context Protocol (MCP) provides a standardised way for LLMs to interact with external tools. We implement an MCP server for Max/MSP, a visual programming language for music and multimedia, enabling LLMs to directly understand and generate Max patches, paving the way for flexible sound generation using LLMs. The LLM agent can dynamically retrieve official documentation of Max objects before taking actions, allowing for in-context learning. For understanding, it can explain user-selected objects. For generation, it can create objects, connect patch cords, send messages to objects, and more. This offers a more seamless way to assist Max users compared to traditional approaches where LLMs respond with text-based answers or code snippets. Moreover, it eliminates syntax errors caused by generating different formats of text-based code, as the process reduces to selecting the correct functions to call and providing the appropriate arguments. Code and demonstration are available online in a repository: https://github.com/tiianhk/MaxMSP-MCP-Server.