Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HTB_TOKENNoHack The Box App Token. Required unless a session cookie is supplied.
HTB_VPN_DIRNoDirectory for downloaded profiles, PID files, and logs.~/.config/htb-mcp/vpn
HTB_LABS_URLNoAPI host; useful for mocks/proxies.https://labs.hackthebox.com
HTB_TIMEOUT_MSNoPer-request timeout in milliseconds.30000
HTB_MAX_RETRIESNoRetries for GET/429 responses.2
HTB_OPENVPN_BINNoOpenVPN executable.openvpn
HTB_SESSION_COOKIENoOptional browser cookie for endpoints that reject token auth; supply the whole Cookie header from an app.hackthebox.com request. Can be used as an alternative to HTB_TOKEN.
HTB_OPENVPN_USE_SUDONoPrefix OpenVPN with sudo -n when not root.1

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Unofficial Hack The Box MCP server. Start with htb_status to confirm authentication and see active resources. Machine spawn/reset/stop, VPN switching, and flag submission change real account state. Switching VPN servers can terminate an active machine; ask before forcing it. Never print App Tokens or OpenVPN private keys.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
htb_statusA

Check authentication, account summary, active machine (IP/expiry), and current VPN assignments. Start here when something fails.

htb_list_machinesB

Search and filter machines by state, difficulty, OS, name, free/VIP, and completion. Returns compact machine summaries with pagination metadata.

htb_get_machineA

Get a machine's profile by name or ID, including OS, difficulty, points, ownership, maker, and active play info.

htb_launch_machineA

Spawn an active or retired machine and wait for its IP. If another machine is active, set replace=true to terminate it first. HTB limits machine actions to roughly one per minute.

htb_stop_machineA

Terminate the currently active machine. Optionally verify a target first. This ends the machine session immediately.

htb_reset_machineA

Request a reset of the active machine. HTB applies a cooldown between machine actions; the reset can take a minute.

htb_extend_machineA

Extend the active machine's lifetime by 24 hours. Returns HTB's new expiration date.

htb_vpn_serversB

List available VPN servers, client counts, full status, and the server currently assigned to each HTB product.

htb_vpn_switchA

Assign your account to another VPN server. HTB may terminate an active machine when the server changes, so this tool refuses unless force=true. Prefer htb_vpn_resolve for automatic least-busy selection.

htb_vpn_resolveA

Pick the least-busy server (or use server_id), switch if needed, download the OpenVPN profile, resolve its remote hostname, and optionally connect. Blocks switching while a machine is active unless force=true. Does not connect unless connect=true.

htb_vpn_downloadA

Download the OpenVPN profile for the assigned server (or server_id) without auto-selecting a new server. Returns only the local path and endpoint metadata, never the private key.

htb_vpn_connectA

Start OpenVPN using a profile in the configured VPN directory. If config_path is omitted, the assigned profile is downloaded first. Uses sudo -n when not root; it never prompts for a password.

htb_vpn_disconnectA

Stop the OpenVPN process started by this server. With no PID file, stops all HTB OpenVPN processes managed by this server.

htb_vpn_statusA

Show HTB-side VPN connections plus local OpenVPN processes, profiles, and PID state.

htb_submit_flagA

Submit a machine or challenge flag. For machines, target defaults to the active machine. Returns HTB's acceptance message, points, and ownership state.

htb_list_challengesC

Search and filter HTB challenges by state, difficulty, category, name, and completion.

htb_get_challengeA

Get challenge details by ID or slug, including category, difficulty, description, docker status, and solve state.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.6/5.0

Scored across 17 tools

Disambiguation4/5

Machine and challenge tools are cleanly separated by resource+action (list/get/launch/stop/reset/extend), so those are easy to choose between. The VPN cluster has layered overlap: htb_vpn_resolve internally performs switch+download+connect, which can be confused with htb_vpn_switch, htb_vpn_download, and htb_vpn_connect, though descriptions explicitly disambiguate the preferred tool.

Naming Consistency4/5

Names follow a predictable htb_verb_noun pattern with a consistent htb_vpn_ namespace for the VPN subgroup. The only deviation is htb_status, which omits a verb, but it remains readable and snake_case throughout.

Tool Count4/5

Seventeen tools is slightly on the heavy side but justified by covering three distinct areas (machines, VPN lifecycle, challenges/flags). Each tool maps to a real operation rather than redundant wrappers.

Completeness4/5

Machine lifecycle (list/get/launch/stop/reset/extend), VPN setup/teardown, and flag submission are fully covered. Challenge support is thinner (only list/get, no docker start/spawn or dedicated challenge workflow), a minor gap an agent can work around.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues