Run Command
run_commandExecute RouterOS commands on MikroTik devices with configurable allow/deny policies and optional dry-run validation.
Instructions
Execute an arbitrary RouterOS console command via SSH. Protected by a configurable allow/deny policy — built-in deny list blocks destructive commands; optionally restrict further with an explicit allow list (cmdAllow in routers.yaml or MIKROMCP_CMD_ALLOW). Use dedicated tools (reboot, etc.) for controlled operations. Output capped at 4000 characters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| routerId | Yes | Target router identifier from the router registry | |
| command | Yes | RouterOS console command to execute | |
| dryRun | No | Preview the command without executing (validates allow/deny policy only) | |
| confirmationToken | No | Token from a prior APPROVAL_REQUIRED response. Re-submit the identical call with this token to confirm the destructive action. |