whm-mcp-server

whm-mcp-server

Enables AI assistants to manage WHM hosting accounts and server administration tasks including account management, server stats, updates, SSL, backups, and email through a secure API.

Category
访问服务器

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

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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选