Skip to content

feat(mcp): add execute tool for remote command execution#2277

Open
Libestor wants to merge 1 commit into
BishopFox:masterfrom
Libestor:feat/mcp-execute-tool
Open

feat(mcp): add execute tool for remote command execution#2277
Libestor wants to merge 1 commit into
BishopFox:masterfrom
Libestor:feat/mcp-execute-tool

Conversation

@Libestor

Copy link
Copy Markdown

Summary

Add an execute MCP tool that allows running commands on remote sessions and beacons via the MCP interface.

Features

  • Execute arbitrary commands on session or beacon targets
  • Full async beacon task handling with optional wait parameter
  • Returns structured response with stdout, stderr, exit status, and PID
  • Output capture enabled by default
  • Follows existing MCP tool conventions (buildRequest, logToolCall, newAsyncResult, etc.)

Changes

  • client/mcp/execute.go — new file implementing the execute tool handler
  • client/mcp/server.go — register the execute tool in newServer()

Usage

The tool accepts:

Parameter Description
session_id Target session ID (mutually exclusive with beacon_id)
beacon_id Target beacon ID (mutually exclusive with session_id)
path Command/binary path to execute (required)
args Command arguments
output Capture output (defaults to true)
wait Wait for beacon task completion
timeout_seconds Execution timeout

Add an 'execute' MCP tool that allows running commands on remote
sessions and beacons via the MCP interface. Supports:
- Session and beacon targets
- Async beacon task handling with optional wait
- Stdout/stderr/status/pid in structured response
- Output capture enabled by default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant