Get the FREE Ultimate OpenClaw Setup Guide →

cpanel

Complete Model Context Protocol (MCP) server for managing cPanel hosting through AI assistants. Built with TypeScript. 16 tools for file, database, email, and subdomain management.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio aandersen2323-cpanel-mcp-server node /absolute/path/to/cpanel-mcp-server/build/index.js \
  --env CPANEL_USERNAME="your_username@your_domain.com" \
  --env CPANEL_API_TOKEN="your_api_token" \
  --env CPANEL_SERVER_URL="https://your-domain.com:2083"

How to use

This MCP server provides a production-ready interface to manage cPanel hosting via natural language interactions. It exposes 16 tools that cover file management, database operations, email accounts, subdomains, and system actions such as backups and SSL installation. After configuring the server in your MCP environment (e.g., Claude Code or another MCP-enabled assistant), you can issue natural language commands like listing files in public_html, reading or writing files, managing databases and emails, creating subdomains, or performing disk usage checks. Direct tool calls are also supported for precise operations, such as mcp__cpanel__list_files({ dir: "/public_html" }) or mcp__cpanel__disk_usage().

How to install

Prerequisites:

  • Node.js 18 or higher installed on the hosting server
  • A cPanel account with API token access
  • An MCP-capable AI assistant (e.g., Claude Code) configured to load MCP servers

Setup steps:

  1. Clone the repository and install dependencies
git clone https://github.com/aandersen2323/cpanel-mcp-server.git
cd cpanel-mcp-server
npm install
  1. Build the server
npm run build
  1. Configure credentials
cp .env.example .env
# Edit .env with your cPanel credentials
  1. Add to your MCP configuration (example for Claude Code / VS Code)
  • In your MCP config, reference the built server entry point and environment variables as shown:
{
  "mcp.servers": {
    "cpanel": {
      "command": "node",
      "args": ["/absolute/path/to/cpanel-mcp-server/build/index.js"],
      "env": {
        "CPANEL_USERNAME": "your_username@your_domain.com",
        "CPANEL_API_TOKEN": "your_api_token",
        "CPANEL_SERVER_URL": "https://your-domain.com:2083"
      }
    }
  }
}
  1. Start or restart your MCP-enabled assistant and verify the cPanel MCP server appears in the available tools.

  2. Optional: Create a dedicated service or systemd unit to ensure the MCP server restarts on failure.

Additional notes

Tips and common issues:

  • Ensure your Node.js version matches the 18+ requirement and that the built index.js path is correct in your MCP configuration.
  • Keep your CPANEL_API_TOKEN highly secure and never commit it to source control; use environment variables or secret managers.
  • If the MCP server fails to start, verify that build/index.js exists and node --version reports v18.x. Rebuild if necessary.
  • Use API tokens with least privilege necessary for your automation tasks and rotate tokens regularly.
  • When configuring in Claude Code or another assistant, ensure the absolute path in args points to the built index.js file on the host running the MCP server.
  • The README references several cPanel API modules (Fileman, Quota, Mysql, Email, SubDomain, Backup, SSL); ensure these modules are enabled and accessible via your API token.

Related MCP Servers

Sponsor this space

Reach thousands of developers