home / mcp / script mcp server
Executes command line scripts through MCP with timeout, output capture, and cross‑platform support.
Configuration
View docs{
"mcpServers": {
"nguyenvanduocit-script-mcp": {
"command": "/path-to/script-mcp",
"args": []
}
}
}The Script Tool lets you run command line scripts through MCP, enabling safe, cross-platform execution with timeout protection and clear output handling. It is useful when you want a consistent way to trigger CLI tasks from an MCP client without rewriting your scripts for every environment.
You use the Script Tool by configuring MCP to point to a local stdio server that runs the script executor, then issuing commands from your MCP client. This setup lets you execute arbitrary command line scripts, capture their stdout and stderr, and apply timeout protections to prevent hanging tasks. Use the tool to automate build steps, batch scripts, or any CLI workflow you want to expose through MCP. The executor supports different interpreters and works across Linux, macOS, and Windows.
Prerequisites: you need a working Go toolchain or a prebuilt binary for your platform.
# Option 1: Download from releases
# Linux
chmod +x script-mcp_linux_amd64
sudo mv script-mcp_linux_amd64 /usr/local/bin/script-mcp
# macOS
chmod +x script-mcp_darwin_amd64
sudo mv script-mcp_darwin_amd64 /usr/local/bin/script-mcp
# Windows (PowerShell)
# Download script-mcp_windows_amd64.exe and add its folder to PATHOption 2: Install via Go (requires Go to be installed on your system.)
go install github.com/nguyenvanduocit/script-mcp@latestConfigure MCP to run the Script Tool as a local stdio server. Use the following JSON snippet to register the server under the name script.
{
"mcpServers": {
"script": {
"command": "/path-to/script-mcp"
}
}
}- The stdio server command is the executable that runs the Script Tool. If your setup requires specific environment variables, supply them in your MCP client configuration or shell before starting the server.
Executes a given command line script and returns its exit code, stdout, and stderr to the MCP client.
Supports running scripts with different interpreters (bash/sh, Python, Node.js, etc.) via the underlying system shell.
Applies a timeout to script execution to prevent long-running tasks from hanging MCP workflows.
Captures standard output and error streams for precise feedback and logging in MCP.
Operates consistently across Linux, macOS, and Windows environments.