@akiojin/unity-mcp-server
Version:
MCP server and Unity Editor bridge — enables AI assistants to control Unity for AI-assisted workflows
33 lines (30 loc) • 957 B
JavaScript
/**
* Handler for stopping video capture in Unity Editor (via MCP)
*/
import { BaseToolHandler } from '../base/BaseToolHandler.js';
export class CaptureVideoStopToolHandler extends BaseToolHandler {
constructor(unityConnection) {
super(
'capture_video_stop',
'Stop current video recording and finalize the file.',
{
type: 'object',
properties: {
recordingId: { type: 'string', description: 'Optional. Stop a specific recording session. Defaults to the latest.' }
}
}
);
this.unityConnection = unityConnection;
}
/** @override */
async execute(params, context) {
const response = await this.unityConnection.sendCommand('capture_video_stop', params || {});
if (response.error) {
return { error: response.error, code: response.code || 'UNITY_ERROR' };
}
return {
...response,
message: response.message || 'Video recording stopped'
};
}
}