PluginBench
MCP Server
Maintained
MIT

HackTricks MCP Server MCP Server

io.github.Xplo8E/hacktricks-mcp-server

Search and query HackTricks pentesting documentation directly from Claude with quick lookup and section extraction.

What is the HackTricks MCP Server MCP server?

The HackTricks MCP Server is an MCP server that provides access to HackTricks pentesting documentation through Claude, enabling quick lookups, grouped search results, and efficient section extraction. It offers specialized tools for exploitation research, privilege escalation, and vulnerability exploitation techniques with support for aliases and category filtering.

This server integrates the comprehensive HackTricks pentesting knowledge base into Claude, allowing you to search for exploitation techniques, privilege escalation methods, and security research information without leaving your AI assistant. It's designed for penetration testers, security researchers, and CTF participants who need quick access to attack methodologies and payloads.

How to install HackTricks MCP Server

Copy-paste configuration for popular MCP clients.

transport: stdio
Config generated by PluginBench — verify against the source before use.
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "hacktricks-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "hacktricks-mcp-server"
      ]
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • hacktricks_quick_lookup — One-shot exploitation lookup that searches, finds the best page, and returns exploitation sections and code blocks in a single call. Supports aliases like sqli, xss, rce, lfi, ssrf, csrf, xxe, ssti, idor, jwt, suid, and privesc.
  • search_hacktricks — Search through HackTricks documentation with results grouped by file, showing match count, page title, and relevant section headers. Supports optional category filtering and result limits.
  • get_hacktricks_outline — Retrieve the table of contents for a HackTricks page, showing all section headers and structure without loading the full content.
  • get_hacktricks_section — Extract a specific section from a HackTricks page by header name using partial matching and case-insensitive search.
  • get_hacktricks_cheatsheet — Extract only code blocks and commands from a HackTricks page, useful for getting payloads and exploitation commands without explanatory text.
  • get_hacktricks_page — Retrieve the full content of a HackTricks page (may be 3000+ tokens).
  • list_hacktricks_categories — List available HackTricks categories and their contents, with optional expansion of specific categories to show file paths.

Use cases

  • Search for SQL injection, XSS, SSRF, and other web vulnerability exploitation techniques
  • Find Linux privilege escalation methods including SUID binaries, capabilities, and kernel exploits
  • Look up RCE, XXE, CSRF, and other common attack vectors with ready-to-use payloads
  • Discover and extract specific pentesting techniques by category (web, Linux, Windows, cloud, etc.)
  • Get quick command references and exploitation code blocks for immediate use in security assessments

HackTricks MCP Server MCP server FAQ

What is the HackTricks MCP Server?

It's an MCP server that integrates the HackTricks pentesting documentation into Claude, providing tools to search for exploitation techniques, privilege escalation methods, and security research information with efficient section extraction and code block retrieval.

Is it free to use?

Yes, the server is free and open-source under the MIT license. It accesses the free HackTricks documentation repository.

How do I install it in Claude Desktop?

Install via npm with `npm install -g hacktricks-mcp-server`, then add the configuration to `~/.claude/settings.json` with the command `npx hacktricks-mcp-server`. Restart Claude Desktop and you can start searching HackTricks.

Do I need authentication or API keys?

No authentication or API keys are required. The server uses a local clone of the HackTricks repository that is automatically downloaded during installation.

What's the most efficient way to use this server?

Use the pattern: search with category filter → get page outline → extract specific section → get cheatsheet if needed. This reduces token usage from 5000+ to ~400 tokens compared to reading full pages.

What are the system requirements?

Node.js v18 or higher, ripgrep (rg) for fast searching, and Bun for package management. The HackTricks repository (~2 minutes) is cloned automatically on first install.

README (reference)

Source of truth, from the repository.

HackTricks MCP Server

MCP (Model Context Protocol) server for searching and querying HackTricks pentesting documentation directly from Claude.

Features

  • Quick lookup - One-shot exploitation info with alias support (sqli, xss, ssrf, etc.)
  • Grouped search results - Results aggregated by file with match count, title, and relevant sections
  • Page outline - Quick table of contents to identify relevant sections
  • Section extraction - Read specific sections instead of full pages (token-efficient)
  • Cheatsheet mode - Extract only code blocks/commands from pages
  • Category browsing - Discover available topics and file paths
  • Fast grep search - Uses ripgrep for instant results
  • Security hardened - Protection against command injection and path traversal

Quick Start

Installation

npm install -g hacktricks-mcp-server

The postinstall script automatically clones the HackTricks repository (~2 minutes on first install).

Configure Claude Desktop

Add to your Claude settings (~/.claude/settings.json):

{
  "mcpServers": {
    "hacktricks": {
      "command": "npx",
      "args": ["hacktricks-mcp-server"]
    }
  }
}

Restart Claude Desktop and try: "Search HackTricks for SQL injection"

Alternative: Install from Source

git clone https://github.com/Xplo8E/hacktricks-mcp-server.git
cd hacktricks-mcp-server
git submodule update --init --recursive
npm install
npm run build

Configuration for source install:

{
  "mcpServers": {
    "hacktricks": {
      "command": "node",
      "args": ["/absolute/path/to/hacktricks-mcp-server/dist/index.js"]
    }
  }
}

Usage Examples

