Create service
spm_create_serviceCreate and immediately start a persistent service from a command, replacing background processes for long-lived dev servers, workers, and bots that must outlive the session.
Instructions
Create a new persistent service from a command and start it immediately. By default it restarts when it exits and starts again at login, so use it instead of running long-lived processes in the background (&, nohup, start /b) for dev servers, workers and bots that must outlive the session. Use spm_start_service or spm_enable_service for a service that already exists. If the name is taken the call fails; set force=true only after the user agrees to replace that service. Put secrets in an env_file, never in command arguments. Afterwards, call spm_get_logs to confirm it started. Acts on the current user's services unless system is true; machine-wide services need root on Linux and macOS or an Administrator shell on Windows, so only use system when the user asks for it.
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": {
"name": "<name>",
"command": "<command>"
},
"name": "spm_create_service"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for the command. Defaults to the directory the MCP server runs in, so pass the project directory explicitly. | |
| name | Yes | New service name, unique in the scope; letters, numbers, dot, underscore and dash. | |
| force | No | Replace an existing service with the same name. Only with the user's agreement. | |
| system | No | Manage machine-wide services instead of the current user's. Requires root or Administrator; leave false unless the user asks for system scope. | |
| command | Yes | Executable and arguments as separate array elements, for example ["npm", "run", "dev"]. | |
| restart | No | When to restart the process after it exits. | always |
| env_file | No | Path to a KEY=VALUE environment file loaded at start. Use this for secrets instead of putting values in MCP arguments. |