corestack_ exec_ command
Run a command.
When to use it
Run a shell command in the environment as the site user (web), with the same login shell as the browser terminal: php, composer, wp (WordPress), bin/magento, mariadb, rsync, git, node. It runs beside the Control Panel's own work and is never blocked by it. The call waits up to wait_seconds and then answers a task that keeps running for up to timeout_seconds. A process the command leaves in the background keeps running after it ends; one that clears its environment and leaves its process group cannot be stopped from here (use SSH or the terminal).
Ask for it
Using the Corefinity MCP server, call corestack_exec_command with site_id 4211, command php -v. (Run a command.) Tell me what it returned.Inputs
The shell script to run (bash). It is uploaded as a file, never put on a command line. Up to 262,144 characters.
Relative to the site root, or absolute under it. Default htdocs. Up to 1,024 characters.
Environment variables for the command: NAME => value.
At least 1.
Defaults to 3600. 1 to 86400.
How long the call waits before it answers a task. 0 answers a task at once. Defaults to 30.
Example call
{
"name": "corestack_exec_command",
"arguments": {
"site_id": 4211,
"command": "php -v"
}
}If it is refused
| Reason | What to do |
|---|---|
command_failed | An MCP command exited non-zero — any non-zero exit of a payload that was started, 125 included — ran out of time, ended without a status, or lost its container; status and exit code in details; read the output (corestack_command_output_get). |
launch_interrupted | An MCP command never started: its launch stopped before anything was claimed or ran, or — launch_failed — its start gate never released the payload: run.sh recorded unlaunched or a reconciler took the release token first — nothing ran; call again. |
launch_failed | An MCP command never started: its launch stopped before anything was claimed or ran, or — launch_failed — its start gate never released the payload: run.sh recorded unlaunched or a reconciler took the release token first — nothing ran; call again. |
cancelled | The command or transfer was stopped — by tasks/cancel / corestack_command_cancel / the Control Panel's Stop, or because its grant ended; reported only once the run is proven stopped; nothing to do; a revoked grant cannot read it anyway. |
timed_out | An MCP command exited non-zero — any non-zero exit of a payload that was started, 125 included — ran out of time, ended without a status, or lost its container; status and exit code in details; read the output (corestack_command_output_get). |
managed_elsewhere | Another control panel manages this site, so use that control panel for it. This is refused before anything else about the site, as in the Control Panel and the API. Nothing was done. |
invalid_arguments | The arguments do not match the tool's input schema, or the Control Panel refused a field. Fix the fields named in the answer and call again. |
tenant_mismatch | The object does not exist or the token may not see it. Check the id. |
scope_required | The token lacks a scope this call needs. Open the link in the answer to add it, then call again. |
pin_refused | The grant is limited to chosen clusters, sites or environments, and this call is outside them. Open the link in the answer to widen it. |
rate_limited | Too many calls. Wait for the number of seconds the answer names. |
temporarily_unavailable | The Control Panel could not answer just now. Nothing was started; try again shortly. |
internal_error | Something went wrong on our side. Quote the trace id to support. |