Once configured in Claude Desktop, you can ask:

  • "Search HackTricks for SQL injection techniques"
  • "Give me SUID privilege escalation commands"
  • "Show me XSS payloads"
  • "List all pentesting categories in HackTricks"
  • "How do I exploit XXE vulnerabilities?"

The server provides 7 specialized tools for efficient HackTricks searching.

Available Tools

hacktricks_quick_lookup

⚡ One-shot exploitation lookup. Searches, finds best page, and returns exploitation sections + code blocks in one call.

Parameters:

  • topic (string, required): Attack/technique to look up (e.g., 'SUID', 'sqli', 'xss', 'docker escape')
  • category (string, optional): Category filter for faster results

Supported aliases: sqli, xss, rce, lfi, rfi, ssrf, csrf, xxe, ssti, idor, jwt, suid, privesc

Example:

hacktricks_quick_lookup("SSRF", category="pentesting-web")

Benefits: Reduces 3+ tool calls to 1 for "how do I exploit X" questions.


search_hacktricks

Search through HackTricks documentation. Returns results GROUPED BY FILE with match count, page title, and relevant section headers.

Parameters:

  • query (string, required): Search term or regex pattern
  • category (string, optional): Filter to specific category (e.g., 'pentesting-web')
  • limit (number, optional): Max grouped results (default: 20)

Example output:

Found matches in 5 files for: "SUID"

────────────────────────────────────────────────────────────

📄 **Linux Privilege Escalation**
   Path: src/linux-hardening/privilege-escalation/README.md
   Matches: 12
   Sections: SUID Binaries | Finding SUID | GTFOBins
   Preview:
     L45: Find files with SUID bit set...
     L78: Common SUID exploitation techniques...

────────────────────────────────────────────────────────────

get_hacktricks_outline

Get the table of contents of a page (all section headers). Use this BEFORE reading full pages to understand structure.

Parameters:

  • path (string): Relative path to markdown file

Example output:

# Linux Privilege Escalation
  ## Enumeration
    ### System Information
    ### Network
  ## SUID Binaries
    ### Finding SUID Files
    ### Exploiting SUID
  ## Capabilities

Benefits: See page structure in ~20 lines vs reading 500+ lines.


get_hacktricks_section

Extract a specific section from a page by header name. Much more efficient than reading the full page.

Parameters:

  • path (string): Relative path to markdown file
  • section (string): Section header to extract (partial match, case-insensitive)

Example:

get_hacktricks_section("src/linux-hardening/privilege-escalation/README.md", "SUID")

Benefits: Read just "SUID Binaries" section (~200 tokens) instead of entire page (~3000 tokens).


get_hacktricks_cheatsheet

Extract only code blocks from a page. Perfect when you just need commands, payloads, or examples.

Parameters:

  • path (string): Relative path to markdown file

Example output:

find / -perm -4000 2>/dev/null
./vulnerable_suid -p

Benefits: Skip explanatory text when you just need "give me the command".


get_hacktricks_page

Get full content of a HackTricks page.

Parameters:

  • path (string): Relative path to markdown file

Warning: Pages can be very long (3000+ tokens). Consider using get_hacktricks_outline + get_hacktricks_section instead.


list_hacktricks_categories

List categories and their contents.

Parameters:

  • category (string, optional): Category to expand

Without category: Lists top-level categories With category: Shows full directory tree with file paths

Efficient Usage Pattern

For optimal token usage, Claude should:

  1. Search with category filter → Get grouped results with context
  2. Get outline of relevant page → See structure before reading
  3. Extract specific section → Read only what's needed
  4. Get cheatsheet → Quick command reference

Before (inefficient):

search_hacktricks("SUID")     → 50 raw lines
get_page(file1)               → 3000 tokens
get_page(file2)               → 2500 tokens  
Total: ~5500 tokens, 3 calls

After (efficient):

search_hacktricks("SUID", category="linux-hardening")  → Grouped results
get_outline(best_match)                                 → 20 lines
get_section(best_match, "SUID")                         → 200 tokens
Total: ~400 tokens, 3 calls

Requirements

  • Node.js (v18 or higher)
  • ripgrep (rg) - usually pre-installed on macOS/Linux
  • Bun (for package management)

Development

Watch mode:

bun run dev

Test locally:

bun run start

Contributing

Contributions are welcome! If you'd like to improve the server:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/improvement)
  3. Make your changes and test locally
  4. Submit a pull request

Please ensure your PR includes tests for new features and maintains the existing code style.

License

MIT

Credits

Related MCP servers

PDPDF Reader logo

MCP server for extracting text, images, tables, links, annotations, and metadata from PDF files.

1
Python
MIT
View repository →
MCmcp-for-maya logo

AI agents' spatial awareness inside Autodesk Maya: audit, rollback safety, visual loop (Beta)

0
Python
MIT
View repository →

Create consistent mascot assets and animations for products through AI agents.

View repository →

Classify Japanese curriculum scope, audit grade limits, and search normalized MEXT data.

0
TypeScript
MIT
View repository →

Marketing MCP: content, SEO, outbound, LinkedIn, ads. Agents provision a sandbox with one POST.

0
Shell
MIT
View repository →
SCScholar Feed logo

Search, rank, and trace 23M+ CS/AI/ML papers by citations, impact, and code adoption—directly in Claude or Cursor.

9
TypeScript
MIT
View repository →