CorefinityCorefinityDocs
Open the Control PanelControl Panel
Commands · 1 of 5

corestack_exec_command

Run a command.

Scope execRuns as a taskNo secrets returned
On this page

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

Prompt
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

commandstringRequired

The shell script to run (bash). It is uploaded as a file, never put on a command line. Up to 262,144 characters.

cwdstring

Relative to the site root, or absolute under it. Default htdocs. Up to 1,024 characters.

envobject

Environment variables for the command: NAME => value.

site_idintegerRequired

At least 1.

timeout_secondsinteger

Defaults to 3600. 1 to 86400.

wait_secondsinteger

How long the call waits before it answers a task. 0 answers a task at once. Defaults to 30.

Example call

tools/call
{
  "name": "corestack_exec_command",
  "arguments": {
    "site_id": 4211,
    "command": "php -v"
  }
}

If it is refused

ReasonWhat to do
command_failedAn 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_interruptedAn 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_failedAn 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.
cancelledThe 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_outAn 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_elsewhereAnother 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_argumentsThe 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_mismatchThe object does not exist or the token may not see it. Check the id.
scope_requiredThe token lacks a scope this call needs. Open the link in the answer to add it, then call again.
pin_refusedThe 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_limitedToo many calls. Wait for the number of seconds the answer names.
temporarily_unavailableThe Control Panel could not answer just now. Nothing was started; try again shortly.
internal_errorSomething went wrong on our side. Quote the trace id to support.

The same task elsewhere

Was this helpful?
Open in ClaudeOpen in ChatGPT