cPanel/WHM MCP Server
Provides tools for managing cPanel/WHM servers through their official APIs, including account and usage queries, DNS and domain management, SSL certificate checks, email account and delivery searches, database and PHP information, error logs, server status, and optional preview/confirm write actions such as suspending accounts, editing DNS zones, creating mailboxes, and adding forwarders.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cPanel/WHM MCP Server Which accounts are using more than 80% of their disk quota?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
cPanel/WHM MCP Server
A Model Context Protocol (MCP) server that lets AI assistants such as Claude manage cPanel and WHM servers through their official APIs. It is read-only unless you turn writes on, and every change has to be previewed and confirmed first.
Claude (Desktop / Code) ⇄ this server (local, stdio) ⇄ WHM API 1 / cPanel UAPI (HTTPS, port 2087)It runs on your own machine. There is nothing to host, no open ports, and nothing to install on the WHM server.
Status: early development, not yet tested against a live WHM server. The API calls were written from cPanel's published API reference (version 11.138) and tested against a fake server. See Before relying on it.
This is an unofficial project. It is not affiliated with or endorsed by cPanel, L.L.C. cPanel and WHM are trademarks of their owner.
What you can ask
"Which accounts are using more than 80% of their disk quota?"
"List every account still running PHP 7.4."
"Show me the last 50 PHP errors for example.co.uk."
"Which SSL certificates expire in the next 14 days?"
"Why didn't mail to sales@example.co.uk arrive yesterday?"
"Who are the top 10 bandwidth users this month?"
"Create a mailbox for info@example.co.uk and forward it to the owner." (needs
emailwrites enabled)
Related MCP server: cPanel MCP Server
Setup
You need Node.js 22 or later and a WHM API token from WHM » Development » Manage API Tokens. See Token privileges.
npm ci
npm run buildThen add the server to your MCP client.
Claude Desktop (claude_desktop_config.json), or Claude Code (.mcp.json in your project; keep this file out of version control, as it holds your token):
{
"mcpServers": {
"whm": {
"command": "node",
"args": ["/absolute/path/to/cpanel-whm-mcp/dist/index.js"],
"env": {
"WHM_HOST": "server.example.com",
"WHM_API_TOKEN": "your-token"
}
}
}
}Configuration
Variable | Default | Purpose |
| required | Server hostname. HTTPS only; |
| required | The WHM API token. |
|
| The user that owns the token (root or a reseller). |
|
| WHM's HTTPS port. |
| empty | Write tools to enable: any of |
|
| Where write actions are logged. |
|
| Timeout for each API request. |
|
| Skips certificate checks. Anyone able to intercept the connection could capture your token, so use this only on a network you trust, and prefer giving the server a valid certificate. |
Tools
Read-only (always available)
Area | Tool | What it does |
Accounts |
| List and search accounts |
| Full details of one account | |
| Disk and inode usage; find accounts near quota or the biggest users | |
| Bandwidth per account for a month, highest first | |
Domains and DNS |
| Domains and subdomains; find which account owns a domain |
| List zones | |
| Records and serial of one zone | |
SSL |
| Installed certificates, soonest expiry first |
| Why AutoSSL can't validate an account's domains | |
| Mailboxes, usage and suspension status | |
| Forwarders on a domain | |
| Mail delivery records; failures and deferrals by default | |
Databases |
| An account's MySQL databases |
| An account's MySQL users | |
PHP |
| PHP version per site; find outdated versions |
Diagnostics |
| PHP or Apache error log lines for a domain |
| One account's usage against its limits | |
| Load averages and this server's safety settings |
Write (off until enabled)
Category | Tool | What it does |
|
| Suspend an account, with a required reason |
| Unsuspend an account | |
|
| Add, edit or remove records |
|
| Create a mailbox and email a set-password invitation |
| Forward an address to other email addresses |
Deliberately left out
Account termination and other irreversible actions. Out of scope for the first versions.
Copying a database. cPanel's UAPI reference lists no copy function.
Mysql::dump_database_schemareturns the structure but not the data, andBackup::restore_databasesrestores a backup file with no option to choose a different target database, so using it could overwrite the live one. A safe dev copy needs another route, such as SSH.Forwarding mail to programs or system users. Piping mail to a program amounts to running code on the server.
Reading arbitrary files. The log tool takes a domain and works out the path itself, so it can't be pointed at other files.
Safety model
Read-only by default. A write tool whose category isn't enabled is never registered, so the model can't see or call it.
Preview, then confirm. The first call to a write tool changes nothing. It returns exactly what would change and a token. The token only works once, only for that tool with those same parameters, and expires after five minutes.
Human approval. If your MCP client supports elicitation, the server also asks you directly, and declining or closing the prompt stops the change.
Know the limit. On a client without elicitation, the preview step is carried out by the model, which is instructed to ask you first but could in principle send the token without asking. On those clients, your client's own tool-approval prompt is the real human checkpoint, so don't auto-approve the write tools.
DNS edits can't overwrite someone else's change. An edit must quote the zone's current serial, and it's rejected if the zone has changed since. SOA records can't be changed at all, and changes to NS records carry a warning.
No secrets in output. Tool results, error messages and the audit log are all scrubbed of the API token and of values under keys such as password or private_key. New mailboxes get a random password that is never shown or stored; the owner sets their own through the emailed invitation. Scrubbing log contents is best-effort: it catches password=... patterns, but an application could log a secret in some other form.
Audit log. Each write is logged as one line of JSON with a timestamp and its parameters: when it's attempted, then whether it succeeded or failed. Declined changes are logged too. If the attempt can't be logged, the change doesn't go ahead.
Untrusted content. Logs and mail records contain text written by outsiders, who could try to plant instructions for the AI. These results are labelled as data, but that lowers the risk rather than removing it, so check any change the assistant proposes after reading them.
Token privileges
Give the token only what you need. These are WHM's privilege names for the features this server uses. cPanel's API reference doesn't list the privilege each function needs, so treat this as a starting point: if a tool reports AUTH_FAILED or "Access denied", the token is probably missing one, and some functions may only work for root.
Needed for | Privileges |
Accounts and usage |
|
Server status |
|
SSL |
|
Mail delivery search |
|
Email, databases, Apache and PHP logs, per-account usage |
|
Suspending accounts |
|
DNS |
|
cpanel-api is broad. It lets the token call any cPanel function on the accounts it controls, including ones that change things. With that privilege, or with a root token, this server's read-only mode limits what the assistant can do, but the token itself could do more. Keep it safe accordingly.
Before relying on it
Everything here is tested against a fake server built from cPanel's documentation, so these points need checking on a real one. Start with a test server, in read-only mode:
Read tools: try each one and compare the results with what WHM shows.
PHP log paths: does
Fileman::get_file_informationaccept an absolute path, and how does it respond when the file is missing? The docs aren't clear on either.Mail search limits:
emailtrack_searchhas an optional per-type result cap and the docs don't give its default, so results could be cut short.POST requests: the docs only show GET. Writes use POST so that parameters stay out of access logs, and this needs confirming, especially for
uapi_cpanel.DNS edit format: the docs' URL example wraps the record JSON in single quotes, which looks like leftover shell quoting, so this server sends plain JSON. The serial is read from the third SOA field, which the docs don't spell out either. Try this on a throwaway zone.
Mailbox invitations: check that
UserManager::create_usersends the invitation, and that the generated password meets your server's strength rules.
Development
npm run typecheck
npm test # builds first, as some tests run the built serverThe tests cover the request and response handling, every tool and the safety controls. They also run the built server over stdio against a local HTTPS server, which needs openssl on your PATH; those tests are skipped without it.
Roadmap
Project setup, config and WHM API client
Read-only tools: accounts, domains, SSL, PHP versions, logs
Tests against a dev/test WHM instance
Write tools behind config flags, with confirmation and audit log
Documentation and example prompts
First public release on GitHub
Optional remote (HTTP) mode with proper authentication
License
Available Tools
18 toolswhm_account_resource_usageAccount resource usageARead-onlyIdempotent
Get one account's usage against its limits, including disk, bandwidth, databases, email accounts and domains. A null maximum means unlimited.
Inputs: user (required).
whm_autossl_problemsAutoSSL problemsARead-onlyIdempotent
List the latest AutoSSL domain validation (DCV) problems for one account, which usually explain why a certificate isn't renewing.
Inputs: user (required).
whm_bandwidth_usageBandwidth usage by accountARead-onlyIdempotent
List bandwidth usage per account for one month, highest first. Defaults to the current month. Use a small limit to find the biggest consumers.
Inputs: user, year, limit, month, +1 more.
whm_disk_usageDisk usage by accountARead-onlyIdempotent
List disk and inode usage per account. Use min_percent to find accounts near their quota, or the default sort with a small limit to find the biggest consumers. Accounts with an unlimited quota have a null percent_used and are left out when min_percent is set.
Inputs: user, fresh, limit, offset, +2 more.
whm_email_delivery_searchSearch email delivery recordsARead-onlyIdempotent
Search the server's mail delivery records, newest first, to work out why a message did not arrive. By default it returns failed and deferred deliveries from the last 24 hours.
Inputs: hours, limit, sender, statuses, +1 more.
whm_get_accountGet account detailsBRead-onlyIdempotent
Get the full summary of one cPanel account, including its limits and suspension details.
Inputs: user (required).
whm_get_dns_zoneGet DNS zoneARead-onlyIdempotent
Get a zone's records and current serial. To change the zone, pass this serial and these line_index values to whm_edit_dns_zone.
Inputs: zone (required).
whm_get_error_logGet a site's error logARead-onlyIdempotent
Get recent error log lines for a domain. php reads the error_log file in the domain's document root. apache_error and apache_suexec read the Apache logs for that domain. If php returns nothing, the site may log PHP errors elsewhere, so try apache_error.
Inputs: domain (required), lines, source.
whm_list_accountsList accountsBRead-onlyIdempotent
List cPanel accounts with their main domain, plan, owner, disk usage and suspension status. Sorted by username.
Inputs: exact, limit, offset, search, +2 more.
whm_list_databasesList MySQL databasesBRead-onlyIdempotent
List an account's MySQL databases with their size and assigned users.
Inputs: user (required), limit, offset.
whm_list_database_usersList MySQL usersARead-onlyIdempotent
List an account's MySQL users and the databases each one can access.
Inputs: user (required), limit, offset.
whm_list_dns_zonesList DNS zonesBRead-onlyIdempotent
List the DNS zones on this server.
Inputs: limit, offset.
whm_list_domainsList domainsARead-onlyIdempotent
List domains and subdomains with their owning account, type, document root and PHP version. Use the domain filter to find which account owns a domain.
Inputs: user, limit, domain, offset, +1 more.
whm_list_email_accountsList email accountsARead-onlyIdempotent
List an account's mailboxes with their disk usage, quota and suspension status.
Inputs: user (required), limit, domain, offset.
whm_list_email_forwardersList email forwardersCRead-onlyIdempotent
List the email forwarders on one domain.
Inputs: user (required), domain (required), limit, offset.
whm_php_versionsPHP versions by siteARead-onlyIdempotent
List the PHP version of every virtual host. Use exact_version or older_than to find sites on an outdated version. unresolved_count is the number of sites whose version couldn't be worked out. Those sites are left out when you filter, so check them separately before calling a server clean.
Inputs: user, limit, offset, older_than, +1 more.
whm_server_statusServer statusARead-onlyIdempotent
Get the server's load averages and this MCP server's safety settings, including which categories of write tools are enabled. If a write tool seems to be missing, check here first.
Inputs: no named parameters.
whm_ssl_certificatesSSL certificates and expiryARead-onlyIdempotent
List the SSL certificate installed on each virtual host, soonest expiry first. Use expiring_within_days to find certificates that need attention. A negative days_remaining means the certificate has already expired.
Inputs: user, limit, offset, expiring_within_days.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Most tools target a clearly distinct resource (accounts, DNS, SSL, email, databases, PHP, logs), and descriptions add useful cross-references (e.g. get_dns_zone pointing to edit_dns_zone, error-log source hints). Minor overlap: whm_list_accounts vs whm_get_account, and whm_disk_usage/whm_bandwidth_usage/whm_account_resource_usage all report usage from different angles, so an agent must read descriptions to pick correctly.
All names share a consistent whm_ prefix, but the conventions below that are mixed: verb_noun (whm_get_account, whm_list_accounts, whm_get_error_log) versus plain noun phrases (whm_disk_usage, whm_ssl_certificates, whm_php_versions, whm_server_status) and one noun_verb oddity (whm_email_delivery_search). It stays readable, but the pattern is not predictable from name alone.
18 tools is on the high side, but each maps to a distinct facet of server administration (accounts, DNS, SSL/AutoSSL, mail, databases, PHP, logs, server health), so none feel redundant. Slightly heavy but reasonable for a WHM-wide inspection surface.
The read/diagnostic surface is broad and coherent, but it is almost entirely read-only: no write/edit/delete operations appear, and whm_get_dns_zone explicitly instructs passing the serial to whm_edit_dns_zone, a tool that does not exist in this set. whm_server_status hints write tools may be gated, but from the agent's view these are dead ends.
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Lets AI agents analyze API metrics, request logs, and traces, and manage apps and alerts.
Connect AI assistants to explicitly paired computers, servers, and VMs for permitted remote actions.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to manage WHM hosting accounts and server administration tasks including account management, server stats, updates, SSL, backups, and email through a secure API.13ISC
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage cPanel hosting accounts including DNS, email, databases, SSL, files, security, and more through natural language using cPanel's UAPI and API2.ISC
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to query and manage a web hosting billing platform through its External API — clients, tickets, invoices, domains, orders, products, and system data. It defaults to read-only with per-domain opt-in for writes, two-step confirmation for billing and destructive actions, and automatic redaction of secrets, card data, and PII.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to drive Jabali Panel operations such as domains, DNS, mail, applications, databases, backups, and fleet/admin tasks through natural language. It wraps the panel's REST API with read-only defaults, opt-in writes, confirmation-gated destructive actions, and dry-run support.2AGPL 3.0