cPanel MCP Server

cPanel MCP Server

A comprehensive MCP server for managing cPanel hosting accounts through AI assistants. It supports DNS, email (DKIM/SPF), databases, domains, SSL, PHP, cron jobs, security, Git deployment, and more.

Category
访问服务器

README

cPanel MCP Server

A comprehensive Model Context Protocol (MCP) server for managing cPanel hosting accounts through AI assistants. Connects directly to cPanel's UAPI and API2, enabling natural language management of web hosting — DNS, DNSSEC, email (with DKIM/SPF), databases, domains, SSL/AutoSSL, PHP, cron jobs, security (WAF, IP blocker, virus scanner, 2FA), Git deployment, Node.js/Python apps, and more.

Features

File Management

  • List, create, read, edit, and delete files in your hosting account

Disk Usage

  • Account quota info — check disk space consumption and limits

MySQL Database Management

  • Full CRUD for databases, users, and privileges
  • Server info — version and restriction details
  • Privilege management — grant/revoke per database

PostgreSQL Database Management

  • Full CRUD for databases, users, and privileges
  • Grant/revoke access per database

Email Management

  • Email accounts — create, delete, change password, set quotas, list with disk usage
  • Forwarders — create, list, and delete email forwarding rules
  • Autoresponders — create, list, and delete out-of-office / autoresponse messages
  • Email routing — view mail domain configuration

Email Authentication (DKIM/SPF)

  • DKIM — enable, disable, validate, and ensure keys exist for all domains
  • SPF — validate and install/update SPF records
  • PTR — validate reverse DNS records

Email Filters & Spam

  • Email filters — list, delete, and trace/test filters
  • SpamAssassin — enable/disable, configure spam box, get settings, clear spam
  • Greylisting — enable/disable for all domains

DNS Management

  • Get zone records for any domain (via API2 ZoneEdit)
  • Add, edit, and delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, CAA)

DNSSEC

  • Enable/disable DNSSEC for domains
  • DS records — fetch for registrar configuration
  • DNSKEY export — export zone keys
  • NSEC3 — enable/disable (prevents zone enumeration)

Domain Management

  • List all domains — main, addon, subdomains, and parked
  • Addon domains — create and delete
  • Subdomains — create and delete with custom document roots
  • Parked domains (aliases) — park and unpark
  • Redirects — create and delete URL redirects (301/302)

Cron Job Management

  • List, create, edit, and delete cron jobs (via API2)
  • Notification email — get and set the cron notification address

PHP Management

  • List installed PHP versions available on the server
  • Get/set PHP version per domain
  • PHP INI directives — read and modify (memory_limit, upload_max_filesize, etc.)

SSL/TLS Management

  • List certificates and SSL status per domain
  • Install and delete SSL certificates
  • Generate CSR for certificate requests
  • AutoSSL — check status and trigger renewal
  • List private keys

Security

  • IP Blocker — list, block, and unblock IP addresses/ranges
  • SSH Keys — list, import, delete, authorize, and deauthorize keys
  • Hotlink Protection — get status, enable with custom settings, disable
  • Directory Privacy — list protected directories and add users

ModSecurity (WAF)

  • Status — check if ModSecurity is installed, list domain status
  • Enable/disable globally or per domain

Two-Factor Authentication

  • Status — check if 2FA is configured
  • Setup — generate secret/QR code, enable with verification
  • Remove — disable 2FA

Virus Scanner (ClamAV) requires ClamAV plugin

  • Scan — start virus scan on a directory
  • Status — check scan progress
  • Results — list infected files, quarantine/disinfect

Metrics & Logs

  • Bandwidth usage statistics
  • Resource usage — CPU, memory, I/O, entry processes
  • Error logs — recent error entries
  • Visitor stats — per-domain access statistics
  • Account stats — summary of email accounts, databases, domains, disk, bandwidth

Backup Management

  • Full account backup to home directory
  • Partial backups — home directory, databases, and email separately
  • Restore — database and file restore from backup
  • List available backups

FTP Management

  • List FTP accounts with disk usage
  • Create and delete FTP accounts
  • Change password and quota
  • Active sessions — list and terminate
  • Server port info

Applications & Deployment

  • WordPress — list installations (requires WP Toolkit / Instance Manager)
  • Node.js/Python/Ruby apps — register, unregister, enable, disable, install dependencies (requires Phusion Passenger)
  • Git repositories — create, list, update, delete, and deploy via .cpanel.yml (requires Git Version Control feature)

Account Management

  • API tokens — list, create, rename, and revoke
  • Features — list available features, check if specific features are enabled
  • Account info — user information, server details

Installation and Configuration

Prerequisites

  • Node.js 18+
  • A cPanel account with API token access

Build

