save_project
Save the current REAPER project to a specified path or default to ~/Documents/REAPER Projects if none provided.
Instructions
Save the current project. If no path is given, saves to ~/Documents/REAPER Projects.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No |
Implementation Reference
- src/reaper_mcp/project_tools.py:37-51 (handler)The handler function for the save_project MCP tool. Saves the current REAPER project, defaulting to ~/Documents/REAPER Projects if no path is given.
def save_project(project_path: str = "") -> dict: """Save the current project. If no path is given, saves to ~/Documents/REAPER Projects.""" try: project = get_project() if not project_path: proj_name = project.name or f"Project {time.strftime('%Y-%m-%d %H-%M-%S')}" default_dir = Path.home() / "Documents" / "REAPER Projects" os.makedirs(default_dir, exist_ok=True) project_path = str(default_dir / f"{proj_name}.rpp") os.makedirs(os.path.dirname(os.path.abspath(project_path)), exist_ok=True) project.save(project_path) return {"success": True, "project_path": project_path} except Exception as e: logger.error(f"save_project failed: {e}") return {"success": False, "error": str(e)} - src/reaper_mcp/project_tools.py:36-37 (registration)The @mcp.tool() decorator registers save_project as an MCP tool.
@mcp.tool() def save_project(project_path: str = "") -> dict: - src/reaper_mcp/server.py:10-28 (registration)The server imports project_tools.register_tools and calls it with mcp, which triggers the @mcp.tool() registration of save_project.
from reaper_mcp.project_tools import register_tools as _reg_project from reaper_mcp.track_tools import register_tools as _reg_track from reaper_mcp.midi_tools import register_tools as _reg_midi from reaper_mcp.fx_tools import register_tools as _reg_fx from reaper_mcp.audio_tools import register_tools as _reg_audio from reaper_mcp.mixing_tools import register_tools as _reg_mixing from reaper_mcp.render_tools import register_tools as _reg_render from reaper_mcp.mastering_tools import register_tools as _reg_mastering from reaper_mcp.analysis_tools import register_tools as _reg_analysis _reg_project(mcp) _reg_track(mcp) _reg_midi(mcp) _reg_fx(mcp) _reg_audio(mcp) _reg_mixing(mcp) _reg_render(mcp) _reg_mastering(mcp) _reg_analysis(mcp) - src/reaper_mcp/connection.py:27-29 (helper)Helper function used by save_project to obtain the current REAPER project object.
def get_project() -> reapy.Project: ensure_connected() return reapy.Project()