loremotion-mcp
This server lets an agent automate LoreMotion video generation and account management through MCP.
Check whether the LoreMotion browser session is signed in or anonymous.
Generate LoreMotion videos from a text prompt with model, aspect ratio, duration, and optional image-to-video settings.
Use a persistent signed-in profile or an explicit anonymous session; it does not bypass ads or site limits.
List recent signed-in history/dashboard items.
Download generated MP4s from a video URL or share URL and get a local file path.
Probe the live LoreMotion UI to inspect fields, sliders, Turnstile state, and save screenshots for selector maintenance.
Support headless Linux/VPS deployments with persistent Chromium profile import and verification.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@loremotion-mcp Create a 10-second cinematic drone shot of a modern tower at sunrise using ltx-2.5."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
LoreMotion MCP — Hermes / Headless Linux
A GitHub-ready MCP server that drives LoreMotion.com with Playwright and a persistent LoreMotion browser profile. This version is designed for an automated agent such as Hermes running on a headless Linux VPS, including arm64 systems where the only available browser is Playwright's Chromium headless shell.
The five MCP tool names and schemas are unchanged:
loremotion_auth_statusloremotion_generate_videoloremotion_list_historyloremotion_download_videoloremotion_probe_ui
The selector-override system and soak-test harness are retained.
Recommended headless authentication workflow
Google OAuth/MFA should not be automated on the VPS. The recommended headless flow is:
Authenticate once on an interactive desktop
↓
Dedicated Chromium user-data/profile directory
↓
Securely copy/archive that profile to the VPS
↓
npm run import-profile -- <profile-dir-or-archive>
↓
Importer validates structure + verifies LoreMotion auth
↓
Hermes starts scripts/hermes-mcp.js
↓
Persistent headless LoreMotion MCP sessionNever put a Google password, OAuth token, MFA secret, recovery code, or raw cookie string in .env, source code, Git, an MCP configuration, or an agent prompt. The persistent profile directory is the credential.
Chromium profile portability can vary across operating systems/browser builds because some browser state may be OS-protected. The importer therefore never assumes that a copied profile is usable: it launches the configured headless browser and verifies the copied profile with the same
loremotion_auth_statuslogic used by the MCP server. If the imported profile does not authenticate on the server, the import fails and the previous server profile is restored.
Related MCP server: google-flow-mcp
Requirements
Node.js 20+
npm dependencies installed with
npm installNetwork access to LoreMotion
A Playwright-compatible Chromium executable
For the target headless VPS: no X server, Xvfb, Chrome channel, or desktop GUI is required
The server supports either:
LOREMOTION_EXECUTABLE_PATH=/absolute/path/to/headless_shell, orthe existing
PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATHenvironment variable.
LOREMOTION_EXECUTABLE_PATH takes precedence over LOREMOTION_BROWSER_CHANNEL.
1. Create an authenticated profile on a desktop
On a desktop machine with a normal GUI browser available:
npm install
cp .env.example .envFor the interactive desktop login, set:
LOREMOTION_SESSION_MODE=persistent
LOREMOTION_PROFILE_DIR=.loremotion-profile
LOREMOTION_HEADLESS=false
LOREMOTION_EXECUTABLE_PATH=
LOREMOTION_BROWSER_CHANNEL=chromeThen run:
npm run loginComplete LoreMotion's normal Sign in with Google flow and MFA in the visible browser. The script verifies that LoreMotion is signed in before accepting the profile.
npm run login is intentionally interactive. If stdin/stdout is not a TTY, it exits non-zero immediately and points to the profile-import workflow instead of blocking forever.
Archive the profile for transfer
After the login script closes the browser, copy the entire dedicated profile directory. For example:
tar -czf loremotion-profile.tgz .loremotion-profileTransfer the profile/archive to the VPS using your normal secure file-transfer mechanism. Do not place it in Git.
2. Configure the headless VPS
Create .env:
cp .env.example .envA typical headless configuration is:
LOREMOTION_SESSION_MODE=persistent
LOREMOTION_PROFILE_DIR=/opt/loremotion-mcp/.loremotion-profile
LOREMOTION_DOWNLOAD_DIR=/opt/loremotion-mcp/downloads
LOREMOTION_HEADLESS=true
LOREMOTION_BROWSER_CHANNEL=
LOREMOTION_EXECUTABLE_PATH=/opt/ms-playwright/chromium_headless_shell/chrome-linux/headless_shell
LOREMOTION_LAUNCH_ARGS=--no-sandbox,--disable-dev-shm-usage,--disable-gpu,--single-processIf your VPS already exports Playwright variables, this also works:
export PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright
export PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/opt/ms-playwright/chromium_headless_shell/chrome-linux/headless_shellWhen LOREMOTION_EXECUTABLE_PATH is blank, the code automatically uses PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH when present.
Install dependencies:
npm installYou do not need npm run install-browser if the headless-shell binary already exists and LOREMOTION_EXECUTABLE_PATH or PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH points to it.
3. Import the authenticated profile
Directory
npm run import-profile -- /secure/path/.loremotion-profileZip archive
npm run import-profile -- /secure/path/loremotion-profile.zipTar archive
npm run import-profile -- /secure/path/loremotion-profile.tgzSupported archive forms are .zip, .tar, .tar.gz, and .tgz.
The importer:
locates the Chromium user-data root;
checks for
Local State, aDefault/Profile Ndirectory,Preferences, and browser session state;removes stale Chromium lock files during the copy;
stages the import beside
LOREMOTION_PROFILE_DIR;preserves the current server profile as a temporary backup;
installs the staged profile;
launches the configured headless browser;
verifies LoreMotion with the existing auth-status logic;
keeps the new profile only when
signedIn:trueis confirmed; otherwise it restores the previous profile.
Scripted import
Instead of a CLI argument, set:
LOREMOTION_PROFILE_IMPORT_PATH=/secure/path/loremotion-profile.tgzThen either run:
npm run import-profileor let the Hermes bootstrap import it automatically when no valid session exists.
After a successful one-time import, you may clear LOREMOTION_PROFILE_IMPORT_PATH if you do not want Hermes to reuse that source automatically.
4. Hermes MCP entrypoint
For Hermes, use this as the MCP command:
node /opt/loremotion-mcp/scripts/hermes-mcp.jsThe bootstrap performs this sequence:
check existing persistent profile
↓
if signed in → start MCP
↓
if signed out and LOREMOTION_PROFILE_IMPORT_PATH exists
↓
import profile → verify signedIn:true
↓
start MCPIf no valid authenticated profile is available, it exits non-zero with an actionable message. It does not attempt Google password entry or MFA automation.
All pre-MCP bootstrap messages are written to stderr. Stdout remains clean for MCP stdio framing.
Example configuration is in examples/mcp-config.json.
Headless setup helper
setup-google-login.sh now supports both modes.
On the VPS:
./setup-google-login.sh /secure/path/loremotion-profile.tgzor:
export LOREMOTION_PROFILE_IMPORT_PATH=/secure/path/loremotion-profile.tgz
./setup-google-login.shIn a non-TTY environment with no profile import path, the script exits immediately instead of invoking interactive login.
On an interactive desktop, with no import path, it retains the existing browser-install + npm run login flow.
Browser launch configuration
LOREMOTION_EXECUTABLE_PATH
Optional absolute path to a Chromium/Chrome executable. When set, it wins over LOREMOTION_BROWSER_CHANNEL.
If unset, PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH is used automatically when available.
LOREMOTION_BROWSER_CHANNEL
Desktop fallback such as chrome. Leave it empty on a VPS that only has a bare Playwright headless-shell binary.
LOREMOTION_LAUNCH_ARGS
Comma-separated arguments passed to both chromium.launch() and chromium.launchPersistentContext().
Default:
--no-sandbox,--disable-dev-shm-usage,--disable-gpuThese defaults are intended for common headless/container/VPS deployments. Override them only when your environment requires different Chromium flags.
Duration slider handling
The live LoreMotion generator exposes duration as input[type=range] rather than a select.
The server now:
finds the most likely duration range input;
reads its current
minandmax;rejects a requested duration above the live maximum with a clear error;
writes the value using
HTMLInputElement.prototype.value's native setter;dispatches bubbling
inputandchangeevents so React observes the update;re-reads
inputValue()and verifies the requested value stuck.
Legacy select/text fallbacks remain in place for future UI variations.
Before generating, Hermes can call:
loremotion_probe_uiThe response includes durationSliders and durationSliderMax, allowing the agent to choose a legal duration for the selected model/account tier.
Prompt field handling
The live prompt textarea has a placeholder but no reliable accessible name. fillPrompt therefore prefers placeholder-based textarea matching first and only then uses generic/configured fallbacks.
Cloudflare Turnstile behavior
The generator includes cf-turnstile-response. The automation does not solve or bypass Cloudflare.
If an unsolved visible Turnstile/challenge is detected before generation, after clicking Generate, or while waiting for the result, generation fails quickly with:
Cloudflare challenge present; a signed-in profile or different egress is requiredThis prevents Hermes from wasting the full generation timeout on a blocked datacenter session.
Verify the imported login
npm run verify-loginExpected shape:
{
"signedIn": true,
"sessionMode": "persistent",
"profileDir": "/opt/loremotion-mcp/.loremotion-profile"
}Start without Hermes bootstrap
If the profile is already verified, the original server entrypoint remains valid:
node src/server.jsMCP tool check
After dependencies are installed:
npm run check-toolsThis boots the server over stdio, calls tools/list, and asserts that exactly these five tools are present:
loremotion_auth_status
loremotion_generate_video
loremotion_list_history
loremotion_download_video
loremotion_probe_uiProbe the live UI
npm run probeprobe now respects the configured headless mode instead of forcing a visible browser. It reports inputs, duration range metadata, Turnstile presence/state, links, buttons, and a screenshot path.
Selector overrides remain available:
LOREMOTION_SELECTORS_JSON={"prompt":["textarea[name=prompt]"],"generate":["button[data-testid=generate]"]}Soak test
The existing harness is retained:
npm run soak-test -- --ltx-runs 10 --ltx-duration 5 --h3-runs 10 --h3-duration 5 --aspect 16:9 --timeout-ms 600000 --verify-history trueUse loremotion_probe_ui first and set durations no higher than the live durationSliderMax. The soak harness no longer forces headed mode into its child MCP process, so .env/VPS headless settings are respected.
To download successful outputs as part of the test:
npm run soak-test -- --ltx-runs 10 --h3-runs 10 --download trueReports are written under reports/soak-<timestamp>/.
Environment variables
Variable | Purpose |
| LoreMotion base URL. |
|
|
| Persistent Chromium user-data directory. Treat it as a credential. |
| Optional directory/archive used by scripted import and Hermes bootstrap. Never a cookie/password/token. |
| Downloads, screenshots, and error artifacts. |
|
|
| Bare browser executable path; takes precedence over channel. Falls back to |
| Optional named Playwright browser channel such as |
| Comma-separated launch args. Defaults to |
| Normal Playwright action timeout. |
| Video generation wait timeout. |
| Optional Playwright slow motion. |
| Default requested LTX duration; live slider max remains authoritative. |
| Default requested H3 duration; live slider max remains authoritative. |
| Optional selector override JSON. |
PLAYWRIGHT_BROWSERS_PATH and PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH may also be provided externally by your VPS deployment.
Security
Never commit or share:
.env
.loremotion-profile/Do not expose this stdio MCP server directly to the public internet. See SECURITY.md for profile-handling guidance.
License
MIT. Independent integration; not affiliated with LoreMotion.
Available Tools
5 toolsloremotion_auth_statusA
Check whether the current LoreMotion browser session appears signed in and report whether it is persistent or anonymous.
Inputs: no named parameters.
loremotion_download_videoB
Download a generated MP4 using a video URL or LoreMotion share URL and return the local file path.
Inputs: filename, shareUrl, videoUrl.
loremotion_generate_videoB
Generate a LoreMotion video through the website. Supports a persistent signed-in session or an explicit anonymous ephemeral session. The free ad-supported flow is allowed to run normally; this tool does not bypass ads or site limits.
Inputs: prompt (required), wait, model, imagePath, +3 more.
loremotion_list_historyB
List recent signed-in LoreMotion history/dashboard items, which are normally retained for 48 hours on the free account.
Inputs: limit.
loremotion_probe_uiA
Inspect the current LoreMotion UI labels/fields and save a screenshot. Useful when the website changes and selectors need adjustment.
Inputs: pathname.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool addresses a distinct concern: history listing, video download, UI probing, auth status, and video generation. No overlap or ambiguity between purposes.
All tools follow the consistent 'loremotion_verb_noun' pattern, making the set predictable and easy to navigate.
Five tools is well-scoped for the server's purpose: covering authentication, generation, retrieval, and maintenance without unnecessary bloat.
Core workflow (generate, download, list history) is covered, plus auth and UI probing for robustness. Minor gaps like video deletion or status polling are not essential for the stated purpose.
Maintenance
Related MCP Connectors
Transcode, host and caption video from a prompt. Fifteen tools, nine read-only, nothing deletes.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Generate AI images, video, voiceovers and music from Claude, ChatGPT or Cursor through 50+ models (Veo 3.1, Kling 3, Seedance, Nano Banana, GPT Image, ElevenLabs). Also image editing, upscaling, background removal, face swap, transcription, voice cloning and UGC-style video ads. Sign in with OAuth — no API key to paste. Tools are annotated (read-only vs. credit-spending); failed generations are refunded.
Generate AI videos from a prompt or document (PDF/PPTX/DOCX/URL) and export shareable MP4s.
Related MCP Servers
- AlicenseAqualityDmaintenanceControls Google Flow for image and video generation from an AI agent. Enables generating images with models like Imagen 4, creating videos, managing characters and scenes via browser automation.17131 npm123MIT
- AlicenseAqualityCmaintenanceEnables video generation using Google AI tools (Veo, Nano Banana) via the Model Context Protocol, with browser automation powered by Playwright.242MIT
- AlicenseAqualityBmaintenanceEnables AI agents to programmatically generate images and videos through the authenticated Google Flow web interface via a direct Chrome DevTools Protocol connection, exposing tools for media generation, project management, status checks, and asset downloads without requiring official API keys.276MIT
- AlicenseNot gradedqualityCmaintenanceEnables generating images and videos in Google Flow through an automated browser session using your Google AI Pro subscription, without API keys or third-party credit fees.131 npm2MIT