hacktricks-mcp
Search and read HackTricks content offline through read-only MCP tools.
Run ranked full-text searches over HackTricks with snippets, category filters, and configurable result limits.
Retrieve a page by path, including its outline and content, a specific section, or only its code blocks/commands.
Browse the HackTricks table of contents to see categories and pages before searching.
Use the server for offensive-security reference lookup, technique research, and command/payload extraction without executing anything or requiring network access at query time.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@hacktricks-mcp Search HackTricks for kerberoast and give me the attack commands"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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@latestCodex CLI:
codex mcp add hacktricks -- npx -y @zebbern/hacktricks-mcp@latestAny 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-mcpCodex CLI:
codex plugin marketplace add zebbern/hacktricks-mcp, thencodex plugin add hacktricks --marketplace hacktricks-mcpZCode: Settings > Plugins > Add > Add plugin marketplace, enter
zebbern/hacktricks-mcp, then installhacktricksfrom the Personal tabKimi 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.tomlPackaging 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 hacktricksThen 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:CreatePolicyVersiondangerous? What can I do withiam:PassRoleandlambda: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 ENOENTon a path under_npx: the npx cache holds a broken entry, usually from an install that was cut short. Delete the_npxfolder in npm's cache (%LOCALAPPDATA%\npm-cache\_npxon Windows,~/.npm/_npxelsewhere) and start again; the package is downloaded once more.npm error code EBUSYnaminghacktricks.dbunder_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-mcpor 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 |
| Ranked full-text search over both books that takes a plain question or technical terms, with snippets, abbreviation handling ( |
| 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 |
| A compact map of both books (categories and chapters with page counts), or the pages under the entries matching a filter |
| 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 |
| Never use the network: no background check for a newer index |
| Download newer indexes from this base URL instead of this project's releases |
| Where downloaded indexes are kept |
| 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
docs/tools.md: the four tools, their parameters, ranking and limits
docs/architecture.md: how the index, the 3-day sync and the background refresh work
docs/development.md: local setup, tests, releasing
docs/agents.md: agent skill, MCP registry and plugin packaging
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 toolshacktricks_get_pageRead HackTricks PageARead-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 ContentsARead-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
hacktricks_searchSearch HackTricksARead-onlyIdempotent
Full-text search over the HackTricks offensive-security wiki (pentesting techniques, privilege escalation, web vulns, AD attacks, cloud, forensics). Returns ranked pages with snippets. Use specific technical terms (e.g. 'kerberoast', 'SUID', 'JWT algorithm confusion') for best results. Follow up with hacktricks_get_page on a result's path to read the content.
Inputs: query (required), limit, category. Returns: results
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
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.
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.
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.
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
Related MCP Connectors
Private, multimodal knowledge store for agents: hybrid search with cited, provenance-backed results.
Securely search and manage workspace context files for AI agents and teams.
Read-only directory of AI agent security tools: search, get, compare, list categories.
Search your knowledge bases from any AI assistant using hybrid RAG.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables 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.9206MIT
- AlicenseAqualityDmaintenanceEnables searching and querying HackTricks pentesting documentation directly from Claude, with tools for quick lookup, grouped search results, page outlines, section extraction, and cheatsheet mode.7116 npm11MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to perform offline cybersecurity research and penetration testing by querying a local knowledge base of curated security data, with tools for searching, answering, and status checking.-
- AlicenseAqualityCmaintenanceEnables 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.3MIT