About shellquote-mcp
shellquote-mcp is an MCP server that escapes shell arguments for bash, cmd.exe, and PowerShell. It is intended for agents and developers generating commands that must preserve argument text across shell parsing.
Key features
- 01Quote arguments for bash, sh, and zsh
- 02Escape and join bash argument lists
- 03Quote arguments for cmd.exe
- 04Quote strings for PowerShell
Use cases
- 01Pass arguments containing spaces safely
- 02Preserve literal dollar signs and backslashes
- 03Handle embedded single quotes in bash
- 04Prepare arguments for Windows shells
MCP support
Exposes shell-quoting tools to MCP clients for bash, cmd.exe, and PowerShell arguments.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
4Saved tool list · updated 3w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| arg | string | Yes |
Details
From the project README@mukundakatta/shellquote-mcp
MCP server for safe shell argument escaping. Stops LLM-generated shell commands from breaking (or worse) on quotes, spaces, $VAR interpolation, and backslashes.
Tools
quote_bash(arg)— single-quote escape for bash/sh/zsh. Suppresses all metacharacter expansion.quote_bash_argv(args)— escape a list and join with spaces.quote_cmd(arg)— Windows cmd.exe (caveat: cmd has unfixable delayed-expansion corners).quote_powershell(arg)— single-quoted PS string.
Why this exists
LLMs constantly get shell escaping wrong:
bash -c "echo $HOME"interpolates the variable instead of passing it literalcmd /c "del file.txt"breaks if the filename has spaces- Embedded single quotes in bash require the awkward
'\''dance the LLM forgets
This tool returns a string the shell will accept verbatim, with no metacharacter surprises.
Install — Claude Desktop
{
"mcpServers": {
"shellquote": { "command": "npx", "args": ["-y", "@mukundakatta/shellquote-mcp"] }
}
}
Same shape for Cursor / Cline / Windsurf / Zed.
License
MIT OR Apache-2.0.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.