Skip to main content
Glama

hacktricks-mcp

MCP server that gives AI agents fast, offline full-text search and section-level retrieval over two HackTricks books: the HackTricks offensive-security wiki (network services, web, Linux, Windows and macOS hardening, Active Directory, mobile, reverse engineering, forensics, Wi-Fi) and HackTricks Cloud (AWS, GCP, Azure, Kubernetes, CI/CD). It also checks cloud permissions against HackTricks Cloud's rated lists and escalation catalog: how dangerous a permission is, what it lets a principal escalate to, and where to read about it.

Unlike grep-based alternatives, this server ships with a pre-built SQLite FTS5 search index (about 2,950 pages) inside the package. No install-time clone, no ripgrep dependency, and no network access at any query. A GitHub Action re-syncs the index with upstream every 3 days and publishes a patch release to npm, so an unpinned install picks up each new index on its next launch. A running server also checks for a newer index in the background and switches to it when there is one, falling back to the bundled index whenever that fails (offline included).

What a read costs

Pages are long, so the tools return the part that answers. Tokens are as the o200k_base tokenizer counts them (other tokenizers differ by a few percent), measured across the index and, for the search, on 89 questions:

Read

Tokens

Characters

A search, five hits

about 545

about 2,000

A page's outline

about 180

about 690

One section of a page

about 300

about 1,300

A whole page

about 1,950

about 8,400

A page is about six times that section. npm run cost prints the character counts for the current index; how these are measured is in docs/development.md.

Related MCP server: HackTricks MCP Server

Quick start

Requirements: Node.js 22.13 or newer, also when a client starts servers with its own copy of Node.js (the server uses the built-in node:sqlite, zero native dependencies).

Claude Code:

claude mcp add hacktricks -- npx -y @zebbern/hacktricks-mcp@latest

Codex CLI:

codex mcp add hacktricks -- npx -y @zebbern/hacktricks-mcp@latest

Any MCP client (Claude Desktop, Cursor, Kimi, etc.), config JSON:

{
  "mcpServers": {
    "hacktricks": {
      "command": "npx",
      "args": ["-y", "@zebbern/hacktricks-mcp@latest"]
    }
  }
}

