Get the FREE Ultimate OpenClaw Setup Guide →

any-script

An MCP server that exposes arbitrary CLI tools and shell scripts as MCP Tools

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio izumin5210-any-script-mcp npx any-script-mcp \
  --env ANY_SCRIPT_MCP_CONFIG="Path to YAML config or multiple paths separated by colon (Unix) or semicolon (Windows)"

How to use

any-script-mcp is an MCP server that publishes arbitrary CLI tools and shell scripts as MCP Tools. Tools are defined in a YAML configuration file and can be executed remotely by MCP clients, enabling you to run shell commands, scripts, or CLI utilities as standardized MCP Tools. The server supports multiple tools loaded from one or more configuration files, with environment-based inputs and optional shell overrides to accommodate different runtimes.

To use it, first install and run the MCP server with a configuration that defines the tools you want to expose. Each tool has a name, a description, input parameters, a run script, and optional settings like the shell to use and a timeout. Inputs are provided by MCP clients and passed into the tool as environment variables (INPUTS__{NAME}) or as a JSON object in INPUTS_JSON, so you can write scripts in bash, Python, Node, or any environment that can read environment variables. You can test tools locally using the MCP Inspector, which opens a web interface to view registered tools and execute them interactively. Tools can do anything a shell script can do, including invoking other CLIs, performing file operations, or orchestrating complex workflows.

Key capabilities include:

  • Exposing arbitrary shell scripts and CLI commands as MCP Tools via YAML tool definitions
  • Flexible input handling via individual INPUTS__ variables and INPUTS_JSON for typed data
  • Optional per-tool shells (bash, Python, Node, etc.) and customizable execution timeouts
  • Inspector tool for testing and validating configurations before deployment

How to install

Prerequisites:

  • Node.js and npm (for npx-based installation and running the MCP server via npx)
  • Git (optional, for cloning repositories)
  • A YAML configuration file that defines the tools you want to expose
  1. Install Node.js and npm
  • On macOS with Homebrew: brew install node
  • On Debian/Ubuntu: sudo apt-get update && sudo apt-get install -y nodejs npm
  • On Windows, install Node.js from https://nodejs.org/
  1. Prepare configuration
  • Create a configuration file in YAML format (e.g., config.yaml) describing the tools to expose. Example structure can be found in the repository’s README under the Example Configuration section.
  1. Run the MCP server via npx
  • If you have a public configuration file path, you can run: ANY_SCRIPT_MCP_CONFIG=/path/to/config.yaml npx any-script-mcp
  • If you want to use a single configuration file, simply run: npx any-script-mcp
  1. Verify with MCP Inspector (optional)
  • To test and view tools, install the inspector and connect it to your running server: npx @modelcontextprotocol/inspector npx any-script-mcp
  1. Optional: Use multiple config files
  • You can specify multiple YAML files by setting ANY_SCRIPT_MCP_CONFIG to a colon-separated (Unix/macOS) or semicolon-separated (Windows) list of file paths. The server will merge tools from all files, with precedence given to the first occurrence of a tool name.

Additional notes

Tips and common considerations:

  • Environment variables: Tools receive inputs via INPUTS__NAME, where NAME is uppercased and non-alphanumeric characters are converted to underscores (e.g., branch-name becomes INPUTS__BRANCH_NAME). You can also access all inputs as a JSON object in INPUTS_JSON for languages that can parse JSON easily.
  • Shell customization: You can set a per-tool shell to run scripts in a specific interpreter (e.g., python {0}, deno run --allow-net {0}, node {0}).
  • Timeouts: The default tool timeout is 5 minutes; you can override with the timeout field in the tool definition if needed for longer-running tasks.
  • Merging behavior: When using multiple configuration files, tools are merged into a single collection. If two files define the same tool name, the first occurrence wins.
  • Security considerations: Since tools can execute arbitrary shell scripts, carefully manage who can access the MCP server and which tools are exposed. Validate YAML configs and consider sandboxing or restricting network access for sensitive tools.

Related MCP Servers

Sponsor this space

Reach thousands of developers