A Textual TUI (Terminal User Interface) client for the HackTheBox Model Context Protocol (MCP) server. Browse CTF events and challenges, execute tools, and manage resources with a sleek, interactive terminal interface.
- ๐ฅ๏ธ Rich TUI Interface - Built with Textual for a modern terminal experience
- ๐ฏ Event & Challenge Selection - Browse and select CTF events and challenges with split-panel views
- ๐ง Tool Execution - Execute HackTheBox MCP tools with guided argument input
- ๐ Data Tables - View tools, resources, and arguments in organized tables
- ๐พ Export Functionality - Save results to JSON or Markdown files
- ๐จ Hacker Theme - Green-on-black aesthetic
- โก Auto-fill - Automatically populate tool arguments from selected events/challenges
- ๐ State Management - Persistent selection across screens
- ๐ Resource Management - Read and browse MCP resources
- Python 3.10 or later
- HackTheBox API access token (JWT)
git clone https://github.com/therealfredp3d/HTB-MCP-Client.git
cd HTB-MCP-ClientUsing pip:
pip install -r requirements.txtOr using uv for faster installation:
uv pip install -r requirements.txtCreate a .env file from the template:
cp .env.example .envEdit .env and add your HackTheBox API token:
API_ACCESS_TOKEN=your-hackthebox-jwt-token-hereTip: You can find your API token in the
.mcp.jsonfile or generate a new one from your HackTheBox profile settings.
python htb_mcp_client.pypython htb_mcp_client.py --versionThe main menu provides quick access to all major features:
- List Tools - View all available MCP tools
- List Resources - Browse MCP resources
- Challenges - Access stored challenge data
- Call Tool - Execute a tool with custom arguments
- Read Resource - Fetch a resource by URI
- Exit - Close the application
- Arrow Keys - Navigate lists and tables
- Enter - Select an item
- Tab - Move between UI elements
- q - Quit application (global binding)
- d - Toggle dark mode
When you list CTF events:
- Left panel shows Event IDs and Names
- Right panel displays detailed event information in Markdown
- Navigate with โ/โ arrow keys
- Press Enter or click "Select Event" to store the event
- Selected event appears in the main menu title
Similar to event selection:
- Browse challenges in a table (ID, Name, Difficulty, Points)
- View detailed challenge info in the right panel
- Select a challenge to auto-populate tool arguments
- Select a tool from the dropdown
- View the argument schema in a table
- Edit the JSON arguments (pre-filled template provided)
- Click "Execute" to run the tool
- Results appear in the result screen
- Save results as JSON or Markdown
All result screens offer export options:
- Save to .json - Full data structure with timestamp
- Save to .md - Formatted Markdown output
Files are saved to htb_mcp_output/ directory.
HTB-MCP-Client/
โโโ htb_mcp_client.py # Main TUI application
โโโ requirements.txt # Python dependencies
โโโ .env.example # Environment template
โโโ LICENSE # MIT License
โโโ CHANGELOG.md # Version history
โโโ README.md # This file
โโโ htb_mcp_output/ # Output directory (created automatically)
pip install build
python -m buildpip install -e .The client supports configuration via environment variables or .env file:
| Variable | Required | Default | Description |
|---|---|---|---|
API_ACCESS_TOKEN |
Yes | - | Your HackTheBox API JWT token |
HTB_MCP_URL |
No | https://mcp.hackthebox.ai/v1/ctf/mcp/ |
MCP server endpoint |
Make sure you've created a .env file with your token:
cp .env.example .env
# Edit .env and add your tokenVerify your token is valid and not expired. You can generate a new token from your HackTheBox profile settings.
Ensure all dependencies are installed:
pip install -r requirements.txtContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Textual - amazing TUI framework
- Powered by HackTheBox MCP API
- MCP SDK by Anthropic
- HackTheBox - Cybersecurity training platform
- Model Context Protocol - Standardized AI-app integration





