Metasploit-MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MSF_RPC_URL | No | Local MessagePack RPC endpoint. Only loopback endpoint names/addresses are accepted. | http://127.0.0.1:55553/api/ |
| MSF_RPC_PASS | No | RPC password. Used for password login unless MSF_RPC_TOKEN is set. | |
| MSF_RPC_USER | No | RPC username. | msf |
| MSF_RPC_TOKEN | No | Existing RPC token; takes precedence over password. | |
| MSF_RPC_CA_FILE | No | Custom CA file for local HTTPS. | |
| MSF_RPC_TIMEOUT | No | Default per-request HTTP timeout in seconds. | 30 |
| MSF_RPC_VERIFY_TLS | No | Verify HTTPS certificates. | true |
| MSF_RPC_MAX_RESPONSE_BYTES | No | Maximum bytes in a single RPC response. | 67108864 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| msf_rpc_methodsA | Find RPC method names, Ruby argument signatures, and authentication requirements. Defaults to a bundled reference catalog pinned to an upstream commit. Pass the installed Framework root to scan its source instead. This is source discovery, not a live capability probe; plugins and versions can differ. The catalog never restricts msf_rpc calls to unlisted methods. |
| msf_statusB | Authenticate and get Metasploit and API version information. |
| msf_rpcA | Call ANY Metasploit RPC method with positional arguments, excluding its auth token. Examples: core.version []; module.info ["auxiliary", "module/name"]; job.list []; session.list []; db.workspaces []; plugin.loaded []. Methods and arguments depend on your installed Metasploit version. authenticated=null detects auth.login and health.check as unauthenticated; false omits the token for other noauth endpoints. timeout overrides the per-request HTTP timeout in seconds, without retrying a failed action. For binary arguments use an exact {"$binary": "base64..."} object. For typed map keys or literal marker objects use {"$map": [[key, value], ...]}. Non-string map keys in results are preserved using the same pair-list form. This can mutate state, execute modules, manage sessions, or stop the daemon. Use console tools for functionality without an RPC method. |
| msf_module_searchA | Search Metasploit modules using its search syntax (e.g. type:auxiliary name:http). |
| msf_module_infoB | Return module metadata. Use msf_rpc module.options for its option schema. |
| msf_module_executeA | Execute an installed module with its datastore options; returns job/UUID or output. Inspect module.info and module.options first. Execution may continue after this tool returns. Poll job.list, module.running_stats, or module.results using msf_rpc. Binary output is represented as a $binary base64 object. |
| msf_jobsA | List running jobs. Use msf_rpc job.info or job.stop with a job ID. |
| msf_sessionsA | List sessions; use msf_rpc session.* methods to interact with them. |
| msf_console_createB | Create a persistent msfconsole and return its ID; destroy it when finished. |
| msf_console_listA | List consoles and their busy state. |
| msf_console_writeA | Send arbitrary console commands, including multiline scripts. The console retains state (selected module, options, workspace). This tool only submits input; read output separately. A newline is appended by default. |
| msf_console_readA | Consume available console output; returns data, prompt, and busy status. Reads drain the console's output buffer. busy=false is a snapshot, not proof that a just-submitted command has completed or that a job has ended. |
| msf_console_destroyA | Destroy a console by ID. This does not stop its background jobs/sessions. |
| msf_process_startA | Start a local executable with literal argv, without a shell. Use ["msfconsole", "-q"] with terminal=true for a real interactive PTY, including IRB, prompts, and terminal input. Use ["msfvenom", "--help"] with terminal=false for exact binary output and separate stderr. Other installed Framework utilities and interpreters can be run the same way. These processes do not share the RPC daemon's in-memory sessions or jobs. Returns immediately with process_id. Read output, write input, signal, resize, and close using the process tools. cwd and env are optional. |
| msf_process_readA | Read lossless spooled output at a byte offset, without consuming it. data is base64 bytes; text is a display-only UTF-8 decoding. Use next_offset to continue reading. Pipe mode separates stdout/stderr; PTY merges them into stdout. eof means the process exited and this stream has been read. A process timeout/cancellation never implicitly replays or stops it. |
| msf_process_writeA | Write text or {$binary: base64} to stdin, without adding a newline. For commands include a newline explicitly. Control characters can be sent directly in PTY mode (e.g. for Ctrl-C, for EOF). In pipe mode, close_stdin=true sends EOF after data. PTY stdin cannot be closed separately. |
| msf_process_signalA | Signal the process group: interrupt, terminate, kill, stop, or continue. Accepts named POSIX signals, including SIGINT, SIGTERM, SIGKILL, SIGSTOP, SIGCONT, SIGHUP, SIGUSR1, SIGUSR2, and SIGWINCH. SIGINT interrupts native console/IRB work. It may exit a standalone tool. |
| msf_process_resizeB | Resize a persistent PTY and notify its foreground terminal program. |
| msf_process_listA | List processes owned by this bridge and their exit status. |
| msf_process_closeA | Stop this process and owned descendants, release its PTY, and delete output. Detached descendants are tracked by ancestry and an inherited ownership marker. Retrieve output first. Owned processes are also stopped when the MCP server shuts down. This does not stop an external RPC daemon. |
| msf_file_readA | Read a local file as lossless base64 chunks; continue using next_offset. Use for generated binaries, loot, reports, resource scripts, or modules. This accesses the MCP host's filesystem with its OS permissions. |
| msf_file_writeA | Write text or {$binary: base64} at a local file byte offset. Creates missing parent directories and files. truncate=true clears an existing file first; use only on the first chunk when replacing a file. Supports arbitrary-sized resource scripts, modules, and import artifacts by writing successive chunks at next_offset. Paths are local to the MCP host. |
| msf_file_listA | List a local directory with pagination to locate scripts and output artifacts. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| usage | Bridge usage, transport behavior, and RPC documentation. |
TDQS
Scored across 23 tools
Tools are organized into clean families (console, process, file, module, RPC) with descriptions that explicitly distinguish risky pairs, e.g. msf_console_* (RPC daemon state) vs msf_process_* (local PTY executables). The remaining overlap is intentional: msf_rpc is a documented catch-all that can do most of what msf_sessions, msf_jobs, msf_status, and msf_module_execute do, which can tempt misselection but is clearly framed as an escape hatch.
Nearly all tools follow a predictable msf_<family>_<verb> snake_case pattern (msf_console_create, msf_process_signal, msf_file_read, msf_module_execute). A few are bare nouns without a verb (msf_sessions, msf_jobs, msf_status, msf_rpc), a minor deviation but still readable and unambiguous within their families.
23 tools is on the heavy side, but the count is driven by a few genuinely stateful subsystems (7 process lifecycle tools, 5 console tools) where read/write/signal/close genuinely each earn a place. No tool appears redundant or filler; a slightly flatter surface could merge some list-only endpoints.
Core areas are covered (module search/info/execute, console lifecycle, process and file I/O), but sessions and jobs are list-only and must be driven through raw msf_rpc for interaction, stopping, or data read — a notable gap in the typed surface for Metasploit's central post-exploitation workflow. File tools also lack delete/move, though the generic RPC escape hatch prevents true dead ends.