SamurAIGPT

muapi cli

Built by SamurAIGPT β€’ 974 stars

What is muapi cli?

Official CLI for muapi.ai β€” generate images, videos & audio from the terminal. MCP server, 14 AI models, npm + pip installable.

How to use muapi cli?

1. Install a compatible MCP client (like Claude Desktop). 2. Open your configuration settings. 3. Add muapi cli using the following command: npx @modelcontextprotocol/muapi-cli 4. Restart the client and verify the new tools are active.
πŸ›‘οΈ Scoped (Restricted)
npx @modelcontextprotocol/muapi-cli --scope restricted
πŸ”“ Unrestricted Access
npx @modelcontextprotocol/muapi-cli

Key Features

Native MCP Protocol Support
Real-time Tool Activation & Execution
Verified High-performance Implementation
Secure Resource & Context Handling

Optimized Use Cases

Extending AI models with custom local capabilities
Automating system workflows via natural language
Connecting external data sources to LLM context windows

muapi cli FAQ

Q

Is muapi cli safe?

Yes, muapi cli follows the standardized Model Context Protocol security patterns and only executes tools with explicit user-granted permissions.

Q

Is muapi cli up to date?

muapi cli is currently active in the registry with 974 stars on GitHub, indicating its reliability and community support.

Q

Are there any limits for muapi cli?

Usage limits depend on the specific implementation of the MCP server and your system resources. Refer to the official documentation below for technical details.

Official Documentation

View on GitHub

muapi CLI

Official command-line interface for muapi.ai β€” generate images, videos, and audio directly from your terminal.

Agent-first design β€” every command works for both humans (colored output, tables) and AI agents (--output-json, --jq filtering, semantic exit codes, MCP server mode).

Install

# npm (recommended β€” no Python required)
npm install -g muapi-cli

# pip
pip install muapi-cli

# or run without installing
npx muapi-cli --help

Quick Start

# New user? Create an account
muapi auth register --email you@example.com --password "..."
muapi auth verify --email you@example.com --otp 123456
muapi auth login --email you@example.com --password "..."

# Or paste an existing API key
muapi auth configure --api-key "YOUR_KEY"

# Generate β€” pick a curated verb…
muapi image generate "a cyberpunk city at night" --model flux-dev
muapi video generate "a dog running on a beach" --model kling-master
muapi audio create "upbeat lo-fi hip hop for studying"

# …or run any model by endpoint name (schema-driven, covers the whole catalog)
muapi run flux-dev-image -p "a cyberpunk city at night"
muapi run seedance-2-text-to-video -p "drone shot over snowy peaks" -i duration=5
muapi run <model> -h          # introspects the live OpenAPI schema

# Check balance
muapi account balance

# Wait for an existing job
muapi predict wait <request_id>

Commands

muapi auth

CommandDescription
muapi auth register --email x --password yCreate a new account (sends OTP)
muapi auth verify --email x --otp 123456Verify email after registration
muapi auth login --email x --password yLog in and save API key automatically
muapi auth forgot-password --email xSend password reset OTP
muapi auth reset-password --email x --otp y --password zReset password
muapi auth configureManually save an API key
muapi auth whoamiShow current API key (masked)
muapi auth logoutRemove stored API key

muapi account

CommandDescription
muapi account balanceShow current credit balance
muapi account topup --amount 20Add credits via Stripe checkout

muapi keys

CommandDescription
muapi keys listList all API keys on your account
muapi keys create --name labelCreate a new API key (shown once)
muapi keys delete <id>Delete an API key by ID

muapi image

CommandDescription
muapi image generate <prompt>Text-to-image generation
muapi image edit <prompt> --image <url>Image-to-image editing
muapi image modelsList available models

Models: flux-dev, flux-schnell, flux-kontext-dev/pro/max, hidream-fast/dev/full, wan2.1, reve, gpt4o, midjourney, seedream, qwen

muapi video

CommandDescription
muapi video generate <prompt>Text-to-video generation
muapi video from-image <prompt> --image <url>Image-to-video animation
muapi video modelsList available models

Models: veo3, veo3-fast, kling-master, kling-std, kling-pro, wan2.1/2.2, seedance-pro/lite, hunyuan, runway, pixverse, vidu, minimax-std/pro

muapi audio

CommandDescription
muapi audio create <prompt>Create music with Suno
muapi audio remix <song-id>Remix an existing Suno song
muapi audio extend <song-id>Extend a Suno song
muapi audio from-text <prompt>Generate audio with MMAudio
muapi audio from-video <video-url>Add AI audio to a video

muapi enhance

CommandDescription
muapi enhance upscale <url>AI image upscaling
muapi enhance bg-remove <url>Remove background
muapi enhance face-swap --source <url> --target <url>Face swap image/video
muapi enhance skin <url>Skin enhancement
muapi enhance colorize <url>Colorize B&W photo
muapi enhance ghibli <url>Ghibli anime style
muapi enhance anime <url>Anime style conversion
muapi enhance extend <url>Outpaint/extend image
muapi enhance product-shot <url>Professional product photo
muapi enhance erase <url> --mask <url>Object removal

muapi edit

CommandDescription
muapi edit effects --video <url> --effect <name>AI video/image effects
muapi edit lipsync --video <url> --audio <url>Lip sync to audio
muapi edit dance --image <url> --video <url>Make person dance
muapi edit dress --image <url>Change clothing
muapi edit clipping <video-url>AI highlight extraction

muapi run β€” generic, schema-driven runner

Reaches any model in the muapi.ai catalog by endpoint name, even ones not covered by the curated image / video / audio / enhance / edit verbs. The input schema is fetched from the live OpenAPI spec, so muapi run <model> -h always reflects the real, current parameters.

