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.
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:
- Clone the repository and install dependencies
git clone https://github.com/aandersen2323/cpanel-mcp-server.git
cd cpanel-mcp-server
npm install
- Build the server
npm run build
- Configure credentials
cp .env.example .env
# Edit .env with your cPanel credentials
- 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"
}
}
}
}
-
Start or restart your MCP-enabled assistant and verify the cPanel MCP server appears in the available tools.
-
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
zen
Selfhosted notes app. Single golang binary, notes stored as markdown within SQLite, full-text search, very low resource usage
MCP -Deepseek_R1
A Model Context Protocol (MCP) server implementation connecting Claude Desktop with DeepSeek's language models (R1/V3)
mcp-fhir
A Model Context Protocol implementation for FHIR
mcp
Inkdrop Model Context Protocol Server
mcp-appium-gestures
This is a Model Context Protocol (MCP) server providing resources and tools for Appium mobile gestures using Actions API..
dubco -npm
The (Unofficial) dubco-mcp-server enables AI assistants to manage Dub.co short links via the Model Context Protocol. It provides three MCP tools: create_link for generating new short URLs, update_link for modifying existing links, and delete_link for removing short links.