run_script
Execute Python or Bash scripts in a temporary file and return stdout/stderr, enabling quick custom security checks, automation, and proof-of-concept testing.
Instructions
Write and execute a Python or Bash script, returning its output.
Writes the code to a temporary file, executes it via python3/bash, and returns stdout/stderr. The temp file is deleted after execution. Requires CYBERSEC_MCP_ALLOW_SCRIPTS=1. This is an explicit full-code execution opt-in: scripts run outside the MCP policy layer and are not constrained by CYBERSEC_MCP_ALLOW_EXTERNAL. Their only OS isolation is the launch mode: the Kata VM by default, none in --local mode.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "run_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | The script source code to execute. | |
| venv | No | Optional Python venv name from ~/.ctf-venvs/ (e.g. "pwntools"). Allows using a different Python with specific packages installed. Ignored for language="bash". If not set, uses the MCP server's Python. | |
| timeout | No | Maximum execution time in seconds (default 120, max 300). | |
| language | No | "python" (default) or "bash". | python |
| working_dir | No | Working directory for the script (default: system temp dir). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||