Skip to content
Back to search

cpanel-mcp

Zero-dependency universal MCP & OpenAPI server for cPanel hosting — works with ChatGPT, Claude, Gemini CLI, Cursor & Copilot without SSH

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/mobinbiback--cpanel-mcp/badge.svg)](/listings/mobinbiback--cpanel-mcp)

HTML

<a href="/listings/mobinbiback--cpanel-mcp"><img src="/api/listings/mobinbiback--cpanel-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 150 lines
  1. # cpanel-mcp (Universal Edition)
  2. > **Zero-Dependency Local MCP & OpenAPI Server for cPanel Hosting**
  3. > Connect **ChatGPT (Web & Desktop)**, **Claude (Desktop & Code)**, **Gemini CLI**, **Cursor**, **VS Code Copilot**, or **Local LLMs (LM Studio / Ollama)** directly to your cPanel hosting—**without SSH**, **without uploading PHP backdoors**, and **without `npm install`**.
  4. 🌐 **[راهنمای کامل فارسی (Persian Guide)](README.fa.md)**
  5. ---
  6. ## Why `cpanel-mcp`?
  7. - **Universal AI Support:** Works natively over **MCP (`stdio` & HTTP)** and **OpenAPI 3.1** (for ChatGPT Custom GPT Actions).
  8. - **Zero Dependencies (`0` packages):** Built strictly with Node.js built-in modules (`node:http`, `node:crypto`, `node:fs`, `node:readline`, native `fetch`). Never gets stuck on `npm install` or `ECONNRESET`.
  9. - **Works on Any Shared cPanel Hosting:** Connects from your machine directly to cPanel's encrypted **UAPI** on port `2083` using a revocable **API Token** (no SSH required).
  10. - **100% Private & Local:** Your credentials stay on your computer (`config.json` is git-ignored). Nothing is uploaded to your public web root.
  11. - **Built-in Safety Guardrails:**
  12. - **Path Jail (`ALLOWED_ROOT`):** Blocks directory traversal outside your configured root folder.
  13. - **Automatic Backups:** Every `write_file` call snapshots the previous version into `.claude_backups/` before saving.
  14. - **Sensitive File Protection:** Configurable `BLOCKED_FILES` list (`.env`, `wp-config.php`, etc.).
  15. ---
  16. ## Included Tools (10 Capabilities)
  17. | Tool | Description |
  18. | :--- | :--- |
  19. | `list_files` | List files & directories (including dotfiles, permissions, and human-readable sizes) |
  20. | `read_file` | Read the full content of any text/code/config file |
  21. | `write_file` | Create or update files with automatic `.claude_backups` versioning |
  22. | `create_folder` | Create new directories |
  23. | `delete_item` | Move items to cPanel Trash (default) or permanently delete |
  24. | `rename_or_move` | Rename, move, or copy files and folders |
  25. | `chmod_item` | Change file/folder permissions (`0644`, `0755`, etc.) |
  26. | `zip_items` | Compress files/folders into a `.zip` archive directly on the server |
  27. | `unzip_item` | Extract `.zip` archives directly on the server |
  28. | `cpanel_uapi` | Call any official cPanel UAPI module (`Mysql`, `Cron`, `SSL`, `SubDomain`, `Email`) |
  29. ---
  30. ## Step 1: Get Your cPanel Credentials & API Token
  31. 1. Log in to your **cPanel** dashboard.
  32. 2. In the right-hand **General Information** panel, note down **Current User** and **Home Directory**.
  33. 3. Copy your **direct server hostname** on port `2083` from the browser address bar (e.g., `https://server12.yourhost.com:2083`).
  34. > **Important:** Do **not** use your domain name if it is proxied through **Cloudflare**, because Cloudflare blocks port `2083` and causes connection timeouts.
  35. 4. Go to **Security → Manage API Tokens**, create a new token, and copy it.
  36. ---
  37. ## Step 2: Configure `config.json`
  38. Copy `config.example.json` to `config.json` and fill in your credentials:
  39. ```json
  40. {
  41. "CPANEL_HOST": "https://server12.yourhost.com:2083",
  42. "CPANEL_USER": "myuser",
  43. "CPANEL_TOKEN": "YOUR_CPANEL_API_TOKEN",
  44. "ALLOWED_ROOT": "/home/myuser/public_html",
  45. "BLOCKED_FILES": [
  46. ".env",
  47. "wp-config.php",
  48. "config.php",
  49. ".htaccess"
  50. ],
  51. "ALLOW_INSECURE_SSL": false,
  52. "HTTP_PORT": 3000,
  53. "HTTP_API_KEY": "CHANGE_THIS_TO_A_RANDOM_SECRET_KEY"
  54. }
  55. ```
  56. > **Tip for Full Hosting Access:** Set `"ALLOWED_ROOT": "/home/myuser"` and `"BLOCKED_FILES": []` if you want the AI to manage all domains/subdomains and edit `.htaccess` or `.env` files.
  57. ---
  58. ## Step 3: Connect to Any AI Client
  59. > **Prerequisite:** [Node.js](https://nodejs.org/) v18 or higher (`node -v`).
  60. ### 1. ChatGPT Web (`chatgpt.com` Custom GPTs)
  61. `cpanel-mcp` includes a built-in OpenAPI 3.1 HTTP server (`--http`) with Bearer token authentication:
  62. 1. Start the local HTTP bridge in CMD / Terminal:
  63. ```cmd
  64. node C:\mcp\cpanel-mcp\index.js --http
  65. ```
  66. *(Copy the printed `Bearer Token` or set your own `HTTP_API_KEY` in `config.json`.)*
  67. 2. Expose port `3000` securely using **Cloudflare Tunnel** (free, no account needed):
  68. ```cmd
  69. cloudflared tunnel --url http://localhost:3000
  70. ```
  71. 3. In **ChatGPT (`chatgpt.com`)**, go to **Explore GPTs → Create → Configure**:
  72. - Paste the contents of `skill/SKILL.md` into **Instructions**.
  73. - Click **Create new action → Import from URL** and enter `<YOUR_TRYCLOUDFLARE_URL>/openapi.json`.
  74. - Under **Authentication**, choose **API Key → Bearer** and paste your `Bearer Token`.
  75. ### 2. OpenAI Codex CLI & ChatGPT Desktop
  76. Register `cpanel-mcp` as a local `stdio` MCP server:
  77. ```cmd
  78. codex mcp add cpanel -- node C:\mcp\cpanel-mcp\index.js
  79. ```
  80. ### 3. Claude Desktop (Free Account)
  81. 1. **Install Claude Desktop via Windows CMD** (if not installed):
  82. ```cmd
  83. curl -L "https://claude.ai/api/desktop/win32/x64/exe/latest/redirect" -o "%USERPROFILE%\Downloads\Claude-Setup-x64.exe"
  84. start "" "%USERPROFILE%\Downloads\Claude-Setup-x64.exe"
  85. ```
  86. *(Or via `winget install -e --id Anthropic.Claude`)*
  87. 2. Run **`install.bat`** (Windows) or `./install.sh` (macOS/Linux).
  88. 3. Fully quit Claude Desktop from the **System Tray** (`Quit`) and reopen it.
  89. ### 4. Gemini CLI (Free with Google Account)
  90. ```cmd
  91. npm install -g @google/gemini-cli
  92. gemini mcp add cpanel node C:\mcp\cpanel-mcp\index.js
  93. gemini
  94. ```
  95. ### 5. Cursor, Windsurf, VS Code Copilot & LM Studio
  96. Add this snippet to your editor's MCP configuration (`mcp.json` / `cline_mcp_settings.json` / LM Studio `mcp.json`):
  97. ```json
  98. {
  99. "mcpServers": {
  100. "cpanel": {
  101. "command": "node",
  102. "args": ["C:\\mcp\\cpanel-mcp\\index.js"]
  103. }
  104. }
  105. }
  106. ```
  107. ### 6. Claude Code CLI (Requires Pro/Max Plan or API Key)
  108. ```cmd
  109. powershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://claude.ai/install.ps1 | iex"
  110. set "PATH=%USERPROFILE%\.local\bin;%APPDATA%\npm;%PATH%"
  111. claude mcp add --scope user cpanel -- node C:\mcp\cpanel-mcp\index.js
  112. claude
  113. ```
  114. ---
  115. ## Troubleshooting
  116. * **`fetch failed` or `ConnectTimeoutError` on port `2083`:**
  117. 1. Replace any Cloudflare-proxied domain in `CPANEL_HOST` with your direct server hostname.
  118. 2. Toggle your **VPN** on/off (some hosts restrict port `2083` by IP region) and run `node test-connection.js`.
  119. * **SSL Certificate Error on port `2083`:** Set `"ALLOW_INSECURE_SSL": true` in `config.json`.
  120. * **Claude Desktop doesn't see `cpanel` tools:** Make sure you are in the desktop app (not `claude.ai` in the browser), end all Claude processes in **Task Manager**, and check **`☰` → File → Settings → Developer → Edit Config**.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.