humanizer_move
Simulate realistic mouse movements to target coordinates using human-like Bezier curves with Fitts's law velocity scaling and eased timing profiles.
Instructions
Move mouse along a human-like Bezier curve to target coordinates. Uses Fitts's law velocity scaling and eased timing profile.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_id | Yes | Chrome target ID from interceptor_chrome_launch | |
| x | Yes | Destination X coordinate | |
| y | Yes | Destination Y coordinate | |
| duration_ms | No | Base duration in ms before Fitts scaling (default: 600) |
Implementation Reference
- src/humanizer/engine.ts:196-236 (handler)The core `moveMouse` method which handles the mouse movement logic by generating a Bezier curve path and dispatching CDP mouse events.
async moveMouse( targetId: string, x: number, y: number, durationMs?: number, ): Promise<{ totalMs: number; eventsDispatched: number }> { const state = await this.getSession(targetId); const from: Point = { x: state.mouseX, y: state.mouseY }; const to: Point = { x, y }; const path = generatePath(from, to, { baseDurationMs: durationMs ?? 600, }); let eventsDispatched = 0; for (let i = 0; i < path.points.length; i++) { const pt = path.points[i]; // Wait inter-point delay if (i > 0) { const delay = path.timestamps[i] - path.timestamps[i - 1]; if (delay > 0) await sleep(delay); } await state.session.send("Input.dispatchMouseEvent", { type: "mouseMoved", x: pt.x, y: pt.y, button: "none", buttons: 0, }); eventsDispatched++; } // Update tracked position const lastPt = path.points[path.points.length - 1]; state.mouseX = lastPt.x; state.mouseY = lastPt.y; return { totalMs: path.totalMs, eventsDispatched }; } - src/tools/humanizer.ts:22-60 (registration)Registration of the 'humanizer_move' MCP tool, which parses arguments and calls the engine's moveMouse method.
server.tool( "humanizer_move", "Move mouse along a human-like Bezier curve to target coordinates. " + "Uses Fitts's law velocity scaling and eased timing profile.", { target_id: z.string().describe("Chrome target ID from interceptor_chrome_launch"), x: z.number().describe("Destination X coordinate"), y: z.number().describe("Destination Y coordinate"), duration_ms: z.number().optional().default(600) .describe("Base duration in ms before Fitts scaling (default: 600)"), }, async ({ target_id, x, y, duration_ms }) => { try { const result = await humanizerEngine.moveMouse(target_id, x, y, duration_ms); return { content: [{ type: "text", text: JSON.stringify({ status: "success", target_id, action: "move", destination: { x, y }, stats: { total_ms: result.totalMs, events_dispatched: result.eventsDispatched, }, }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", target_id, action: "move", error: errorToString(e) }), }], }; } }, );