Mac Shell
About
Enables secure execution of macOS terminal commands through a ZSH shell with a whitelist system that categorizes operations as safe, requiring approval, or forbidden.
Details
- Author
- cfdude
- Repository
- cfdude/mac-shell-mcp
- GitHub stars
- 14
- Downloads
- 603
- License
- MIT License
- Categories
- Productivity, Design, Developer Tools, AI, Infrastructure, Security, Frontend
Jump to
- Execute macOS terminal commands through MCP
- Command whitelisting with security levels:
- Safe: Commands that can be executed without approval
- Requires Approval: Commands that need explicit approval before execution
- Forbidden: Commands that are explicitly blocked
- Pre-configured whitelist with common safe commands
- Approval workflow for potentially dangerous commands
- Comprehensive command management tools
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Mac ShellCommand (node, npx, python, etc.)nodeArguments-
Argument 1
/path/to/mac-shell-mcp/build/index.js
Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
-
Argument 1
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
npm install
Both Roo Code and Claude Desktop use a similar configuration format for MCP servers. Here's how to set up the Mac Shell MCP server:
"mac-shell": {
"command": "npx",
"args": [
"-y",
"mac-shell-mcp"
],
"alwaysAllow": [],
"disabled": false
}
"mac-shell": {
"command": "npx",
"args": [
"-y",
"mac-shell-mcp"
],
"alwaysAllow": false,
"disabled": false
}
This approach allows the MCP server to be started automatically by the MCP client without requiring a separate terminal window or manual intervention.
> Note:
> - For Roo Code: Setting alwaysAllow to an empty array [] is recommended for security reasons, as it will prompt for approval before executing any commands. If you want to allow specific commands without prompting, you can add their names to the array, for example: "alwaysAllow": ["execute_command", "get_whitelist"].
> - For Claude Desktop: Setting alwaysAllow to false is recommended for security reasons. Claude Desktop uses a boolean value instead of an array, where false means all commands require approval and true means all commands are allowed without prompting.
>
> Important: The alwaysAllow parameter is processed by the MCP client (Roo Code or Claude Desktop), not by the Mac Shell MCP server itself. The server will work correctly with either format, as the client handles the approval process before sending requests to the server.
Add the following to your MCP settings configuration:
execute_command
Execute a shell command on macOS. Parameters: command (string), args (array of strings)
get_whitelist
Get the list of whitelisted commands. Parameters: None
add_to_whitelist
Add a command to the whitelist. Parameters: command (string), securityLevel (string), description (string)
update_security_level
Update the security level of a whitelisted command. Parameters: command (string), securityLevel (string)
remove_from_whitelist
Remove a command from the whitelist. Parameters: command (string)
get_pending_commands
Get the list of commands pending approval. Parameters: None
approve_command
Approve a pending command. Parameters: commandId (string)
deny_command
Deny a pending command. Parameters: commandId (string), reason (string)
The server exposes the following MCP tools:
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mac shell": {
"cwd": "optional",
"env": {},
"args": [
"/path/to/mac-shell-mcp/build/index.js"
],
"command": "node"
}
}
}
Linux
{
"env": [],
"args": [
"/path/to/mac-shell-mcp/build/index.js"
],
"command": "node"
}
Macos
{
"cwd": "optional",
"env": [],
"args": [
"/path/to/mac-shell-mcp/build/index.js"
],
"command": "node"
}
Windows
{
"env": [],
"args": [
"/c",
"node",
"/path/to/mac-shell-mcp/build/index.js"
],
"command": "cmd"
}
Mac Shell MCP Server
An MCP (Model Context Protocol) server for executing macOS terminal commands with ZSH shell. This server provides a secure way to execute shell commands with built-in whitelisting and approval mechanisms.
<a href="https://glama.ai/mcp/servers/@cfdude/mac-shell-mcp">
</a>
Features
- Execute macOS terminal commands through MCP
- Command whitelisting with security levels:
- Safe: Commands that can be executed without approval
- Requires Approval: Commands that need explicit approval before execution
- Forbidden: Commands that are explicitly blocked
- Pre-configured whitelist with common safe commands
- Approval workflow for potentially dangerous commands
- Comprehensive command management tools
Installation
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





