MCP server for Metasploit Framework via pymetasploit3
Project description
mcp-pymetasploit3
MCP server for Metasploit Framework via pymetasploit3. This server exposes all pymetasploit3 functionality as MCP tools, allowing LLMs to interact with Metasploit Framework through the msfrpc protocol.
Install
pip install mcp-pymetasploit3
MCP Server Configuration
{
"mcpServers": {
"mcp-pymetasploit3": {
"command": "mcp-pymetasploit3",
"env": {}
}
}
}
Usage
Starting Metasploit RPC Server
Before using the MCP server, you need to start the Metasploit RPC server:
Using msfrpcd:
msfrpcd -P yourpassword -p 55553 -n
Using msfconsole:
msfconsole -q
msf6 > load msgrpc Pass=yourpassword
MCP Tools
Once connected, the following tools are available:
Connection Management
connect- Connect to Metasploit RPC serverdisconnect- Disconnect from RPC serverget_client_info- Get current connection status
Module Management
list_modules- List available modules by typeuse_module- Load a specific moduleget_module_info- Get module description and infoget_module_options- Get all module optionsset_module_option- Set a module optionget_missing_required- Get required options not setexecute_module- Execute a moduleget_module_targets- Get available targetsset_module_target- Set the targetget_target_payloads- Get compatible payloads
Payload Generation
generate_payload- Generate a payload
Session Management
list_sessions- List all active sessionsget_session_info- Get session informationinteract_session- Write/read from sessionsession_run_command- Run command with outputstop_session- Stop a session
Console Management
create_console- Create a new consoledestroy_console- Destroy a consolewrite_console- Write to consoleread_console- Read console outputconsole_is_busy- Check if console is busyrun_module_output- Execute module and get output
Core/Framework
get_framework_version- Get framework versioncore_save- Save core statecore_reload_modules- Reload modulescore_set_global- Set global variablecore_unset_global- Unset global variable
Database
get_db_status- Get database statusdb_list_workspaces- List workspacesdb_set_workspace- Set current workspacedb_list_hosts- List hostsdb_list_services- List servicesdb_list_notes- List notesdb_list_creds- List credentialsdb_list_vulns- List vulnerabilities
Jobs
list_jobs- List running jobsstop_job- Stop a jobget_job_info- Get job information
Plugins
list_plugins- List loaded pluginsload_plugin- Load a pluginunload_plugin- Unload a plugin
Search
search_modules- Search for modulesget_module_references- Get module references
Example
# Connect to Metasploit
connect(password="yourpassword", host="127.0.0.1", port=55553, ssl=False)
# List exploits
exploits = list_modules("exploit")
# Use an exploit
use_module("exploit", "unix/ftp/vsftpd_234_backdoor")
# Set options
set_module_option("exploit", "unix/ftp/vsftpd_234_backdoor", "RHOSTS", "192.168.1.100")
# Execute
result = execute_module("exploit", "unix/ftp/vsftpd_234_backdoor", payload="cmd/unix/interact")
# List sessions
sessions = list_sessions()
# Interact with session
output = interact_session("1", "whoami")
# Disconnect
disconnect()
Development
git clone https://github.com/daedalus/mcp-pymetasploit3.git
cd mcp-pymetasploit3
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/
mcp-name
io.github.daedalus/mcp-pymetasploit3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_pymetasploit3-0.1.0.tar.gz.
File metadata
- Download URL: mcp_pymetasploit3-0.1.0.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6d2096dc58c3eb28f11a7521b5f5bb514684248164feac95a467d56e894c1ed
|
|
| MD5 |
b7d01846e8561f6bfea64c0fe72786ce
|
|
| BLAKE2b-256 |
ee9508deb95e5f410da306eb68ae5b806ad88f971ae1152ab70445c07d3298cb
|
Provenance
The following attestation bundles were made for mcp_pymetasploit3-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on daedalus/mcp-pymetasploit3
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_pymetasploit3-0.1.0.tar.gz -
Subject digest:
e6d2096dc58c3eb28f11a7521b5f5bb514684248164feac95a467d56e894c1ed - Sigstore transparency entry: 1244309183
- Sigstore integration time:
-
Permalink:
daedalus/mcp-pymetasploit3@b61c43b8a4212c3fed1b26f6ac79722398473820 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b61c43b8a4212c3fed1b26f6ac79722398473820 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_pymetasploit3-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_pymetasploit3-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b947c32e88596fcf8c0637825800dc3a364cc0819265599aedb0879625af0644
|
|
| MD5 |
0c9c3a18fba614d129a9738872f086cf
|
|
| BLAKE2b-256 |
1b11e5d729f2b2d8ec6237aed5a12f48ef1ddf1c5aabbd0a3a3aa3604b3643e9
|
Provenance
The following attestation bundles were made for mcp_pymetasploit3-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on daedalus/mcp-pymetasploit3
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_pymetasploit3-0.1.0-py3-none-any.whl -
Subject digest:
b947c32e88596fcf8c0637825800dc3a364cc0819265599aedb0879625af0644 - Sigstore transparency entry: 1244309187
- Sigstore integration time:
-
Permalink:
daedalus/mcp-pymetasploit3@b61c43b8a4212c3fed1b26f6ac79722398473820 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/daedalus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b61c43b8a4212c3fed1b26f6ac79722398473820 -
Trigger Event:
release
-
Statement type: