Skip to main content
Glama

remotion_generate_video

Generate complete video compositions by creating all TSX components and project files. After generation, run npm install and npm start to preview your professional video project.

Instructions

Generate the complete video composition and write all files. Generates all TSX components, the composition file, and updates the project with the complete video structure. After this, you can run 'npm install' and 'npm start' in the project directory to preview the video. Returns: JSON with generation results and next steps Example: result = await remotion_generate_video() # Video files generated! Run 'npm install' and 'npm start' to preview

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The remotion_generate_video tool handler: generates TSX components and composition file from the project timeline using the CompositionBuilder and ProjectManager. Registered via @mcp.tool decorator.
    @mcp.tool # type: ignore[arg-type] async def remotion_generate_video() -> str: """ Generate the complete video composition and write all files. Generates all TSX components, the composition file, and updates the project with the complete video structure. After this, you can run 'npm install' and 'npm start' in the project directory to preview the video. Returns: JSON with generation results and next steps Example: result = await remotion_generate_video() # Video files generated! Run 'npm install' and 'npm start' to preview """ def _generate(): if not project_manager.current_project: return json.dumps({"error": "No active project. Create a project first."}) if not project_manager.current_timeline: return json.dumps({"error": "No timeline created. Add components first."}) try: # Generate components theme = project_manager.current_timeline.theme # Helper to recursively find all component types including nested ones def find_all_component_types(components): types = set() from chuk_motion.generator.composition_builder import ComponentInstance def collect_types(comp): if isinstance(comp, ComponentInstance): types.add(comp.component_type) # Check for nested children in props for _key, value in comp.props.items(): if isinstance(value, ComponentInstance): collect_types(value) elif isinstance(value, list): for item in value: if isinstance(item, ComponentInstance): collect_types(item) for comp in components: collect_types(comp) return types # Get unique component types from all tracks (including nested) all_components = project_manager.current_timeline.get_all_components() component_types = find_all_component_types(all_components) generated_files = [] for comp_type in component_types: # Get a sample config from the timeline # For nested components, use empty config as templates handle it file_path = project_manager.add_component_to_project(comp_type, {}, theme) generated_files.append(file_path) # Generate main composition composition_file = project_manager.generate_composition() generated_files.append(composition_file) project_info = project_manager.get_project_info() return json.dumps( { "status": "success", "project": project_info, "generated_files": generated_files, "next_steps": [ f"cd {project_info['path']}", "npm install", "npm start # Opens Remotion Studio", "npm run build # Renders the video", ], }, indent=2, ) except Exception as e: return json.dumps({"error": str(e)}) return await asyncio.get_event_loop().run_in_executor(None, _generate)

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/chrishayuk/chuk-mcp-remotion'

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