HackTricks MCP Server — Claude Code MCP server: features and setup
Searches the HackTricks pentesting knowledge base directly from your AI agent. Helps retrieve exploit steps and cheatsheets without reading massive markdown pages.
claude mcp add hacktricks-mcp-server -- npx -y hacktricks-mcp-serverWhat HackTricks MCP Server does
This server hooks your coding agent directly into the HackTricks offensive security documentation. It includes seven dedicated tools. You can run one-shot lookups using attack aliases like sqli or xss, or inspect page outlines before fetching content.
Instead of pulling whole guides into the prompt, the server extracts specific sections or code blocks. That keeps context clean. Built-in checks guard against command injection and directory traversal.
Running it requires Node.js 18 or higher along with ripgrep installed on your machine. Keep in mind that the initial install clones the full documentation repository, which takes roughly two minutes.
What it helps with
- search pentesting guides for specific exploits
- extract command cheatsheets without full documentation text
- view document outlines to reduce token consumption
- pull Linux privilege escalation payloads
Example prompts for the agent
- Search HackTricks for SUID privilege escalation commands
- Show me XSS payloads from the pentesting-web category
- Extract the outline for the Linux privilege escalation page
How to install HackTricks MCP Server
Platform CLI
claude mcp add hacktricks-mcp-server -- npx -y hacktricks-mcp-serverPlatform CLI
codex mcp add hacktricks-mcp-server -- npx -y hacktricks-mcp-serverConfig file
{
"mcpServers": {
"hacktricks-mcp-server": {
"command": "npx",
"args": [
"-y",
"hacktricks-mcp-server"
]
}
}
}Config file
{
"servers": {
"hacktricks-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"hacktricks-mcp-server"
]
}
}
}Platform CLI
gemini mcp add hacktricks-mcp-server npx -y hacktricks-mcp-serverStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about HackTricks MCP Server
How do I install HackTricks MCP Server in Claude Code?
Run claude mcp add hacktricks-mcp-server -- npx -y hacktricks-mcp-server in your terminal.
What does HackTricks MCP Server do?
It lets your assistant search HackTricks documentation to pull exploit commands, cheatsheets, and specific sections.
What system dependencies are needed?
You need Node.js version 18 or above and ripgrep in your PATH. The initial setup takes roughly two minutes to clone the documentation.