Agent♥︎Age
Catalog

io.github.MukundaKatta/shellquote-mcp

Official

by MukundaKatta · JavaScript

Safe shell argument escaping for bash, cmd.exe, and PowerShell.

io.github.MukundaKatta/shellquote-mcp (MCP)

This MCP server provides safe shell argument escaping for bash, cmd.exe, and PowerShell. Its purpose is to prevent LLM-generated shell commands from breaking on quotes, spaces, $VAR interpolation, and backslashes. It exposes tools for quoting individual arguments and, for bash, quoting and joining argument lists.

🛠️ Key Features

  • quote_bash(arg): single-quote escape for bash/sh/zsh; suppresses metacharacter expansion
  • quote_bash_argv(args): escapes a list of arguments and joins with spaces
  • quote_cmd(arg): Windows cmd.exe quoting, noting delayed-expansion corner cases
  • quote_powershell(arg): single-quoted PowerShell string quoting

🚀 Use Cases

  • Escaping arguments to keep generated shell commands from failing due to quotes/spaces/backslashes
  • Preventing unwanted $VAR interpolation in shell contexts

⚡ Developer Benefits

  • Dedicated escaping per shell: bash, cmd.exe, and PowerShell
  • Supports both single-argument quoting and bash argv quoting

⚠️ Limitations

  • quote_cmd(arg) includes a stated caveat: cmd.exe has “unfixable delayed-expansion corners.”