Skip to main content
Glama

execute_lua

Run Lua code to control REAPER DAW through its ReaScript API, enabling automation and custom functionality within the digital audio workstation.

Instructions

Execute arbitrary Lua code in REAPER. This gives full control over REAPER via ReaScript. The code runs in REAPER's Lua environment with access to the reaper.* API. Args: code: Lua code to execute Example: execute_lua("reaper.ShowMessageBox('Hello from MCP!', 'Test', 0)")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Implementation Reference

  • MCP tool handler for 'execute_lua'. Decorated with @mcp.tool() for automatic registration. Delegates execution to ReaperBridge instance.
    @mcp.tool() def execute_lua(ctx: Context, code: str) -> str: """ Execute arbitrary Lua code in REAPER. This gives full control over REAPER via ReaScript. The code runs in REAPER's Lua environment with access to the reaper.* API. Args: code: Lua code to execute Example: execute_lua("reaper.ShowMessageBox('Hello from MCP!', 'Test', 0)") """ bridge = get_bridge() result = bridge.execute_lua(code) return result.get("message", "Lua code executed")
  • Core implementation of Lua execution via file-based command to REAPER's Lua script. Writes command to JSON file and polls for response.
    def execute_lua(self, code: str) -> Dict[str, Any]: """Execute arbitrary Lua code in REAPER.""" self._write_command("execute_lua", {"code": code}) response = self._read_response(timeout=5.0) if response: return response return {"success": True, "message": "Lua code sent for execution"}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yura9011/scythe_mcp_reaper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server