Exploitationmetasploitmcpserverframeworkintegration

Metasploit MCP Server

MCP Server for Metasploit Framework integration. A Model Context Protocol (MCP) server that enables streamlined communication with Metasploit.

Description

metasploitmcp is a specialized server implementation that provides Model Context Protocol (MCP) integration for the Metasploit Framework. It serves as a bridge between MCP clients and Metasploit's exploitation capabilities, allowing for programmatic control and interaction with Metasploit modules through standardized MCP transport protocols.

The tool supports both HTTP-based Server-Sent Events (SSE) and direct stdio pipe transports, making it versatile for different deployment scenarios such as local development or networked AI agent integrations. This enables automated exploitation workflows where AI models or MCP-compatible clients can dynamically invoke Metasploit payloads, modules, and sessions.

Primary use cases include enhancing AI-driven penetration testing pipelines, integrating Metasploit into Model Context Protocol ecosystems, and providing a lightweight server for remote exploitation management. The server is optimized for Kali Linux environments with minimal dependencies focused on Python FastAPI and pymetasploit3.

How It Works

metasploitmcp operates as an MCP-compliant server using Python FastAPI and Uvicorn for HTTP transport (SSE) or direct stdio piping. It leverages the pymetasploit3 library to interface directly with Metasploit Framework RPC, translating MCP requests into Metasploit console commands, module executions, and session management. The server binds to configurable host/port (default 127.0.0.1:8085+), auto-detects available ports, and supports development reload capabilities. MCP clients connect via standardized protocol to issue commands like searching exploits, launching payloads, or managing sessions through the streamlined interface.

Installation

bash
sudo apt install metasploitmcp

Flags

-h, --helpshow this help message and exit
--transport {http,stdio}MCP transport mode to use (http=SSE, stdio=direct pipe)
--host HOSTHost to bind the HTTP server to (default: 127.0.0.1)
--port PORTPort to listen on (default: find available from 8085)
--reloadEnable auto-reload (for development)
--find-portForce finding an available port starting from --port

Examples

Display the full help message and usage information for the tool
metasploitmcp -h
Run the streamlined Metasploit MCP server with default settings (HTTP transport on 127.0.0.1, auto-port from 8085)
metasploitmcp
Run MCP server using direct stdio pipe transport for local integrations
metasploitmcp --transport stdio
Run HTTP MCP server bound to all interfaces on port 8085
metasploitmcp --host 0.0.0.0 --port 8085
Find an available port starting from 9000 for the HTTP server
metasploitmcp --port 9000 --find-port
Run server with auto-reload enabled for development and testing
metasploitmcp --reload
Explicitly run HTTP SSE transport server on localhost port 8086
metasploitmcp --transport http --host 127.0.0.1 --port 8086
Updated 2026-04-16kali.org ↗