loading…
Search for a command to run...
loading…
A complete MCP server enabling AI assistants to manage cPanel hosting through natural language, including file, database, email, subdomain, and system operation
A complete MCP server enabling AI assistants to manage cPanel hosting through natural language, including file, database, email, subdomain, and system operations.
A complete Model Context Protocol (MCP) server for managing cPanel hosting through AI assistants like Claude Code
License: MIT TypeScript Node.js
This is a production-ready MCP server that enables natural language management of cPanel hosting accounts through AI assistants. Built from scratch with TypeScript, it provides 16 tools for comprehensive hosting management.
Why This Exists: The original cPanel MCP repository contained only documentation with no source code. This is a complete, working implementation that you can use today.
Clone the Repository
git clone https://github.com/aandersen2323/cpanel-mcp-server.git
cd cpanel-mcp-server
Install Dependencies
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
For Claude Code (VS Code), add to .vscode/settings.json:
{
"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"
}
}
}
}
Restart Your AI Assistant The MCP server will auto-start and be ready to use!
Once configured, you can use natural language to manage your hosting:
File Operations:
"List files in public_html directory"
"Read the contents of wp-config.php"
"Create a new file called test.html with Hello World"
"Delete the old-backup.tar.gz file"
Database Operations:
"Show me all databases"
"Create a new database called my_app_db"
"Delete the test_database database"
Email Management:
"List all email accounts"
"Create email account [email protected] with password SecurePass123"
"Delete email account [email protected]"
Subdomain Management:
"List all subdomains"
"Create subdomain 'blog' under example.com"
"Delete subdomain test.example.com"
System Information:
"Check disk usage"
"How much storage am I using?"
"Start a full account backup"
You can also call tools directly:
// List files
mcp__cpanel__list_files({ dir: "/public_html" })
// Read file
mcp__cpanel__read_file({ file: "/public_html/index.php" })
// Create database
mcp__cpanel__create_database({ name: "myapp" })
// Check disk usage
mcp__cpanel__disk_usage()
| Tool | Description | Parameters |
|---|---|---|
cpanel_list_files |
List directory contents | dir: path (optional) |
cpanel_read_file |
Read file contents | file: full path |
cpanel_write_file |
Write/create file | file: path, content: text |
cpanel_delete_file |
Delete file/directory | file: path |
cpanel_disk_usage |
Get disk usage stats | None |
cpanel_list_databases |
List all databases | None |
cpanel_create_database |
Create database | name: database name |
cpanel_delete_database |
Delete database | name: database name |
cpanel_list_email_accounts |
List email accounts | domain: optional |
cpanel_create_email |
Create email account | email, password, quota |
cpanel_delete_email |
Delete email account | email: address |
cpanel_list_subdomains |
List subdomains | None |
cpanel_create_subdomain |
Create subdomain | subdomain, domain |
cpanel_delete_subdomain |
Delete subdomain | subdomain: full name |
cpanel_backup |
Full account backup | None |
cpanel_install_ssl |
Install SSL cert | domain: domain name |
.env file.env file - Contains sensitive credentials.gitignore for sensitive filescpanel-mcp-server/
├── src/
│ └── index.ts # MCP server implementation
├── build/
│ ├── index.js # Compiled JavaScript
│ └── *.map # Source maps
├── .env.example # Credential template
├── .gitignore # Security rules
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── LICENSE # MIT License
└── README.md # This file
https://your-domain.com:2083/execute/{Module}/{Function}
Authorization: Basic base64(username:api_token)
# Check Node.js version
node --version # Should be 18+
# Build the server
npm run build
# Verify build output
ls build/index.js # Should exist
After configuring in your AI assistant:
"Check my disk usage"
"List all subdomains"
"Show me all databases"
Problem: MCP server fails to start
Solutions:
node --versionls build/index.jsnpm run buildProblem: "401 Unauthorized" or "403 Forbidden"
Solutions:
.env[email protected]:2083Problem: File operations fail
Solutions:
/# Install dependencies
npm install
# Build TypeScript
npm run build
# Development mode (rebuild on changes)
npm run dev
# Start server directly
npm start
src/index.ts - Main server implementationbuild/ - Compiled JavaScript output.env - Your credentials (not committed).env.example - Template for credentialsContributions are welcome! Here's how you can help:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)git clone https://github.com/aandersen2323/cpanel-mcp-server.git
cd cpanel-mcp-server
npm install
npm run build
Initial Release
npm install and npm run build.envThis project is licensed under the MIT License - see the LICENSE file for details.
If this MCP server helps you manage your cPanel hosting more easily, please give it a star! ⭐
Built with ❤️ by Claude Code
Status: Production Ready ✅ Version: 1.0.0 Last Updated: October 9, 2025
Run in your terminal:
claude mcp add cpanel-mcp-server -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.