Metasploit MCP Server

Unofficial Metasploit MCP Server (not affiliated with or endorsed by Rapid7) - provides Metasploit Framework functionality via the Model Context

Local serverstdioPython

What is the Metasploit MCP server?

If you already use Metasploit, the metasploit mcp server is the piece that lets your assistant work with it directly. Unofficial Metasploit MCP Server (not affiliated with or endorsed by Rapid7) - provides Metasploit Framework functionality via the Model Context Protocol. A fork of GH05TCREW/MetasploitMCP.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • list_exploits — Search exploit modules
  • run_exploit — Execute exploits
  • generate_payload — Create payloads
  • start_listener — Start handlers
  • list_active_sessions — Show sessions
  • send_session_command — Execute commands

Installation

metasploit-mcp on PyPI is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Credentials and setup notes

Configuration is passed through the environment: MSF_PASSWORD, MSF_SERVER, MSF_PORT, PAYLOAD_SAVE_DIR, MSF_RPC_PROTOCOL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

  • Python 3.10+ (3.11+ recommended) - Poetry for dependency management (Installation Guide) - Metasploit Framework with RPC enabled

Where it fits

Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Metasploit's toolset — list_exploits, run_exploit, generate_payload and 3 more — is a fair guide to whether it matches your workflow. It is maintained by GH05TCREW; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
list_exploitsSearch exploit modules
run_exploitExecute exploits
generate_payloadCreate payloads
start_listenerStart handlers
list_active_sessionsShow sessions
send_session_commandExecute commands

How to install the Metasploit MCP server

{
  "mcpServers": {
    "metasploit": {
      "command": "uvx",
      "args": ["metasploit-mcp"],
      "env": {
        "MSF_PASSWORD": "your-value",
        "MSF_SERVER": "your-value",
        "MSF_PORT": "your-value",
        "PAYLOAD_SAVE_DIR": "your-value",
        "MSF_RPC_PROTOCOL": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Python 3.10+ (3.11+ recommended) - Poetry for dependency management (Installation Guide) - Metasploit Framework with RPC enabled
VariableDescriptionRequired
MSF_PASSWORDConfiguration value read at startup.Optional
MSF_SERVERConfiguration value read at startup.Optional
MSF_PORTConfiguration value read at startup.Optional
PAYLOAD_SAVE_DIRFilesystem location the server is allowed to use.Optional
MSF_RPC_PROTOCOLConfiguration value read at startup.Optional

Example prompts to try

  • Use Metasploit to list exploits.
  • Use Metasploit to run exploit.
  • Use Metasploit to generate payload.

Frequently asked questions

It connects Metasploit to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (list_exploits, run_exploit, generate_payload, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Metasploit directly.