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.
Three ways an AI reaches MZPanel
Section titled “Three ways an AI reaches MZPanel”| Door | Who uses it | What it can do |
|---|---|---|
MCP at https://mcp.mzpanel.com | Your own AI client (Claude Code, Cursor, VS Code, Claude Desktop) with a Bearer API token | The 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 calls | Exactly the same operations as MCP, with the same token. See the REST API quickstart. |
On-box mz CLI | An 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)”- Who am I?
GET /v1/api/whoamireturns 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 teamrole. MCP has no separate tool for this:tools/listis already filtered to what the token may call. - What can I call?
GET /v1/api/operationsreturns 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. - Which servers?
servers_list(MCP) orGET /v1/servers(REST). Registry tools take the server UUID asid, not its name. Only the hand-written core tools take aserverargument by name. - Before any on-box change:
jobs_schema {type}(MCP) orGET /v1/api/job-kinds/{type}(REST) returns the exact JSON Schema of the job body, plus itslevel,scope,min_tierandrbac_group.
Entity model
Section titled “Entity model”- 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.
How a change happens
Section titled “How a change happens”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 | cancelledservers_sites_refresh {id} # then re-read state to confirm the effectjobs_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.
Pages in this section
Section titled “Pages in this section”- Connect your AI client (MCP): Claude Code, Cursor, VS Code, Claude Desktop, ChatGPT and generic HTTP clients.
- REST API quickstart: curl examples, the error envelope and rate limits.
- Tokens, levels & scopes: what a token can reach and how to ask for more.
- Jobs: dispatch, poll, stream: the async lifecycle, offline queue and safe retries.
- Safe operating rules: the rules an autonomous agent must follow, and what is never possible with a token.
Playbooks
Section titled “Playbooks”Step-by-step tool sequences with exact names, bodies and the level or scope each step needs:
- Onboard a server
- Create a site (any type)
- Deploy code from your AI agent (a local folder or a Git repo → a running app with an HTTPS URL)
- Deploy a Docker app or stack
- Edit non-WordPress sites and Docker apps (files, deploys, env, databases, logs)
- Databases
- Backups and restore
- DNS, TLS and SSL
- Mail domains and mailboxes
- Uptime monitors and alerts
- Troubleshoot a failing site or app
- WordPress sites: WP & AI content (posts via
wp.content, and the WordPress 6.9 abilities viawp_abilities_discover/wp_ability_execute) - Automations without an agent: workflow templates for n8n, Zapier and Make
Reading these docs as a machine
Section titled “Reading these docs as a machine”/llms.txtis a compact map of every page./llms-small.txtand/llms-full.txthold the whole corpus as plain text (small strips asides and whitespace)./_llms-txt/ai-agents.txtbundles 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 examplehttps://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 fromtools/list,jobs_schemaandGET /v1/api/operations, not from prose.
Related
Section titled “Related”- Control plane API: auth, route groups and the error-code table.
- Job kinds: job domains, risk classes and plan gates.
- The mz CLI and mz command catalog: the on-box surface.
- Troubleshooting: agent offline, stuck jobs, SSL, backups and API errors.