Sponsored by Deepsite.site

WHM Management Control Panel (MCP)

Created By
hosthobbit8 months ago
WHM Management Control Panel (MCP) server for managing WHM/cPanel servers
Content

WHM Management Control Panel (MCP)

A Node.js server application that connects to a WHM (Web Host Manager) server for account administration and server management. This application implements the Model Context Protocol (MCP) to allow AI assistants like Claude to interact with WHM APIs.

Features

  • Account Management (create, modify, suspend, terminate)
  • Server Information and Statistics
  • Server Updates and Maintenance
  • SSL Certificate Management
  • Backup Management
  • Email Account Management
  • Domain Management
  • Security Features
  • MCP Protocol Implementation for AI Assistant integration

Installation

  1. Clone the repository
  2. Install dependencies:
    npm install
    
  3. Configure the .env file with your WHM server details:
    # WHM Server Configuration
    WHM_SERVER=your-server-domain.com
    WHM_PORT=2087
    WHM_USERNAME=root
    WHM_API_TOKEN=your-api-token-here
    
    # MCP Server Configuration
    PORT=3000
    NODE_ENV=development
    LOG_LEVEL=info
    
    # API Authentication
    API_KEY=your-secret-api-key-here
    
  4. Start the server:
    npm start
    

For development:

npm run dev

MCP Server Configuration

To use this MCP server with AI assistants like Claude in Cursor, you need to add the following configuration to your mcp.json file:

{
  "mcpServers": {
    "whm": {
      "url": "http://your-server-address:3000/sse"
    }
  }
}

MCP Implementation Details

This server implements the Model Context Protocol using HTTP Server-Sent Events (SSE) as the transport mechanism. The implementation follows the standard JSON-RPC 2.0 format for all messages and includes:

  • A /sse endpoint for establishing persistent connections
  • A /messages endpoint for receiving and responding to client requests
  • Proactive connection/ready and tools/ready notifications
  • Standardized error handling with appropriate error codes

The MCP architecture allows AI assistants to safely interact with WHM functionality through clearly defined tools with specific parameter schemas, creating a secure bridge between language models and server management functions.

Available MCP Tools

The MCP server exposes the following WHM functionality via tools:

Account Management

  • whm_list_accounts - List all WHM accounts
  • whm_create_account - Create a new cPanel account
  • whm_account_summary - Get account details
  • whm_suspend_account - Suspend a cPanel account
  • whm_unsuspend_account - Unsuspend a cPanel account
  • whm_terminate_account - Permanently delete an account

Server Management

  • whm_server_status - Get server status and system stats
  • whm_server_load - Get server load statistics
  • whm_service_status - Get status of server services
  • whm_restart_service - Restart a specific server service
  • whm_check_updates - Check for available updates
  • whm_start_update - Start server update process

Domain Management

  • whm_list_domains - List domains for an account
  • whm_add_domain - Add a domain to an account
  • whm_delete_domain - Remove a domain from an account

API Documentation

The API endpoints are organized by resource type:

  • /api/accounts - Account management operations
  • /api/server - Server information and operations
  • /api/domains - Domain management
  • /api/ssl - SSL certificate management
  • /api/backups - Backup management operations
  • /api/email - Email account management

For detailed API documentation, see the /docs endpoint after starting the server.

Security

This application requires WHM API credentials. Never share your .env file or expose your API tokens.

Security Best Practices

When using this MCP server for WHM administration, follow these security recommendations:

  1. API Token Protection: Keep your WHM API tokens secure and rotate them regularly.
  2. Use TLS/SSL: Always deploy this server with HTTPS in production environments.
  3. Firewall Rules: Restrict access to the MCP server by IP address where possible.
  4. Regular Updates: Keep the WHM server updated with the latest security patches.
  5. Monitoring: Implement monitoring to detect unusual activity or unauthorized access attempts.
  6. Backup Strategy: Maintain regular backups of all server configurations and data.

Root vs. Site Compromises

Be aware of the distinction between site and root compromises:

  • A site compromise affects only specific websites, while a root compromise exposes the entire server.
  • In case of any compromise, restore from backups and identify the entry point of the attack.
  • For WHM security details, refer to the cPanel Security Best Practices.

Testing

You can test the MCP server using the included example client:

npm run example

This will run a simple test client that connects to the MCP server, requests the available tools, and executes a sample command.

License

ISC

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Serper MCP ServerA Serper MCP Server
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
ChatWiseThe second fastest AI chatbot™
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code