> ## Documentation Index
> Fetch the complete documentation index at: https://agent.minimax.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Build a Mini App with the Agent

> Use /miniapp-creator in the MiniMax Code desktop app to go from a one-sentence request to a working page.

<div className="code-docs">
  You don't have to start from scratch. Tell the Agent "Build me a dashboard for XX", and it initializes the package, writes the page and backend, publishes and opens the app, and checks the result with screenshots. You review the result and ask for changes.

  <h2 id="prompt">
    Start with one sentence
  </h2>

  ```text theme={null}
  /miniapp-creator Build me a Notion task board: columns by status, change status on the page, and sync the change back to Notion
  ```

  You can skip the command. Plain requests such as "build me a Pomodoro timer" or "turn my Jira issues into a list I can create, edit, and delete" go through the same flow. Only a request like "make a Notion board", which could mean Notion's own board view, makes the Agent ask which one you want.

  <h2 id="flow">
    What the Agent does
  </h2>

  <Steps>
    <Step title="Understand the request">
      It reviews your existing connections and tools, proposes two or three concrete directions, and asks only questions that significantly change the product. Reversible details such as the name, icon, and layout use defaults.
    </Step>

    <Step title="Prove the data path">
      It runs one read-only query against each data source to confirm authorization, fields, and real responses. If that fails, it stops and explains why instead of filling an empty shell with sample data.
    </Step>

    <Step title="Initialize the package">
      It calls `init` on the `miniapp` tool to scaffold `miniapps/<pluginId>/` in your workspace. That is the only package it edits.
    </Step>

    <Step title="Write the page and backend">
      The page goes in `miniapp/client/` and the Node entry in `miniapp/node/`; managed MCP, Connector, and Agent access are declared as needed.
    </Step>

    <Step title="Publish and open">
      It calls `publish`, `inspect`, and `open` in turn, and the page appears in the sidebar of the current conversation.
    </Step>

    <Step title="Check with screenshots">
      It inspects page structure, text, and interactions in the built-in browser and reports what passed and what could not be verified.
    </Step>
  </Steps>

  <h2 id="tool">
    The miniapp tool
  </h2>

  The Agent manages a Mini App's lifecycle through the host's `miniapp` tool. You rarely call it yourself, but knowing its actions helps you follow what the Agent is doing.

  | Action | What it does |
  | - | - |
  | `init` | Creates or claims `miniapps/<pluginId>/` in the current workspace and returns the only editable package path. `mode: "update"` means an existing package was found |
  | `publish` | Validates and publishes the package, starting or replacing the running service. `sourcePath` publishes an existing finished directory |
  | `inspect` | Reads an installed Mini App's source (`official` / `local`), runtime status, and diagnostics for the latest run, without starting it |
  | `open` | Opens the page in the current conversation; `path` opens a specific address inside the plugin |
  | `restart` | Restarts the service from the installed version, without reading the workspace |
  | `stop` | Stops the service and keeps the plugin and its Skills and MCP |
  | `list` | Lists installed Mini Apps and their runtime status |

  ```json theme={null}
  { "action": "open", "pluginId": "sales-board", "path": "/items/42?tab=details" }
  ```

  <h2 id="iterate">
    Keep iterating
  </h2>

  Tell the Agent what to change. It edits the same package and publishes again. Changes stay inside the directory returned by `init`; it doesn't read other drafts, installed plugins, or host source code.

  <Warning>
    Official Mini Apps installed from the marketplace can't be edited or republished locally. To customize one, ask the Agent to build a copy under a new `pluginId`.
  </Warning>

  <h2 id="finished">
    Already have a package
  </h2>

  Got a finished Mini App directory or ZIP from someone? Hand it to the Agent: "Install this Mini App". The Agent inspects the package first, without running its instructions, installing dependencies, or building, then publishes it with `sourcePath`. A ZIP is extracted to a new directory first.

  ```json theme={null}
  {
    "action": "publish",
    "pluginId": "sales-board",
    "sourcePath": "./received/extracted/sales-board"
  }
  ```

  The path is used for this publish only; later updates and restarts never read it again.
</div>
