
hosthobbit/whm-mcp-server
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
MCP server that lets AI assistants like Claude manage WHM/cPanel servers: accounts, domains, services, updates
Обзор
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. - 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 You need Node.js 18 or newer and a WHM API token. 1. Make a folder for the server and create a .env file in it: 2. Start the MCP server from that folder: Or clone this repository, run npm install, then npm run mcp. The MCP endpoint is http://localhost:3000/sse (the port comes from PORT; it is 4444 if PORT isn't set). Every request must send the API key, either as Authorization: Bearer or as X-API-Key: .
README
Показан фрагмент оригинального README. Открыть оригинал.
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
Quick start
You need Node.js 18 or newer and a WHM API token.
- Make a folder for the server and create a
.envfile in it:WHM_SERVER=your-server-domain.com WHM_PORT=2087 WHM_USERNAME=root WHM_API_TOKEN=your-whm-api-token # Only if WHM is reached by IP or uses a self-signed certificate: # WHM_INSECURE_TLS=true PORT=3000 # Required: the server refuses to start without it. Generate one with: openssl rand -hex 32 API_KEY=your-long-random-api-key - Start the MCP server from that folder:
Or clone this repository, runnpx whm-mcp-servernpm install, thennpm run mcp.
The MCP endpoint is http://localhost:3000/sse (the port comes from PORT; it is 4444 if PORT isn’t set).
MCP client configuration
Every request must send the API key, either as Authorization: Bearer or as X-API-Key: . Requests without it get 401 Unauthorized.
For clients that support remote servers with headers (for example Cursor), add this to mcp.json:
{
"mcpServers": {
"whm": {
"url": "https://your-mcp-host:3000/sse",
"headers": { "Authorization": "Bearer your-long-random-api-key" }
}
}
}
For clients that only run local commands (for example Claude Desktop), use the mcp-remote bridge:
{
"mcpServers": {
"whm": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://your-mcp-host:3000/sse", "--header", "Authorization: Bearer your-long-random-api-key"]
}
}
}
Run it behind HTTPS and a firewall: anyone with the key can manage the WHM server.
REST API (optional)
npm start runs a separate REST API (/api/..., see below), which also requires the API key, sent as an X-API-Key header.
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
/sseendpoint for establishing persistent connections - A
/messagesendpoint for receiving and responding to client requests - Proactive
connection/readyandtools/readynotifications - Standardized error handling with appropriate error codes
Установка
npx -y mcp-remote https://your-mcp-host:3000/sse --header Authorization: Bearer your-long-random-api-keyКонфигурация
{
"mcpServers": {
"whm": {
"url": "https://your-mcp-host:3000/sse",
"headers": { "Authorization": "Bearer your-long-random-api-key" }
}
}
}