hestiacp-mcp
<p>
<img src="https://raw.githubusercontent.com/webxtekstudio/hestiacp-mcp/main/docs/assets/icon.svg" alt="hestiacp-mcp logo" width="80" height="80" />
</p>
# @webxtekstudio/hestiacp-mcp
[](https://github.com/webxtekstudio/hestiacp-mcp/actions/workflows/ci.yml)
[](https://github.com/webxtekstudio/hestiacp-mcp/actions/workflows/platform-compat.yml)
[](https://www.npmjs.com/package/@webxtekstudio/hestiacp-mcp)
[](https://github.com/webxtekstudio/hestiacp-mcp/pkgs/container/hestiacp-mcp)
[](https://glama.ai/mcp/servers/webxtekstudio/hestiacp-mcp)
[](https://glama.ai/mcp/servers/webxtekstudio/hestiacp-mcp)
[](https://nodejs.org/)
[](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/LICENSE)
Clean-room TypeScript MCP (Model Context Protocol) server (`v1.3.0`) for **HestiaCP** (`1.10.10`) and **Linux host administration** over `stdio` (plus optional stateless Streamable HTTP via `--http`).
Fail-closed and read-only (`basic` mode) by default: zero shell interpolation, strict Zod validation, automatic secret redaction, human-in-the-loop confirmation for system/destructive actions, and multi-distro host intelligence across Debian and Ubuntu.
[](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/assets/demo.mp4)
<details>
<summary><strong>Watch Full HD Product Overview with voiceover and audio (inline player on GitHub)</strong></summary>
GitHub renders the inline player below; on npm or Glama, use the direct `demo.mp4` link.
https://github.com/user-attachments/assets/b4456321-277a-4663-9d5d-572689b5b28e
Direct file: [demo.mp4 (Full HD with voiceover)](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/assets/demo.mp4)
</details>
## Quick Start in 30 Seconds
**Requirements:** Node.js `>= 22.0.0` (or `ghcr.io/webxtekstudio/hestiacp-mcp:1.3.0`), plus OpenSSH (`ssh`) with key auth or HestiaCP REST API credentials.
```bash
npm install && npm run build
# Interactive TTY mode picker (1-4) or explicit --mode flag (stdout-only, zero secrets read or disk writes)
# --client accepts: claude | cursor | vscode | codex | antigravity | windsurf | generic
node dist/index.js init --client claude --transport ssh --toolsets ops
node dist/index.js init --mode pro --client claude --transport ssh --toolsets ops --non-interactive
# Generate a 100% literal sudoers drop-in tailored to your SSH target and mode
node dist/index.js doctor --print-sudoers --probe --mode pro
# Verify config, mode posture, catalog, knowledge guides, and security checks
node dist/index.js doctor --security --json
# Inspect and verify SHA-256 hash chain on persisted JSONL audit logs
node dist/index.js audit --tail 50
```
Omitting `--mode` in `hestiacp-mcp init` launches an interactive numbered TTY picker (`basic`, `medium`, `pro`, `ultra`) when running in a terminal, and fails closed with exit status `1` (printing the 4-mode table) in non-TTY, `--json`, or `--non-interactive` invocations. Registry installs via `server.json` mark `HESTIACP_MODE` as required (`isRequired: true`) with explicit mode choices.
Distributed on npm (`@webxtekstudio/hestiacp-mcp`), GHCR (`ghcr.io/webxtekstudio/hestiacp-mcp:1.3.0`), the [Official MCP Registry](https://registry.modelcontextprotocol.io/v0/servers?search=io.github.webxtekstudio%2Fhestiacp-mcp) (`server.json`, `io.github.webxtekstudio/hestiacp-mcp`), and indexed on [Glama](https://glama.ai/mcp/servers/webxtekstudio/hestiacp-mcp).
**One-Click IDE Install:** [Install in VS Code](https://vscode.dev/redirect/mcp/install?name=hestiacp-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40webxtekstudio%2Fhestiacp-mcp%22%5D%7D) | [Install in Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=hestiacp-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3ZWJ4dGVrc3R1ZGlvL2hlc3RpYWNwLW1jcCJdfQ==)
[](https://glama.ai/mcp/servers/webxtekstudio/hestiacp-mcp)
### Choose an Access Mode (`HESTIACP_MODE`)
| Mode | Tools | Policy Flags | Capabilities & Boundaries |
| :--- | :--- | :--- | :--- |
| `basic` **(safest default)** | `46` starter (`dynamic` default) / `105` (`all`) | Read-only (`allowWrite=false`, `allowSystem=false`, `allowDestructive=false`) | Auditing, SRE diagnostics, port exposure, upgrade impact plan, guided hardening advisor; zero mutations |
| `medium` | `159` | `allowWrite=true` | `basic` + safe daily hosting writes (web, mail, DNS, DB, FastCGI cache, quarantine, SSL, backups); excludes system & permanent deletions |
| `pro` **(recommended for sysadmins)** | `202` | `allowWrite=true`, `allowSystem=true` | `medium` + SRE system control, guided hardening apply, profile firewall with anti-lockout, sysctl hardening, and toolkit lifecycle with human confirmation; excludes irreversible `delete_*` & Ultra OS ops |
| `ultra` | `228` | `allowWrite=true`, `allowSystem=true`, `allowDestructive=true` | Full unrestricted lifecycle including permanent account/domain/mail/DB/backup deletions (`hestia_backup_retention_apply`), safe non-interactive APT security upgrades, and bounded bulk cleanup, guarded by Zod, `dry_run`, and confirmation |
### Choose a Context Budget (`HESTIACP_TOOLSETS`)
| Preset | Tools (Read-Only / `basic`) | Best For |
| :--- | :--- | :--- |
| `dynamic` **(default in `basic`)** | `45` + `hestia_manage_toolsets` (`46` total, toggles up to `106`) | Lean starter context (`core`, `knowledge`) that toggles non-mutation toolsets at runtime |
| `ops` **(recommended static preset)** | `93` | Everyday SRE, diagnostics, forensics, ServerOps, host intelligence, upgrades, guides |
| `minimal` | `45` | Static lean LLM context budgets (`core` HestiaCP read tools, `knowledge`, and 4 meta-tools) |
| `all` **(default in `medium`+)** | `105` (`159` `medium`, `202` `pro`, `228` `ultra`) | Full surface including companion `toolkit` wrappers (`webxtekstudio/hestiacp-toolkit`) & `wordpress` addon |
When `HESTIACP_TOOLSETS` is unset, `basic` defaults to `dynamic` (`46` starter tools) and `medium`/`pro`/`ultra` default to `all`. Set `HESTIACP_TOOLSETS=all`, `ops`, or `minimal` explicitly to override the default preset.
## Compatible MCP Clients
| Client / Agent | Transport / Format | Quick Config Generator / Install |
| :--- | :--- | :--- |
| **Claude Desktop & Claude Code** | `stdio` (`mcpServers` JSON) | `npx -y @webxtekstudio/hestiacp-mcp init --client claude` |
| **Cursor** | `stdio` (`.cursor/mcp.json`) | [One-Click Install](cursor://anysphere.cursor-deeplink/mcp/install?name=hestiacp-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB3ZWJ4dGVrc3R1ZGlvL2hlc3RpYWNwLW1jcCJdfQ==) / `init --client cursor` |
| **VS Code & GitHub Copilot** | `stdio` (`.vscode/mcp.json`) | [One-Click Install](https://vscode.dev/redirect/mcp/install?name=hestiacp-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40webxtekstudio%2Fhestiacp-mcp%22%5D%7D) / `init --client vscode` |
| **OpenAI Codex CLI** | `stdio` (`~/.codex/config.toml`) | `npx -y @webxtekstudio/hestiacp-mcp init --client codex` |
| **Antigravity & Windsurf** | `stdio` or Streamable HTTP (`--http`) | `npx -y @webxtekstudio/hestiacp-mcp init --client antigravity` (or `--client windsurf`) |
| **Gemini CLI, Trae, Cline, Roo Code & Zed** | `stdio` or Streamable HTTP (`--http`) | `npx -y @webxtekstudio/hestiacp-mcp init --client generic` |
Any client implementing the Model Context Protocol over `stdio` or stateless Streamable HTTP (`--http`) works out of the box.
## What You Get
- **Multi-Server Fleet Control (`HESTIACP_SERVERS_FILE`) & RBAC Scoping:** Manage up to `64` isolated SSH and REST API targets from a single MCP connection, with independent per-target `policy.mode` (`basic`/`medium`/`pro`/`ultra`), user/domain RBAC scoping (`HESTIACP_ALLOWED_USERS`, `HESTIACP_DENIED_USERS`, `HESTIACP_ALLOWED_DOMAINS`, `HESTIACP_PROTECT_ADMIN`), SSH keys, `advisor.acceptedChecks`, and fleet-wide `hestia_fleet_health_matrix` auditing (see [Multi-Server Profiles](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/multi-server-and-overlays.md#multi-server-profiles-hestiacp_servers_file)).
- **526-Command Catalog + Curated Tools (`core` + meta-tools):** 40 curated read-only tools and 91 full-lifecycle mutation wrappers (`131` curated tools total) across users (`2FA`, SSH keys, SFTP jail), web, PHP versions (`hestia_manage_web_php`, `hestia_change_sys_php`), webmail clients (`hestia_manage_webmail_client`, `hestia_set_pma_sso`), panel upgrades (`hestia_update_sys_hestia_all`), FastCGI cache, FTP, SSL, DNS (`DNSSEC`, cluster sync), mail (webmail/forwards/autoreply/catchall/DKIM), databases, cron, and classic/Restic backups (`backup_hosts`, exclusions, per-domain/DB restores, blast-radius `dryRun`), plus `hestia_search_commands`, `hestia_describe_command`, `hestia_run_read`, `hestia_get_capabilities`, and `hestia_manage_toolsets` (`dynamic` mode).
- **Host Intelligence & Guided Hardening (`host`, `diagnostics`, `forensics`):** Probes target OS (`Debian 12/13`, `Ubuntu 22.04/24.04/26.04`), `sudo` vs `sudo-rs`, GNU vs `uutils` coreutils, mail/DB stack, and 39 binaries once per session. Includes `hestia_guided_hardening_plan` (3-phase profile-driven plan for `public_hosting`, `cloudflare_origin`, `wordpress_agency`, `web_only_no_mail`, `private_panel`), `hestia_host_hardening_advisor` (`HX-*` risk scoring including `HX-WEB-007`, `acceptedChecks`, 2-way remediations), `hestia_host_access_inventory`, `hestia_host_tuning_advisor`, `hestia_host_hygiene_audit`, `hestia_docroot_exposure_scan`, `hestia_backup_freshness`, `hestia_backup_archive_inspect`, `hestia_web_template_audit`, `hestia_php_error_digest`, and `systemd-analyze security`.
- **Linux Host Control Plane (`host`):** 11 read-only SSH inspection/advisor tools plus 11 opt-in control tools (`service_control`, `ids_ban_control`, `exim_queue_control`, `maintenance_cleanup`, `quarantine_docroot_artifacts`, `host_hygiene_cleanup`, `guided_hardening_apply`, `apply_profile_firewall`, `host_sysctl_apply`, plus Ultra-only `ultra_apt_security_upgrade` and `ultra_bulk_cleanup`).
- **Diagnostics, Forensics & SRE (`diagnostics`, `forensics`, `serverops`):** 34 read-only tools including `hestia_port_exposure_audit` (live `ss -tuln` + IPv6/nftables vs HestiaCP firewall cross-check by security profile), bucketed (`50|100|200|500`) log tailing/fixed-string search, cross-log correlation, Exim4 & Postfix mail queues, CrowdSec/Fail2Ban, PHP-FPM/MariaDB/PostgreSQL health (`hestia_postgres_health`, `hestia_db_size_breakdown`, `hestia_php_fpm_pool_config`), metadata-only threat hunting and WordPress audits, `hestia_http_security_audit`, `hestia_vhost_http_probe`, `hestia_disk_usage_breakdown`, `hestia_dns_alignment_audit`, `hestia_host_scorecard`, `hestia_ops_snapshot` (v2), `hestia_ops_diff`, and `hestia_fleet_health_matrix`.
- **Protocol v1.0, MCP Apps UI & Knowledge:** 35 typed `outputSchema` definitions, MCP Tasks (`tasks/create`, `tasks/get`, `tasks/list`, `tasks/result`, `tasks/cancel` with `execution.taskSupport: "optional"` on 27 long-running tools), RFC 5424 Logging (`logging/setLevel`), 3 sandboxed SEP-1865 `ui://` MCP Apps (Scorecard, Hardening Advisor, Fleet Matrix), `hestia_get_guide`, 22 static MCP Resources (`19` core/guides + `3` MCP Apps) + `hestia://knowledge/{topic}` template with `completion/complete`, `notifications/progress`, and 13 Prompts (including `hestia_guided_hardening_wizard`).
- **Optional Addons (`toolkit`, `wordpress`, `upgrade`, `overlay`):** Auto-detects and manages [webxtekstudio/hestiacp-toolkit](https://github.com/webxtekstudio/hestiacp-toolkit) over SSH (`hestia_toolkit_manage` in `pro`+ with pinned repository URL), adds WordPress site inspection/xmlrpc/salt rotation (`wordpress`), checks upgrades & pre-upgrade package risk (`upgrade`: `hestia_upgrade_check`, `hestia_upgrade_verify_post`, `hestia_upgrade_impact_plan`), and mounts private scripts/status files (`HESTIACP_OVERLAY_DIR`).
## Architecture, Modes & Security Flows
### Access Modes & Risk Tiers

### End-to-End Architecture & Transports

### Fail-Closed Execution & Approval Flow

## Transport Configuration
### Option A: OpenSSH (`HESTIACP_SSH_EXEC_MODE=sudo` recommended)
```json
{
"mcpServers": {
"hestiacp": {
"command": "npx",
"args": ["-y", "@webxtekstudio/hestiacp-mcp"],
"env": {
"HESTIACP_MODE": "basic",
"HESTIACP_TRANSPORT": "ssh",
"HESTIACP_SSH_HOST": "203.0.113.10",
"HESTIACP_SSH_USER": "hestia-mcp",
"HESTIACP_SSH_EXEC_MODE": "sudo",
"HESTIACP_SSH_STRICT_HOST_KEY_CHECKING": "yes",
"HESTIACP_SSH_PRIVATE_KEY_PATH": "/etc/hestiacp-mcp/keys/id_ed25519",
"HESTIACP_SSH_KNOWN_HOSTS_PATH": "/etc/hestiacp-mcp/known_hosts",
"HESTIACP_TOOLSETS": "ops"
}
}
}
}
```
### Option B: HestiaCP REST API
```bash
export HESTIACP_MODE=basic
export HESTIACP_TRANSPORT=api
export HESTIACP_API_URL=https://panel.example.com:8083
export HESTIACP_ACCESS_KEY=your_access_key
export HESTIACP_SECRET_KEY=your_secret_key
export HESTIACP_TOOLSETS=ops
```
### Option C: Optional Stateless Streamable HTTP (`--http`) & Docker
Use `--http` (or `HESTIACP_HTTP_ENABLED=true`) for local HTTP clients; requires `HESTIACP_HTTP_AUTH_TOKEN` (`>= 32` chars), binds `127.0.0.1:3100`, validates `Host`/`Origin`, and exposes `GET /healthz`:
```bash
export HESTIACP_MODE=basic
export HESTIACP_HTTP_ENABLED=true
export HESTIACP_HTTP_AUTH_TOKEN="$(openssl rand -hex 32)"
node dist/index.js --http
# Or run the OCI image with read-only mounted SSH material
docker run --rm -i \
-e HESTIACP_MODE=basic \
-e HESTIACP_TRANSPORT=ssh -e HESTIACP_SSH_HOST=203.0.113.10 -e HESTIACP_SSH_USER=hestia-mcp \
-e HESTIACP_SSH_EXEC_MODE=sudo -e HESTIACP_SSH_PRIVATE_KEY_PATH=/keys/id_ed25519 \
-e HESTIACP_SSH_KNOWN_HOSTS_PATH=/keys/known_hosts \
-v /etc/hestiacp-mcp/keys:/keys:ro ghcr.io/webxtekstudio/hestiacp-mcp:1.3.0
```
## Security Posture (Fail-Closed by Default)
- **Read-only (`basic` mode) by default:** `HESTIACP_MODE` defaults to `basic` (`allowWrite=false`, `allowSystem=false`, `allowDestructive=false`). Set `HESTIACP_REQUIRE_MODE=true` to reject startups without an explicit mode, and note the fail-closed conflict guard rejects startup whenever `HESTIACP_MODE` conflicts with explicit `HESTIACP_ALLOW_*` flags. Mutations also require `mutations` in `HESTIACP_TOOLSETS`, and `dynamic` mode never enables unapproved mutations.
- **Human confirmation for high risk:** `system` (`pro`) and `destructive` (`ultra`) tools enforce MCP form elicitation (`elicitation/create`) or opt-in 2-step single-use HMAC `confirmationToken` (`HESTIACP_ALLOW_NON_INTERACTIVE_CONFIRM=true`), plus `dryRun` / `dry_run` previews, `confirm: true` enforcement, anti-lockout firewall guards, and syntax pre-flight checks.
- **No shell injection or secret leaks:** SSH uses `execFile(..., { shell: false })` with POSIX single-quoting, 15 auth/raw-fs commands are blocked, SSL private keys and `MD5` hashes are redacted, remote output uses `[UNTRUSTED DATA]` framing, `ui://` MCP Apps enforce empty CSP + zero `innerHTML`, and decisions log to `HESTIACP_AUDIT_LOG` (`O_NOFOLLOW`, `0600`, SHA-256 hash chain).
## Documentation
- [Tools, Resources & Prompts Reference](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/tools-reference.md): Full tool inventory, protocol v1.0, MCP Apps, and surface counts (`45` / `46` / `93` / `105` / `159` / `202` / `228`).
- [Platform Compatibility Matrix](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/platform-compatibility.md): HestiaCP `1.10.10` 5-distro matrix (`Debian 12/13`, `Ubuntu 22.04/24.04/26.04`), `sudo-rs`, `uutils`, Postfix, PostgreSQL.
- [Security & Least-Privilege Sudoers Guide](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/security-and-sudoers.md): Access modes, policy gates, Streamable HTTP auth, MCP Apps CSP, `doctor --print-sudoers --mode`, literal sudoers.
- [Multi-Server Profiles & Overlays](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/multi-server-and-overlays.md): Environment variables (`HESTIACP_MODE`, `HESTIACP_REQUIRE_MODE`, RBAC scoping), `HESTIACP_SERVERS_FILE`, `advisor.acceptedChecks`, `HESTIACP_OVERLAY_DIR`.
- [Troubleshooting Guide](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/troubleshooting.md): Diagnostics for `ELICITATION_REQUIRED`, `UNVERIFIED_VERSION`, `SUDO_LITERAL_UNSUPPORTED`, `SCOPE_DENIED`, Windows/Docker `known_hosts`, and `--http`.
- [Migration Guide](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/docs/migration.md): Upgrading from v1.0/v1.1 and v1.2 to v1.3.0 (`dynamic` basic default, shared `--http` runtime, RBAC scoping, audit CLI).
- [Contributing Guide](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/CONTRIBUTING.md), [Security Policy](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/SECURITY.md), and [Configuration Examples](https://github.com/webxtekstudio/hestiacp-mcp/blob/main/examples/README.md).
## Development & Verification
```bash
npm run typecheck && npm run lint && npm test && npm run build && npm run check:knowledge
npm run check:catalog -- --hestia-root /path/to/hestiacp
```
## License
MIT
TDQS
Scored across 46 tools
Each list/get tool targets a distinct HestiaCP resource and the descriptions explicitly cross-reference sibling tools ('prefer hestia_get_user for...'), which makes boundaries unusually clear for a 46-tool set. The main ambiguity is the generic hestia_run_read, which can execute any read command and therefore overlaps every specific wrapper, plus the dense firewall/backup families that require reading the 'prefer X' notes to pick correctly.
Every tool uses the same hestia_ prefix followed by a consistent snake_case verb_noun pattern (list_*, get_*, search_commands, describe_command, run_read, manage_toolsets). Minor awkwardness like hestia_list_sys_hestia_updates does not break the convention.
46 tools is heavy and sits in the 'too many' band, even allowing for the breadth of the HestiaCP domain (users, web, DNS, mail, DB, backups, firewall, system). Much of the count is single-command v-list wrappers that could be consolidated, and the presence of hestia_search_commands/describe_command/run_read makes many specific wrappers arguably redundant.
Read/audit coverage is broad and near-complete across every HestiaCP subsystem, with catalog search/describe as a discovery backstop. However the entire mutation surface (create/update/delete for users, domains, mailboxes, DNS records, databases, cron, firewall) is absent by fail-closed policy, so agents attempting any administration task will dead-end.