saci-script-runner is a Saci module. It makes administrator-configured
scripts available as MCP tools over Streamable HTTP. Each script is one tool.
An MCP client, for example a Saci worker, Wanaku or an agent, can list the
tools and call them.
The runner is part of the Saci distribution: make install installs it and
the Saci image contains it. It is not necessary to run Saci. It is a separate
binary, no other Saci binary depends on it, and Saci does not start it. To
use it, write a configuration and start it yourself.
tools/list shows one tool for each configured script, with its
description and a JSON Schema of its arguments.tools/call, the runner examines the arguments again against the
configuration. Then it runs the configured executable with the values as
separate arguments. It does not use a shell to make a command line.The client cannot select an executable, a flag, a working directory or an environment variable. It can only select a configured tool and give values that the configuration permits.
Install the binary with make install (install Saci),
or use the Saci image (see Container).
The example in examples/script-runner/ uses absolute script paths below
/opt/saci-script-runner. To try it from a checkout, change the paths and
start the runner:
sed "s|/opt/saci-script-runner|$PWD/examples/script-runner|" \
examples/script-runner/config.yaml > /tmp/script-runner.yaml
saci-script-runner --config /tmp/script-runner.yaml --check-config
saci-script-runner --config /tmp/script-runner.yaml
| Option | Meaning |
|---|---|
--config, -c |
Configuration file. Default script-runner.yaml. |
--check-config |
Check the configuration, including the scripts, and stop. Exit code 0 means the configuration is valid. |
Set the log level with RUST_LOG, for example RUST_LOG=info. SIGINT and
SIGTERM stop the server. Before it stops, the runner stops all running
scripts and waits until they are reaped.
Connect an MCP client to http://127.0.0.1:3000/mcp. With curl:
# Send one JSON-RPC message. The commands work in bash and zsh.
mcp() {
curl -s -D headers.txt "$@" \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
http://127.0.0.1:3000/mcp -d "$BODY"
}
BODY='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}' mcp
SID=$(grep -i mcp-session-id headers.txt | cut -d' ' -f2 | tr -d '\r')
session() { mcp -H "mcp-session-id: $SID" -H 'mcp-protocol-version: 2025-06-18'; }
BODY='{"jsonrpc":"2.0","method":"notifications/initialized"}' session
BODY='{"jsonrpc":"2.0","id":2,"method":"tools/list"}' session
BODY='{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"greet","arguments":{"name":"Ada","language":"pt"}}}' session
The last call runs greet.sh --name Ada --language pt and returns
"stdout":"Olá, Ada!\n".
If server.auth.token is set, add -H "authorization: Bearer $TOKEN" to
the curl command in mcp.
To use the runner from Saci test plans, add it as an HTTP server in the backend configuration (MCP servers):
mcp_servers:
scripts:
url: http://script-runner:3000/mcp
headers:
Authorization: Bearer ${SCRIPT_RUNNER_TOKEN}
To send the results of each run by email, see email the results of each run.
The configuration file lists the tools, their arguments and the execution limits. A tool runs one absolute script path, and each argument has a binding to a flag or a position. See the script runner configuration for every setting, the value rules, the call results and the execution rules.
Trust model:
Do these steps:
eval or in an unquoted expansion can
still be attacked. Use enum or a strict pattern for each value.auth.token. For remote
access, also put the runner behind a gateway that authenticates clients,
and make sure that clients cannot connect to the runner directly. Set
allowed_hosts to the names that clients use. CORS is not
authentication.The Saci image (the worker) contains
/usr/local/bin/saci-script-runner. To run the runner from the image, set it
as the entry point and mount your configuration and scripts read-only. The
image runs as UID 10001, which cannot write the mounted scripts.
A runner in a container must listen on all interfaces, so it needs a token:
server:
bind: "0.0.0.0:3000"
auth:
token: { env: SCRIPT_RUNNER_TOKEN }
allowed_hosts: [script-runner, localhost, 127.0.0.1]
podman run --rm -p 127.0.0.1:3000:3000 --read-only \
--pids-limit 256 --memory 256m \
-e SCRIPT_RUNNER_TOKEN \
-v ./runner.yaml:/etc/saci-script-runner/config.yaml:ro,Z \
-v ./scripts:/opt/saci-script-runner/scripts:ro,Z \
--entrypoint /usr/local/bin/saci-script-runner \
localhost/saci-worker:latest --config /etc/saci-script-runner/config.yaml
The image does not contain the example scripts. The Helm chart does not start the runner.