Skip to main content
Glama

db_workspaces

List all available Metasploit workspaces to organize and manage penetration testing data, enabling security professionals to track different assessment projects and results.

Instructions

List all Metasploit workspaces

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • Handler implementation for the 'db_workspaces' tool. Executes the Metasploit 'workspace' command via executeMsfCommand to list all available workspaces and returns the results in JSON format.
    case "db_workspaces": { try { const workspaces = await executeMsfCommand([`workspace`]); return { content: [ { type: "text", text: JSON.stringify( { success: true, workspaces, }, null, 2 ), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: JSON.stringify({ success: false, error: error.message, }), }, ], }; } }
  • Input schema definition for the 'db_workspaces' tool, specifying an empty object (no required parameters).
    inputSchema: { type: "object", properties: {}, },
  • src/index.ts:145-152 (registration)
    Registration of the 'db_workspaces' tool in the MCP tools array, including name, description, and schema.
    { name: "db_workspaces", description: "List all Metasploit workspaces", inputSchema: { type: "object", properties: {}, }, },
  • Helper function used by the handler to execute Metasploit console commands asynchronously.
    async function executeMsfCommand(commands: string[]): Promise<string> { const commandString = commands.join("; "); const fullCommand = `msfconsole -q -x "${commandString}; exit"`; try { const { stdout, stderr } = await execAsync(fullCommand, { timeout: 60000, // 60 second timeout maxBuffer: 10 * 1024 * 1024, // 10MB buffer }); return stdout || stderr; } catch (error: any) { throw new Error(error.message || "Command execution failed"); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andreransom58-coder/kali-metasploit-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server