Bỏ qua để đến nội dung
Start here (AI agents) Entry point for an AI agent that operates an MZPanel fleet — the three ways in (MCP, REST, on-box mz), the first calls to make, the entity model, and where every playbook lives.

Start here (AI agents)

Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.

This page is for AI agents (Claude Code, Cursor, ChatGPT, your own scripts with an LLM) that need to operate a customer’s MZPanel fleet: servers, sites of every type, Docker apps and compose stacks, databases, mail, DNS/TLS, backups, uptime and AI runtimes. WordPress is one site type among many, not the center of the product.

Read this page once, then jump to the playbook for the task you were given.

DoorWho uses itWhat it can do
MCP at https://mcp.mzpanel.comYour own AI client (Claude Code, Cursor, VS Code, Claude Desktop) with a Bearer API tokenThe full management API as tools: about 340 registry tools plus about 20 hand-written core tools. Every on-box action goes through jobs_create. See Connect your AI client.
REST at https://api.mzpanel.com/v1/…Scripts, CI, LLM “actions” that can only make HTTP callsExactly the same operations as MCP, with the same token. See the REST API quickstart.
On-box mz CLIAn agent that already has a root shell on one VPS (SSH or the web terminal)Every engine command on that one box, with root trust and no plan, RBAC or audit checks. See The mz CLI.

The in-dashboard Assistant (the Ask AI drawer) is a fourth, separate surface. It runs on the platform’s LLM with a small built-in toolset (docs search, inventory reads, storage usage and clean, SSL issue, service control, WordPress update). Bearer tokens cannot call it. To get the full surface, connect your own client over MCP.

MCP, the REST API and the web terminal are on every plan, Free included. On Free, changes made through MCP or the REST API are a 30-day trial from the workspace’s creation; after it reads keep working and every write answers 402 automation_trial_ended (don’t retry: the user upgrades to Plus or makes the change in the dashboard). Plus and up have full automation. Each operation is still gated by your plan where the feature itself is paid (PR previews and path routing need Pro, for example). Docker apps and compose stacks are on every plan with one shared quota (Free 3, Plus 5 per server, Pro and Max unlimited).

First calls (do these before anything else)

Section titled “First calls (do these before anything else)”
  1. Who am I? GET /v1/api/whoami returns the token’s name, access_level (read / deploy / operate / full), org_id, server_scope ("all" or a list of server ids) and the owner’s team role. MCP has no separate tool for this: tools/list is already filtered to what the token may call.
  2. What can I call? GET /v1/api/operations returns every operation (id, mcp_tool, method, path, summary, level, scope, min_tier, body, allowed_for_this_token), every job kind with its risk class, the list of opt-in danger scopes, and the token’s own level and scopes. Fetch it once and cache it.
  3. Which servers? servers_list (MCP) or GET /v1/servers (REST). Registry tools take the server UUID as id, not its name. Only the hand-written core tools take a server argument by name.
  4. Before any on-box change: jobs_schema {type} (MCP) or GET /v1/api/job-kinds/{type} (REST) returns the exact JSON Schema of the job body, plus its level, scope, min_tier and rbac_group.
  • Organization (the workspace) → servers (UUID id, name, online state).
  • On a server (these change through jobs on the agent): sites keyed by domain (wordpress, static, php, nodejs, python, go), Docker apps (one container, app.*), compose stacks (stack.*), databases (db.* for MariaDB/MySQL, pg.*, mongo.*), mail (mail.*), PHP (php.*), cron, services and daemons, OS users, firewall and SSH (security.*, user.*), certificates (ssl.*) and AI runtimes (ai.*, litellm.*, rag.*, mcp.*).
  • On the control plane (no agent needed): DNS provider connections and records (dns_*), uptime monitors, backup destinations, jobs and snapshots, alert channels and rules, load balancers, the private network, projects and shared variables, notes, tags, templates and notifications.

The source of truth for on-box state is the box itself. The panel keeps an inventory cache that the agent pushes. Cached reads (servers_inventory, servers_sites, sites_list) can lag a change by a few seconds. After a job, call servers_inventory_refresh {id, kind} or servers_sites_refresh {id}, then read again.

Almost every change to a box is an asynchronous job:

jobs_create {id: <server UUID>, body: {type: "site.create", domain: "example.com", siteType: "static"}}
→ {job_id, status, stream_url}
jobs_get {id: <job_id>} # poll every 2–5 s until completed | failed | timeout | cancelled
servers_sites_refresh {id} # then re-read state to confirm the effect

jobs_get returns the status, exitCode and errorMessage (plus a failure {code, hint} block when a failed job matches a known cause: follow its hint), not the command’s output. Live output is a server-sent-events stream that MCP does not expose. Details, statuses and the offline queue: Jobs.

The hand-written core tools (service_control, storage_clean, ssl_renew, wp_update, docker_control, site_create) are different. They run synchronously, return the output inline, and preview the change unless you pass apply: true. Registry tools and jobs_create have no preview step: they run when you call them.

Step-by-step tool sequences with exact names, bodies and the level or scope each step needs:

  • /llms.txt is a compact map of every page. /llms-small.txt and /llms-full.txt hold the whole corpus as plain text (small strips asides and whitespace).
  • /_llms-txt/ai-agents.txt bundles only this section and the API/CLI reference: the best single fetch for an operating agent.
  • Every page is also served as raw Markdown at its URL plus .md, for example https://docs.mzpanel.com/ai/jobs.md.
  • The MCP tool search_docs {query} searches this docs site and a how-to knowledge base. Exact tool, parameter and job-kind contracts come from tools/list, jobs_schema and GET /v1/api/operations, not from prose.