Script Tool
March 13, 2026 ยท View on GitHub
A tool for executing command line scripts through MCP.
Features
- Execute command line scripts safely
- Support for different interpreters
- Timeout protection
- Output and error capture
- Cross-platform support (Linux, macOS, Windows)
Installation
There are several ways to install the Script Tool:
Option 1: Download from GitHub Releases
- Visit the GitHub Releases page
- Download the binary for your platform:
- script-mcp_linux_amd64` for Linux
script-mcp_darwin_amd64for macOSscript-mcp_windows_amd64.exefor Windows
- Make the binary executable (Linux/macOS):
chmod +x script-mcp_* - Move it to your PATH (Linux/macOS):
sudo mv script-mcp_* /usr/local/bin/script-mcp@latest
Option 2: Go install
go install github.com/nguyenvanduocit/script-mcp
Config
Claude
{
"mcpServers": {
"script": {
"command": "/path-to/script-mcp"
}
}
}
CLI Usage
In addition to the MCP server, script-mcp ships a standalone CLI binary (script-cli) for direct terminal use โ no MCP client needed.
Installation
just install-cli
# or
go install github.com/nguyenvanduocit/script-mcp/cmd/script-cli@latest
Quick Start
No credentials required. The CLI executes scripts locally.
script-cli execute --content "echo Hello, World!"
Commands
| Command | Description |
|---|---|
execute (or exec, run) | Safely execute a script with timeout |
Examples
# Run a shell command
script-cli execute --content "ls -la"
# Run with a specific interpreter
script-cli execute --content "print('Hello')" --interpreter /usr/bin/python3
# Run with a working directory
script-cli execute --content "pwd" --working-dir /tmp
# Run a multi-line script
script-cli execute --content "#!/bin/bash
echo 'Starting...'
date
echo 'Done'"
# JSON output (captures stdout/stderr separately)
script-cli exec --content "echo hello" --output json
Flags
| Flag | Description |
|---|---|
--content | Script content to execute (required) |
--interpreter | Interpreter path (default: /bin/sh) |
--working-dir | Working directory for execution |
--env | Path to .env file |
--output | Output format: text (default) or json |
Note: Scripts time out after 30 seconds.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Installation
Homebrew (macOS/Linux)
brew install nguyenvanduocit/tap/script-mcp