muapi CLI logo

muapi CLI

Organization
SamurAIGPT

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

PublisherSamurAIGPT
Repositorymuapi-cli
LanguagePython
Forks
2
Stars
4
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    muapi CLI exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    4 stars and 2 forks from the linked repository.

muapi CLI

Powered by MuAPI

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).

Related Projects

Install

bash
# 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

bash
# 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.

bash
# 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:

bash
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):

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

Windsurf — open Settings → MCP:

json
{
  "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.

bash
muapi mcp serve

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

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.

Grok Build Plugin

This repository also ships a Grok Build plugin that connects Grok to Muapi's hosted MCP server. Install the muapi plugin from the Grok Build marketplace, then set MUAPI_API_KEY in the environment used by Grok Build:

bash
export MUAPI_API_KEY="YOUR_MUAPI_KEY"

The plugin provides live model discovery plus image, video, audio, enhancement, editing, and async-result tools. Generation and enhancement consume Muapi credits; account top-ups, key management, and external publishing remain approval-gated by the plugin instructions.

For a direct project-local setup without waiting for marketplace review, add the hosted MCP server to Grok Build with:

bash
grok mcp add --transport http muapi \
  https://api.muapi.ai/mcp \
  --header "Authorization: Bearer ${MUAPI_API_KEY}"

Agentic Pipeline Examples

bash
# 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

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

Installation

TypingMind
Prerequisites:

Node.js 18+

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

Use muapi CLI MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once muapi CLI is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add muapi CLI as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the muapi CLI MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "samuraigpt-muapi-cli": {
      "command": "npx",
      "args": [
        "-y",
        "muapi-cli"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the muapi CLI MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the muapi CLI MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use muapi CLI to help me with this task?
muapi CLI
Sure. I read it.
Here is what I found using muapi CLI.

Frequently asked questions

What is the muapi CLI MCP server used for?

muapi CLI is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use muapi CLI MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use muapi CLI with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use muapi CLI MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With muapi CLI connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect muapi CLI MCP to TypingMind?

muapi CLI runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does muapi CLI MCP provide in TypingMind?

muapi CLI exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use muapi CLI MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If muapi CLI requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