New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@lexu/mcp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lexu/mcp

Lexu MCP server: let Claude and other AI assistants create images, video and music with your lexu.io credits

latest
npmnpm
Version
0.1.1
Version published
Weekly downloads
71
-71.02%
Maintainers
1
Weekly downloads
 
Created
Source

Lexu tools

Create images, video and music with your lexu.io credits from code, the terminal, or an AI assistant.

PackageWhat it is
@lexu/sdkTypeScript client for the Lexu API v1
@lexu/cliThe lexu command
@lexu/mcpMCP server for Claude Desktop, Claude Code, Cursor and other MCP clients

Every generation is charged to your Lexu balance, at the same price as on the website. Each API key also has a monthly credit cap (500 by default, 200 for MCP keys), so a leaked key can only spend that much. Manage keys at https://www.lexu.io/dashboard/settings/api-keys.

CLI

npx @lexu/cli login                      # approve in the browser; no password in the terminal
npx @lexu/cli balance
npx @lexu/cli models --type video
npx @lexu/cli estimate kling-3 --duration 10
npx @lexu/cli generate gpt-image-2.5 "a red perfume bottle on white marble" --aspect-ratio 1:1 --download
npx @lexu/cli generate seedance-2-mini "waves at sunset, slow motion" --duration 5 --yes --json
npx @lexu/cli jobs
npx @lexu/cli job <id> --wait --download --out ./renders
npx @lexu/cli logout                     # also revokes the key on the server

Before charging, generate shows the price and asks. In scripts, pass --yes. --json prints machine-readable output. In CI, set LEXU_API_KEY instead of logging in.

Model options are passed as flags: --aspect-ratio 9:16 becomes aspect_ratio. lexu models lists each model's options.

MCP server

Log in once (creates a key with a 200-credit monthly cap):

npx @lexu/mcp login

Claude Desktop (claude_desktop_config.json) or any MCP client:

{
  "mcpServers": {
    "lexu": { "command": "npx", "args": ["-y", "@lexu/mcp"] }
  }
}

Claude Code:

claude mcp add lexu -- npx -y @lexu/mcp

Instead of logging in, you can put a key in the client config: "env": { "LEXU_API_KEY": "lexu_live_..." }.

Tools: get_account, get_balance, list_models, estimate_cost, generate_image, generate_video, generate_music, get_generation, list_generations, plus the product_ad prompt.

Every generate_* tool requires max_credits. The server estimates the request first and refuses it if it costs more, so text injected into a web page or file cannot make the assistant overspend.

SDK

import { Lexu } from "@lexu/sdk";

const lexu = new Lexu({ apiKey: process.env.LEXU_API_KEY! });
const { credits } = await lexu.estimate({ model: "veo-3.1-lite", prompt: "…", duration: 8 });
const started = await lexu.generate({ model: "veo-3.1-lite", prompt: "…", duration: 8 });
const done = await lexu.waitForGeneration(started.id);
console.log(done.status, done.output_url);

generate() sends an Idempotency-Key and retries network failures with the same key, so a retry never charges twice. Failed generations are refunded automatically; refunded is then true.

API

Base URL: https://www.lexu.io/api. Send Authorization: Bearer lexu_live_….

MethodPath
GET/v1/meAccount and plan
GET/v1/balanceCredits and this key's monthly cap
GET/v1/modelsModels, inputs, prices (no key needed)
POST/v1/estimatePrice of a request, no charge
POST/v1/generationsStart; requires Idempotency-Key
GET/v1/generationsHistory (?limit, ?before)
GET/v1/generations/{id}Status and a fresh download link
GET/v1/ledgerBalance changes
DELETE/v1/keys/currentRevoke the key used

Answers are { "data": … } or { "error": { "code", "message" } }.

Development

npm install
npm run build
npm test

The server side lives in the lexu-platform repository: supabase/functions/api-v1 and migration 00053_public_api_keys.sql.

Keywords

lexu

FAQs

Package last updated on 18 Sep 2026

Related posts