Connect your AI client (MCP)
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
MZPanel runs a remote Model Context Protocol server on the control plane. Your AI
client connects to it over streamable HTTP, authenticates with a Bearer API
token, and gets the fleet as tools. Calls reach your servers over each agent’s
existing outbound WebSocket, so the client never needs SSH or an open port. MCP is on
every plan, Free included. On Free, write tools are a 30-day trial, then read-only
(402 automation_trial_ended); Plus and up have full automation.
- Endpoint:
https://mcp.mzpanel.com(the same server also answers atPOST https://api.mzpanel.com/mcp). - Auth: the header
Authorization: Bearer mzmcp_…for coding agents and scripts (this page). Chat apps such as Claude and ChatGPT sign in with OAuth instead: see Chat with your fleet from Claude or ChatGPT. - Transport: stateless streamable HTTP with JSON responses. Supported protocol
versions:
2025-11-25,2025-06-18,2025-03-26,2024-11-05and2024-10-07.
1. Mint a token
Section titled “1. Mint a token”In the dashboard, open Advanced → Developer (/developer). Choose a name, an ability
(Read only, Deploy, Operate (the default) or Full, or Custom for a
level read / deploy / operate / full plus opt-in scopes), optionally a server
allowlist and an expiry, then create the token. For an agent that deploys code, pick
Deploy: it can delete only the apps it deployed itself. The secret
(mzmcp_…) is shown once, so copy it right away. Minting asks you to confirm your
password or 2FA if you haven’t signed in recently.
Pick the narrowest token that does the job. See Tokens, levels & scopes.
2. Add it to your client
Section titled “2. Add it to your client”Claude Code
Section titled “Claude Code”claude mcp add --scope user --transport http mzpanel https://mcp.mzpanel.com \ --header "Authorization: Bearer mzmcp_YOUR_TOKEN"--scope user makes the server available in every project. Run claude mcp list to
check it, then /mcp inside a session to see its tools.
Prefer the Claude Code plugin: one install connects the server (token from
MZPANEL_TOKEN) and adds the deploy, diagnose, backup-check and onboard skills.
Cursor
Section titled “Cursor”Add the server to ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one
project):
{ "mcpServers": { "mzpanel": { "type": "http", "url": "https://mcp.mzpanel.com", "headers": { "Authorization": "Bearer mzmcp_YOUR_TOKEN" } } }}VS Code (GitHub Copilot agent mode)
Section titled “VS Code (GitHub Copilot agent mode)”Add the server to .vscode/mcp.json in the workspace, or to your user MCP
configuration:
{ "servers": { "mzpanel": { "type": "http", "url": "https://mcp.mzpanel.com", "headers": { "Authorization": "Bearer mzmcp_YOUR_TOKEN" } } }}Claude Desktop, claude.ai and ChatGPT
Section titled “Claude Desktop, claude.ai and ChatGPT”Add MZPanel as a custom connector with the URL https://mcp.mzpanel.com and sign in
through OAuth; no token to paste. Step by step:
Chat with your fleet from Claude or ChatGPT.
Any HTTP client (smoke test)
Section titled “Any HTTP client (smoke test)”TOKEN=mzmcp_YOUR_TOKEN# 1. initializecurl -s https://mcp.mzpanel.com \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"smoke","version":"1"}}}'
# 2. list the tools this token may callcurl -s https://mcp.mzpanel.com \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
# 3. call onecurl -s https://mcp.mzpanel.com \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"servers_list","arguments":{}}}'Opening https://mcp.mzpanel.com in a browser shows a short connection guide, which is
a quick way to check that the host is reachable.
3. What the client gets
Section titled “3. What the client gets”The initialize result carries an instructions text: a short orientation covering the
entity model, discovery order, async jobs, scopes and error codes. Clients that keep it
in context start out well-informed.
A short list, the whole catalog on demand. tools/list returns a core set of about
two dozen tools (servers, inventory, the job loop, deploys, logs, metrics, docs) plus
tools_search and tools_call, so a session starts with roughly 8k tokens of tool schemas
instead of about 60k. Ask tools_search {query: "renew certificate"} for anything else and run
the result with tools_call {name, arguments} or by its name; permissions are identical. To list
every tool up front, add ?tools=all to the URL (https://mcp.mzpanel.com/?tools=all) or send
the header X-MZ-Tools: all. The full catalog is on the MCP tools page.
Tools. There are two kinds. Registry tools are filtered: tools/list shows only the ones this token’s level and scopes allow. Core tools are always listed, but they refuse actions the token’s level does not allow (a read token cannot run them with apply: true).
| Kind | Examples | Arguments | Behaviour |
|---|---|---|---|
| Core tools (hand-written) | servers_list, sites_list, site_get, services_status, php_list, metrics_get, ssl_list, db_list, docker_ps, stacks_list, logs_tail, search_docs; actions service_control, storage_clean, ssl_renew, wp_update, docker_control, site_create, wp_cache | server = server name or id (optional on a single-server token) | Synchronous; return the output inline. Actions preview unless apply: true, except wp_cache (status, purge, warm, opcache-reset), which runs at once. site_create makes WordPress sites only. |
| Registry tools (one per API operation) | servers_sites_all, servers_inventory, jobs_create, jobs_get, dns_records_create, backup_jobs_run, uptime_monitors_create, … | Path parameters as top-level strings (id = server UUID, jobId, domain, …), plus an optional body object and an optional query object of strings | Call the REST operation in-process and return its JSON. No preview: they run immediately. |
A registry tool’s name is its operation id with . replaced by _
(backup_jobs.run → backup_jobs_run). Each description ends with
[METHOD /path; level …; scope …], so the model can see what the call requires.
jobs_schema {type} returns the body schema of any job kind for jobs_create, and
jobs_output {id} returns a job’s logged output. Operations that need a raw stream
(server-sent events such as GET /v1/jobs/{id}/stream, or the any-size file
download-stream / upload-stream) are REST-only and never tools.
Prompts. prompts/list offers ready-made workflows, for example audit-server
(a read-only security audit) and optimize-site {domain}. The exact set is whatever
prompts/list returns.
Resources. A token pinned to one server also gets the resources mzpanel://server
(status and metrics) and mzpanel://sites (sites on that server).
Limits
Section titled “Limits”- Rate limit per token: 60 requests/minute on Free, 120 on Plus, 300 on Pro and 600
on Max, shared by MCP and REST. Every MCP request counts once, including
tools/listand each tool call. Onrate_limited, wait for theRetry-Afterseconds. - The token is capped by its owner. A token acts as the user who minted it and never exceeds that user’s team role, site grants or org membership.
- Every non-GET call is audited as
api.<operation id>in the team activity log.
Troubleshooting the connection
Section titled “Troubleshooting the connection”| Symptom | Cause | Fix |
|---|---|---|
401 unauthorized | Token missing, mistyped, expired or revoked, or the header was sent without the Bearer prefix | Mint a new token and check the exact header. (A client that supports OAuth starts the sign-in from this 401 instead; see chat connectors.) |
The tool list is short or has no jobs_create | The token is read, or it lacks scopes | Use an operate or full token. See Tokens, levels & scopes. |
| A tool you expected is missing | It is outside the default core list, or its operation needs a level or opt-in scope this token doesn’t have | Find it with tools_search, or list everything with ?tools=all; if it is still missing, read GET /v1/api/operations and check allowed_for_this_token. |
400 Unsupported protocol version | The client sent an Mcp-Protocol-Version the server doesn’t list | Update the client, or let it negotiate one of the supported versions. |
A tool call returns not_found for a server | Wrong id, the server is outside the token’s allowlist, or you passed the name to a registry tool | Use the UUID from servers_list. |
Related
Section titled “Related”- Start here (AI agents): the first calls and the entity model.
- Jobs: dispatch, poll, stream: what to do after
jobs_create. - Developer & API keys: the dashboard page where tokens live.