As a plugin (bundles the agent skill that teaches efficient use and a researcher subagent that keeps multi-page research out of the main agent's context). The repository is its own marketplace:

  • Claude Code: /plugin install hacktricks --marketplace zebbern/hacktricks-mcp

  • Codex CLI: codex plugin marketplace add zebbern/hacktricks-mcp, then codex plugin add hacktricks --marketplace hacktricks-mcp

  • ZCode: Settings > Plugins > Add > Add plugin marketplace, enter zebbern/hacktricks-mcp, then install hacktricks from the Personal tab

  • Kimi Work: use this plugin link

The researcher subagent comes with the plugin on Claude Code, ZCode and Kimi. Codex plugins cannot bundle subagents, so on Codex copy its definition once:

mkdir -p ~/.codex/agents && curl -fsSLo ~/.codex/agents/hacktricks-researcher.toml https://raw.githubusercontent.com/zebbern/hacktricks-mcp/main/.codex/agents/hacktricks-researcher.toml

Packaging details are in docs/agents.md.

The skill alone, for other hosts (Cursor, OpenCode, Windsurf and the other agents the skills CLI supports): the installer adds the skill and nothing else, so add the MCP server with the config above as well. The command asks which agents to install into; -a <agent> names one:

npx skills add zebbern/hacktricks-mcp --skill hacktricks

Then ask things like:

  • "Search HackTricks for kerberoast and give me the attack commands"

  • "How do I escalate privileges from the lxd group?"

  • "Show me the SSRF section of the pentesting-web pages"

  • "What can I do with access to a Jenkins script console?"

  • "List every HackTricks page about AWS IAM"

  • "Is iam:CreatePolicyVersion dangerous? What can I do with iam:PassRole and lambda:CreateFunction?"

If the server does not start

The host's log shows why. Each of these has a one-line fix:

  • hacktricks-mcp needs Node.js 22.13 or newer: update Node.js and start the host again. On a Node.js that old the executable says so itself.

  • npm error code ENOENT on a path under _npx: the npx cache holds a broken entry, usually from an install that was cut short. Delete the _npx folder in npm's cache (%LOCALAPPDATA%\npm-cache\_npx on Windows, ~/.npm/_npx elsewhere) and start again; the package is downloaded once more.

  • npm error code EBUSY naming hacktricks.db under _npx (Windows): a hacktricks-mcp server started from 0.3.6 or older is still running in another session and holds the file that npx wants to replace. Close that session, which ends its server, and start again. A server started from 0.3.7 on holds no file of the package open.

  • 'hacktricks-mcp' is not recognized: the server was started with the package named without a tag (@zebbern/hacktricks-mcp or a fixed version) from inside a clone of this repository, where npx runs the local copy. Use the install line from the quick start.

Tools at a glance

Tool

What it does

hacktricks_search

Ranked full-text search over both books that takes a plain question or technical terms, with snippets, abbreviation handling (privesc, sqli, rce, ...) and an optional category filter

hacktricks_get_page

Read a page's section list with sizes, a single section, the whole page, or just its code blocks; the first lines carry the link to cite

hacktricks_get_toc

A compact map of both books (categories and chapters with page counts), or the pages under the entries matching a filter

hacktricks_cloud_permissions

Rate cloud permissions (AWS, GCP, Azure, Kubernetes) against HackTricks Cloud and list the escalation techniques they enable, with the page section that explains each

All tools are strictly read-only. Full reference: docs/tools.md.

Environment variables

Variable

Effect

HACKTRICKS_OFFLINE=1

Never use the network: no background check for a newer index

HACKTRICKS_INDEX_URL

Download newer indexes from this base URL instead of this project's releases

HACKTRICKS_CACHE_DIR

Where downloaded indexes are kept

HACKTRICKS_DB

Serve the database at this path; the background check stays off

An empty or blank variable counts as unset. How the refresh works and how it fails safely: docs/architecture.md.

Documentation

Security and license

  • The server executes nothing from the wiki. It answers from a local index that it opens read-only, and every query is a parameterized SQL statement.

  • HackTricks content is offensive-security reference material. Use it only on systems you are authorized to test.

  • HackTricks and HackTricks Cloud belong to Carlos Polop and contributors. This repository holds derived index data and its own server code (MIT).

  • Built on the Model Context Protocol TypeScript SDK.

Available Tools

3 tools
hacktricks_get_pageRead HackTricks PageA
Read-onlyIdempotent

Retrieve content of a HackTricks page found via hacktricks_search. By default returns the page outline plus content (truncated if very long). Use section= to read one section by heading name, or codeOnly=true to get just the commands/payloads. This is the token-efficient way to consume long pages.

Inputs: path (required), section, codeOnly. Returns: url, path, title, content, +2 more

hacktricks_get_tocHackTricks Table of ContentsA
Read-onlyIdempotent

Get the HackTricks wiki structure: categories and page tree. Call without arguments for the top-level overview, or pass a category to see its pages. Useful to understand where a topic lives before searching.

Inputs: category. Returns: tree, categories

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: full-text search for finding pages, page retrieval for consuming content, and TOC for structural overview. There is no overlap in action or resource that would cause misselection.

    Naming Consistency5/5

    All tool names follow a consistent snake_case pattern with the same 'hacktricks_' prefix and action-oriented verbs (search, get_page, get_toc). The convention is predictable and readable.

    Tool Count5/5

    Three tools is exactly right for a read-only wiki access server: search, retrieve, and navigate structure. Each tool earns its place without redundancy or bloat.

    Completeness5/5

    The surface fully covers the domain of consuming the HackTricks wiki: searching, retrieving pages with section/code filtering, and browsing the table of contents. No obvious gaps for a read-only access layer.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables AI models to search and retrieve offline security knowledge from over 20 curated sources including HackTricks, PayloadsAllTheThings, and OWASP guides, via the Model Context Protocol.
      9
      206
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables searching and querying HackTricks pentesting documentation directly from Claude, with tools for quick lookup, grouped search results, page outlines, section extraction, and cheatsheet mode.
      7
      116 npm
      11
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI agents to search a local folder of Markdown, AsciiDoc, and text files through a SQLite FTS5 keyword index, returning the most relevant sections with file paths, line ranges, and heading breadcrumbs instead of grepping through a repo. It also exposes tools to list indexed documents and refresh the index incrementally, all offline with no dependencies, network calls, or embeddings.
      3
      MIT