← Back to directory
K

Kastell

Community
Your infrastructure, fortified.
GitHub source repository ↗
★ 58 Stars Category · Dev Tools Popular Source revision 2d77c613f4b6
65FMRS · C
Reliability
8/20
Security and permissions
17/20
Maintenance
13/20
Documentation
14/20
Setup experience
13/20

Kastell is a powerful MCP server for managing self-hosted servers via CLI or AI agents, offering extensive security audits, hardening, and cloud provider integration. It is well-tested (over 11,000 tests) and has a strong focus on security. However, it requires cloud provider API tokens and SSH access. It is best suited for developers and DevOps teams comfortable with Linux server management.

Read the FMRS scoring method →

Kastell is an all-in-one CLI and MCP server for provisioning, securing, backing up, and managing self-hosted servers. It provides comprehensive security audits (449 checks), hardening (24-step), firewall management, auto-fix, monitoring, and supports deployment on Hetzner, DigitalOcean, Vultr, and Linode. It includes a built-in MCP server, allowing AI agents like Claude to manage servers directly.

Tools

server_info
Query server information, check cloud provider and platform status.
server_logs
Fetch platform/Docker logs and system metrics via SSH.
server_manage
Register, unregister, or destroy cloud servers.
server_maintain
Update platform, restart servers, run full maintenance.
server_secure
SSH hardening, firewall rules, domain/SSL management (10 subcommands).
server_backup
Backup/restore databases and create/manage VPS snapshots.
server_provision
Provision new servers on cloud providers.
server_audit
449-check security audit with compliance framework filtering; use --explain for remediation guidance.
server_evidence
Collect forensic evidence package with checksums.
server_guard
Manage autonomous security monitoring daemon.
server_doctor
Proactive health analysis with remediation commands.
server_lock
24-step production hardening (SSH, UFW, sysctl, auditd, AIDE, Docker).
server_fleet
Fleet-wide health and security posture dashboard.
server_fix
Apply safe auto-fixes with backup (SAFE tier only, dryRun default).

Setup

To install the Kastell MCP server:

  1. Ensure Node.js 20 or later is installed.
  2. Add the following configuration to your MCP client config (e.g., .mcp.json for Claude Code, .cursor/mcp.json for Cursor):
{
  "mcpServers": {
    "kastell": {
      "command": "npx",
      "args": ["-y", "-p", "kastell", "kastell-mcp"],
      "env": {
        "HETZNER_TOKEN": "your-token",
        "DIGITALOCEAN_TOKEN": "your-token",
        "VULTR_TOKEN": "your-token",
        "LINODE_TOKEN": "your-token"
      }
    }
  }
}
  1. Optionally, set provider API tokens in environment variables. Certain operations (like provision, destroy, restore) are blocked by default in safe mode; set KASTELL_SAFE_MODE=false to enable them.
claude_desktop_config.json
{
  "mcpServers": {
    "kastell": {
      "command": "npx",
      "args": [
        "-y",
        "-p",
        "kastell",
        "kastell-mcp"
      ],
      "env": {
        "HETZNER_TOKEN": "your-token",
        "DIGITALOCEAN_TOKEN": "your-token",
        "VULTR_TOKEN": "your-token",
        "LINODE_TOKEN": "your-token"
      }
    }
  }
}

Fit and risk

Best for

  • Developers and DevOps teams looking to manage self-hosted infrastructure via CLI or AI agents
  • Users who want to streamline server provisioning and hardening across multiple cloud providers
  • Teams that want to integrate security audits into CI/CD pipelines

Not for

  • People without SSH access or who do not need cloud provider integrations
  • Users who require a GUI or managed service rather than a CLI
  • Those who need macOS/BSD support (Linux only platform)
  • Those who need full Windows native support (manages Linux servers only via SSH)

Required permissions

  • Requires access to cloud provider API tokens (Hetzner, DigitalOcean, Vultr, Linode)
  • Requires SSH access to target servers to perform audits, hardening, and maintenance
  • Can create SSH keys and configuration files on the local machine
  • Can execute destructive operations on servers (if enabled)

Risks and side effects

  • Destructive operations (destroy, restore, snapshot-delete, provision, restart, maintain, snapshot-create) are blocked in default safe mode; if enabled, risk of data loss
  • API tokens are sensitive; ensure they are stored securely
  • SSH connections may be intercepted; use strict host key verification
  • Automated operations may inadvertently change server configurations
  • Misuse could lead to service disruption or security vulnerabilities

Troubleshooting

  1. If server creation fails, run `kastell doctor --check-tokens` to verify API tokens and environment
  2. If server is unresponsive, try `kastell status my-server --autostart` or `kastell health`
  3. If commands fail on a server, check SSH credentials and host keys
  4. Ensure correct API tokens are set for the desired provider
  5. Check KASTELL_SAFE_MODE setting to ensure destructive operations are allowed or blocked as expected

Use cases

Provision and deploy new servers on cloud providers
Perform full security audits and hardening on existing servers
Backup and restore databases and configurations
Manage fleets of servers and run maintenance
Automate server management via AI agents

Supported clients

Claude CodeFull support
CursorFull support
WindsurfFull support