Mac Shell

by cfdude

14 603 downloads Not rated yet MIT

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

Repository
cfdude/mac-shell-mcp
License
MIT

Explore

- 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:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Mac Shell
    Command (node, npx, python, etc.) node
    Arguments
    • 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.

  4. 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:

Add the following to your Roo Code MCP settings configuration file (located at ~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json):

json
"mac-shell": {
"command": "node",
"args": [
"/path/to/mac-shell-mcp/build/index.js"
],
"alwaysAllow": [],
"disabled": false
}

Add the following to your Claude Desktop configuration file (located at ~/Library/Application Support/Claude/claude_desktop_config.json):

json
"mac-shell": {
"command": "node",
"args": [
"/path/to/mac-shell-mcp/build/index.js"
],
"alwaysAllow": false,
"disabled": false
}
``

Replace /path/to/mac-shell-mcp` with the actual path where you cloned the repository.

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"
}

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">
Mac Shell Server MCP server
</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

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.