CommandDescription
muapi run <model> -hPrint model-specific inputs from the live OpenAPI schema
muapi run <model> -p "..."Run with a prompt
muapi run <model> -p "..." -i k=v -i k=vPass arbitrary inputs (JSON-parsed when valid)
muapi run <model> --input-file inputs.jsonInputs from a JSON file
muapi run <model> ... --dry-runShow the request body without sending

<model> accepts either a real endpoint slug (flux-dev-image, nano-banana-2, seedance-2-text-to-video) or a short alias from the curated tables (flux-dev, seedream, kling-master).

Merge order for inputs (later wins): --input-file β†’ -i k=v β†’ -p prompt.

# Discover a model's real inputs
muapi run nano-banana-2 -h

# Run it
muapi run nano-banana-2 -p "a logo for a coffee shop" -i num_images=2 --download ./out

# Pipe-safe JSON
muapi run flux-dev-image -p "..." --output-json --jq '.outputs[0]'

muapi predict

CommandDescription
muapi predict result <id>Fetch current status (no polling)
muapi predict wait <id>Wait until complete

muapi upload

CommandDescription
muapi upload file <path>Upload a local file β†’ get hosted URL

muapi models

CommandDescription
muapi models listList all models
muapi models list --category videoFilter by category

muapi config

CommandDescription
muapi config set <key> <value>Set a persistent default
muapi config get <key>Read a config value
muapi config listShow all config

Useful keys: output (json/human), model.image, model.video, no_color (true/false)

muapi docs

CommandDescription
muapi docs openapiFetch the full OpenAPI spec
muapi docs openOpen Swagger UI in browser

muapi mcp

CommandDescription
muapi mcp serveStart MCP server (stdio) for AI agents

Global Options

FlagDescription
--wait / --no-waitPoll until done (default: --wait)
--output-json / -jPrint raw JSON response
--jq <expr>Filter JSON output (e.g. '.outputs[0]')
--download <dir> / -dAuto-download outputs to directory
--no-colorDisable colored output

Environment Variables

VariableDescription
MUAPI_API_KEYAPI key (overrides keychain/config)
MUAPI_BASE_URLOverride API base URL
NO_COLORDisable colored output

Exit Codes

CodeMeaning
0Success
1General error
3Authentication error
4Rate limited
5Not found
6Billing error
7Timeout
8Validation error

MCP Server

muapi supports two MCP transport modes. Both expose the same 19 tools: image generate/edit, video generate/from-image, audio create/from-text, enhance (upscale/bg-remove/face-swap/ghibli), edit lipsync/clipping, predict result, upload file, keys list/create/delete, account balance/topup.

Option 1 β€” Hosted (Recommended, no CLI required)

The hosted MCP server at https://api.muapi.ai/mcp uses the standard Streamable HTTP transport. Any MCP client can connect with just your API key β€” no CLI install needed.

Claude Code:

claude mcp add --transport http muapi \
  https://api.muapi.ai/mcp \
  --header "Authorization: Bearer YOUR_MUAPI_KEY"

Cursor β€” add to mcp.json (Cmd+Shift+P β†’ Open MCP settings):

{
  "mcpServers": {
    "muapi": {
      "url": "https://api.muapi.ai/mcp",
      "headers": { "Authorization": "Bearer YOUR_MUAPI_KEY" }
    }
  }
}

Windsurf β€” open Settings β†’ MCP:

{
  "mcpServers": {
    "muapi": {
      "serverUrl": "https://api.muapi.ai/mcp",
      "headers": { "Authorization": "Bearer YOUR_MUAPI_KEY" }
    }
  }
}

Option 2 β€” stdio via CLI (Claude Desktop)

Run the CLI as a local stdio MCP server. Requires the CLI to be installed.

muapi mcp serve

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "muapi": {
      "command": "muapi",
      "args": ["mcp", "serve"],
      "env": { "MUAPI_API_KEY": "your-key-here" }
    }
  }
}

Any stdio-compatible client β€” use the command + args pattern above, substituting your client's config format.

For more details on the self-hosted MCP server see muapi-mcp-server.

Agentic Pipeline Examples

# Full onboarding without human intervention
muapi auth register --email agent@example.com --password "secret"
muapi auth verify --email agent@example.com --otp 123456
muapi auth login --email agent@example.com --password "secret"
muapi account balance --output-json
muapi account topup --amount 10 --output-json --no-open

# Submit async, capture request_id, poll when ready
REQUEST_ID=$(muapi video generate "a dog on a beach" \
  --model kling-master --no-wait --output-json --jq '.request_id' | tr -d '"')
muapi predict wait "$REQUEST_ID" --download ./outputs

# Chain: upload β†’ edit β†’ download
URL=$(muapi upload file ./photo.jpg --output-json --jq '.url' | tr -d '"')
muapi image edit "make it look like a painting" --image "$URL" \
  --model flux-kontext-pro --download ./outputs

# Rotate API keys programmatically
NEW_KEY=$(muapi keys create --name "ci-$(date +%Y%m%d)" --output-json --jq '.api_key' | tr -d '"')
OLD_ID=$(muapi keys list --output-json --jq '.[0].id')
muapi keys delete "$OLD_ID" --yes

# Discover available endpoints
muapi docs openapi --jq '.paths | keys[]'

Shell Completions

muapi --install-completion bash
muapi --install-completion zsh
muapi --install-completion fish

Global Ranking

-
Trust ScoreMCPHub Index

Based on codebase health & activity.

Manual Config

{ "mcpServers": { "muapi-cli": { "command": "npx", "args": ["muapi-cli"] } } }