Skip to main content

Metasploit MCP Server for AI assistants to interact with Metasploit Framework (with improved ASGI and SSE handling)

Project description

Metasploit MCP Server

A Model Context Protocol (MCP) server for interacting with the Metasploit Framework.

Changelog

v1.6.3

  • Breaking Change: Changed default execution mode from async (run_as_job: true) to sync (run_as_job: false) for run_exploit and run_post_module functions
  • This resolves issues where async execution returned boolean values that caused "'bool' object is not subscriptable" errors
  • Users can still explicitly set run_as_job: true for async execution when needed
  • run_auxiliary_module was already defaulting to sync execution

Features

  • List exploits and payloads
  • Generate payloads
  • Run exploits, post modules, and auxiliary modules
  • Manage sessions and listeners
  • Send commands to active sessions

Installation

pip install gc-metasploit

Or install with uvx:

uvx gc-metasploit

Usage

Ensure Metasploit RPC is running:

msfrpcd -P your_password -S -a 127.0.0.1

Then start the MCP server:

# As a command-line tool (HTTP/SSE mode by default):
gc-metasploit

# Or as a module:
python -m gc_metasploit.server

# Specify transport mode and options:
gc-metasploit --transport http --host 0.0.0.0 --port 8085
gc-metasploit --transport stdio

Transport Options

The server supports two transport methods:

  • HTTP/SSE (Server-Sent Events): Default mode for interoperability with most MCP clients
  • STDIO (Standard Input/Output): Used with Claude Desktop and similar direct pipe connections

For Claude Desktop integration, configure claude_desktop_config.json:

{
    "mcpServers": {
        "metasploit": {
            "command": "gc-metasploit",
            "args": [
                "--transport",
                "stdio"
            ],
            "env": {
                "MSF_PASSWORD": "yourpassword"
            }
        }
    }
}

For other MCP clients that use HTTP/SSE:

  1. Start the server in HTTP mode (default):

    gc-metasploit --transport http --host 0.0.0.0 --port 8085
    
  2. Configure your MCP client to connect to:

    • SSE endpoint: http://your-server-ip:8085/sse

Environment Variables

  • MSF_PASSWORD: Metasploit RPC password (default: 'yourpassword')
  • MSF_SERVER: Metasploit RPC server (default: '127.0.0.1')
  • MSF_PORT: Metasploit RPC port (default: '55553')
  • MSF_SSL: Use SSL (default: 'false')
  • PAYLOAD_SAVE_DIR: Directory to save generated payloads (default: '~/payloads')

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gc_metasploit-1.6.3.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gc_metasploit-1.6.3-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file gc_metasploit-1.6.3.tar.gz.

File metadata

  • Download URL: gc_metasploit-1.6.3.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for gc_metasploit-1.6.3.tar.gz
Algorithm Hash digest
SHA256 528d0af8c1670980307a0b58d6d4714c0e8898d202aaa2e06148dc2cf37ba215
MD5 8928cc65807fe26e113cb3381afa1fb0
BLAKE2b-256 22b2ae4132435f786786fe48d2d1e601863cfd33ee6de1448cbb79d19952924c

See more details on using hashes here.

File details

Details for the file gc_metasploit-1.6.3-py3-none-any.whl.

File metadata

  • Download URL: gc_metasploit-1.6.3-py3-none-any.whl
  • Upload date:
  • Size: 22.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for gc_metasploit-1.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 27e3b2f85b11da9d6f3b18b6e63973f45427c25137366c8c693f61c73c2210a5
MD5 3a775fe67f8f2371887ee570e315deab
BLAKE2b-256 6cc67dd0c6ef7e4929dd25acc6c000d5684b068e958e49422a54b2a5668ab00c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page