npm install
npm run build

Configure

Add the following to your MCP settings configuration (e.g., claude_desktop_config.json, cline_mcp_settings.json, or your IDE's MCP config):

{
  "mcpServers": {
    "cpanel": {
      "command": "node",
      "args": ["/path/to/cPanel-MCP-Server/build/index.js"],
      "env": {
        "CPANEL_USERNAME": "your_cpanel_username",
        "CPANEL_API_TOKEN": "your_cpanel_api_token",
        "CPANEL_SERVER_URL": "https://your-domain.com:2083"
      }
    }
  }
}

Replace the placeholder values with your actual cPanel credentials.

Environment Variables

Variable Required Default Description
CPANEL_USERNAME Yes cPanel account username
CPANEL_API_TOKEN Yes API token for authentication
CPANEL_SERVER_URL Yes cPanel server URL (e.g., https://example.com:2083)
CPANEL_TIMEOUT_MS No 30000 Request timeout in milliseconds
CPANEL_VERIFY_SSL No true Set to false to disable SSL certificate verification (for self-signed certs)

Getting a cPanel API Token

  1. Log in to cPanel
  2. Go to Security > Manage API Tokens
  3. Create a new token with a descriptive name
  4. Copy the token — it won't be shown again

Available Tools (164 total)

Category Count
File Management 5
Disk Usage 1
MySQL 9
PostgreSQL 8
Email (accounts, forwarders, autoresponders) 12
Email Authentication (DKIM/SPF/PTR) 7
Email Filters & Spam 12
DNS 4
DNSSEC 6
Domains (addon, sub, parked, redirects) 14
Cron Jobs 6
PHP 5
SSL/TLS & AutoSSL 8
Security (IP blocker, SSH, hotlink, privacy) 13
ModSecurity (WAF) 5
Two-Factor Auth 4
Virus Scanner (ClamAV) 4
Metrics & Logs 5
Backups 7
FTP 8
WordPress 1
Passenger Apps (Node.js/Python/Ruby) 6
Git Version Control & Deployment 6
API Tokens 4
Account & Server Info 4

Architecture

src/
├── index.ts           # MCP server entry point — registers all 25 tool modules
├── cpanel-api.ts      # cPanel API client (UAPI + API2, token auth, error handling)
└── tools/
    ├── files.ts           # File operations (Fileman)
    ├── disk.ts            # Disk usage (Quota, DiskUsage)
    ├── mysql.ts           # MySQL databases (Mysql)
    ├── postgresql.ts      # PostgreSQL databases (Postgresql)
    ├── email.ts           # Email accounts, forwarders, autoresponders (Email)
    ├── email-auth.ts      # DKIM, SPF, PTR validation (EmailAuth)
    ├── email-filters.ts   # Filters, SpamAssassin, Greylisting
    ├── dns.ts             # DNS zone records (DNS)
    ├── dnssec.ts          # DNSSEC management (DNSSEC)
    ├── domains.ts         # Domains, subdomains, redirects
    ├── cron.ts            # Cron jobs (API2 Cron)
    ├── php.ts             # PHP version & INI (LangPHP)
    ├── ssl.ts             # SSL/TLS & AutoSSL (SSL)
    ├── security.ts        # IP blocker, SSH, hotlink, privacy
    ├── modsecurity.ts     # ModSecurity WAF
    ├── twofa.ts           # Two-factor authentication
    ├── virus-scanner.ts   # ClamAV virus scanner
    ├── metrics.ts         # Bandwidth, resources, logs, stats
    ├── backups.ts         # Full & partial backups, restore
    ├── ftp.ts             # FTP accounts & sessions
    ├── wordpress.ts       # WordPress installations
    ├── passenger.ts       # Node.js/Python/Ruby apps
    ├── version-control.ts # Git repos & deployment
    ├── tokens.ts          # API token management
    └── features.ts        # Feature checks & server info

API Compatibility

  • UAPI (preferred) — used for most modules
  • API2 (legacy) — used where cPanel has no UAPI equivalent:
    • Cron jobsCron::fetchcron, add_line, edit_line, remove_line, get_email, set_email
    • DNS recordsZoneEdit::fetchzone_records, add_zone_record, edit_zone_record, remove_zone_record
    • SubdomainsSubDomain::listsubdomains, addsubdomain, delsubdomain
    • Addon domainsAddonDomain::listaddondomains, addaddondomain, deladdondomain
    • Parked domainsPark::listparkeddomains, park, unpark
    • IP blocking listDenyIp::listdenyips
  • Both API versions share the same authenticated client with retry logic and error handling

Security

Your cPanel credentials are loaded from environment variables at runtime and are never stored in the repository. The API token should be treated as a secret — do not commit it to version control.

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选