home / mcp / cpanel mcp server

cPanel MCP Server

An MCP server to interact with cPanel via API functions to manage email accounts

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "ashrobertsdragon-cpanel-mcp": {
      "command": "uvx",
      "args": [
        "cpanel-mcp",
        "--repository",
        "https://github.com/ashrobertsdragon/cpanel-mcp"
      ],
      "env": {
        "HOSTNAME": "YOUR_HOSTNAME",
        "USERNAME": "YOUR_USERNAME",
        "CPANEL_API_TOKEN": "YOUR_API_TOKEN"
      }
    }
  }
}

You can manage cPanel email accounts, quotas, passwords, and forwarders from an MCP client through a dedicated MCP server. This server exposes essential email management actions via cPanel's UAPI, enabling automated workflows for creating, updating, and organizing mail for your domains.

How to use

You connect an MCP client to the cPanel MCP Server and issue natural language commands to perform common email management tasks. The server translates your requests into cPanel UAPI calls, enabling actions such as creating new email accounts, changing passwords, setting mailbox quotas, and configuring forwarders. Use it to automate routine email administration as part of larger workflows or chat-based management assistants.

How to install

Prerequisites: you need Python 3.10 or higher and a cPanel hosting account with API access. You will also use a command runner to pull the MCP server directly from its source repository.

Step 1: Run the server directly with the provided runner. This does not require a separate install; you invoke the server from its source using the runner.

uvx cpanel-mcp --repository https://github.com/ashrobertsdragon/cpanel-mcp

Configuration and environment

Prepare your cPanel credentials and tokens to grant secure access to the MCP server.

Set the following environment variables for the MCP client configuration and the server runtime.

Examples and usage notes

Add the server to your MCP client configuration to connect using the recommended runtime. The example below shows how to configure the client to use uvx for the cPanel MCP server.

{
  "mcpServers": {
    "cpanel-mcp": {
      "command": "uvx",
      "args": ["cpanel-mcp", "--repository", "https://github.com/ashrobertsdragon/cpanel-mcp"],
      "env": {
        "USERNAME": "your_cpanel_username",
        "HOSTNAME": "your.cpanel.hostname.com",
        "CPANEL_API_TOKEN": "your_api_token_here"
      }
    }
  }
}

Security considerations

Safeguard your API token and credentials. Do not commit tokens to version control. Use secure secret management for environment variables and ensure your cPanel server is accessible over HTTPS.

Troubleshooting

Authentication issues usually stem from an incorrect API token, username, or hostname. Verify that the token is active, the username matches your cPanel account, and the hostname includes the correct domain or subdomain.

API reference and capabilities

The server provides a set of email-related actions that map to cPanel UAPI operations, including creating and deleting email accounts, listing accounts, changing passwords, updating quotas, and managing forwarders.

Notes

When starting from scratch, ensure you run the runtime command shown above and provide the required environment values. You can then issue natural language commands like creating a new email account, listing accounts for a domain, configuring forwarders, updating quotas, or changing passwords.

Available tools

add_email_account

Create a new email account with a specified address, password, and optional quota.

delete_email_account

Delete an existing email account by address.

list_email_accounts

List all email accounts for a given domain.

change_password

Change the password for an existing email account.

update_quota

Update the mailbox storage quota for an email account.

get_email_settings

Retrieve email client configuration settings for an account.

create_email_forwarder

Create a forwarder that forwards mail from one address to another.

delete_email_forwarder

Delete a forwarder for an address.

list_email_forwarders

List all forwarders for a domain.