Run Command in Background
run_command_backgroundExecute a long-running command in the background and obtain its process ID for managing the process later. Requires user approval.
Instructions
Start a long-running command in the background and return immediately with its process ID. ALWAYS requires interactive user approval before running.
Args:
command (string): The command to execute.
cwd (string, optional): Working directory. Defaults to the first allowed directory.
Returns: the process ID (pid), which can be used with list_processes and kill_process.
Note: background processes have no timeout, but they are tracked and can be killed with kill_process. They do not survive this server process restarting (e.g. Claude Desktop being closed and reopened).
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": {
"command": "<command>"
},
"name": "run_command_background"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for the command | |
| command | Yes | Shell command to execute in the background |