Get the FREE Ultimate OpenClaw Setup Guide →

cobaltstrike

MCP Server for Cobalt Strike interaction.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio cobalt-strike-cobaltstrike-mcp-server python cs_mcp.py \
  --env LOG_LEVEL="Logging level (DEBUG, INFO, WARNING, ERROR)" \
  --env MCP_TRANSPORT="MCP transport (http, streamable-http, sse, stdio)" \
  --env CS_API_BASE_URL="Base URL for the Cobalt Strike REST API (e.g., https://host:50443)" \
  --env CS_API_PASSWORD="Cobalt Strike API password" \
  --env CS_API_USERNAME="Cobalt Strike API username" \
  --env MCP_LISTEN_HOST="Host to bind MCP server (e.g., 127.0.0.1)" \
  --env MCP_LISTEN_PORT="Port to bind MCP server (e.g., 3000)" \
  --env MCP_SERVER_NAME="Name displayed to MCP clients (e.g., Cobalt Strike MCP)" \
  --env CS_API_VERIFY_TLS="false to disable TLS verification (default true)" \
  --env CS_API_HTTP_TIMEOUT="HTTP request timeout seconds (e.g., 30.0)"

How to use

This MCP server acts as a bridge between large language models and the Cobalt Strike C2 framework by exposing the Cobalt Strike REST API endpoints as MCP tools. It enables AI assistants to discover, manage, and interact with beacons, payloads, listeners, and commands through standardized tool calls. You can invoke operations like listing beacons, executing commands on targets, generating payloads, and managing listeners via natural language prompts that map to the supported API endpoints.

To use this server, configure the environment and start the Python-based MCP server (cs_mcp.py) with the appropriate credentials for your Cobalt Strike API. Ensure the Cobalt Strike API server is running and accessible. Once running, connect an MCP client (or Claude Desktop integration) and utilize the exposed tools under categories such as Beacon Management, Commands, Payloads, and Listeners to perform tasks like querying beacon status, executing commands on beacons, uploading/downloading payloads, or creating and managing listeners.

How to install

Prerequisites:

  • Python 3.8+ installed
  • Virtual environment tool (venv) available
  • Cobalt Strike API server running and accessible
  • Internet access to install Python dependencies

Installation steps:

  1. Clone the repository:

    git clone <repository-url> cd cobaltstrike-mcp-server

  2. Create and activate a virtual environment:

    Windows

    setup.bat venv\Scripts\activate

    macOS/Linux

    ./setup.sh source venv/bin/activate

  3. Install dependencies:

    pip install -r requirements.txt

  4. Run the MCP server (example):

    python cs_mcp.py --username <cs_username> --password <cs_password> --insecure

  5. Optional: Use a .env file for configuration by placing environment variables in a .env file and running:

    python cs_mcp.py

Additional notes

Tips and caveats:

  • Ensure the CS API base URL, username, and password are correct to avoid authentication errors.
  • Depending on your environment, TLS verification may need to be disabled for testing (CS_API_VERIFY_TLS=false) but enable in production.
  • The MCP transport option controls how the MCP server communicates with clients (http, stdio, etc.); choose based on your deployment and client capabilities.
  • If you upgrade Cobalt Strike or the MCP server, verify compatibility of the REST API endpoints and corresponding tool mappings.
  • Use the --show-env option to inspect supported environment variables and their values at runtime.
  • When using Claude Desktop integration, ensure the configured Python path and script path in the Claude config point to your active virtual environment where cs_mcp.py resides.

Related MCP Servers

Sponsor this space

Reach thousands of developers