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.
Overview
Mac Shell MCP is an MCP (Model Context Protocol) server designed for executing macOS terminal commands using the ZSH shell. It provides a secure environment for command execution with built-in whitelisting and approval mechanisms.
To use Mac Shell MCP, clone the repository from GitHub, install the dependencies, and start the server using npm. You can configure it in applications like Roo Code and Claude Desktop to execute commands securely.
- Execute macOS terminal commands through MCP. - Command whitelisting with security levels: Safe, Requires Approval, and Forbidden. - Pre-configured whitelist with common safe commands. - Approval workflow for potentially dangerous commands. - Comprehensive command management tools.
- Securely executing terminal commands in macOS applications.
- Managing command execution permissions for different users.
- Integrating with development tools that require terminal command execution.
Add to your AI client
Use these steps to connect Mac Shell MCP Server in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"mac-shell-mcp-cfdude": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mac-shell-mcp-cfdude"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"mac-shell-mcp-cfdude": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mac-shell-mcp-cfdude"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"mac-shell-mcp-cfdude": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mac-shell-mcp-cfdude"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"mac-shell-mcp-cfdude": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mac-shell-mcp-cfdude"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"mac-shell-mcp-cfdude": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mac-shell-mcp-cfdude"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"mac-shell-mcp-cfdude": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-mac-shell-mcp-cfdude"
]
}
}
}FAQ
Can I execute any terminal command?
No, commands are subject to whitelisting and approval based on their security level.
How do I add a command to the whitelist?
You can use the `add_to_whitelist` tool to add commands with specified security levels.
Is there a way to run the server without a terminal window?
Yes, you can use npx to run the server automatically without keeping a terminal open.7:["$","div",null,{"className":"container mx-auto flex flex-col gap-4","children":["$L26","$L27",["$","$L28",null,{"currentProject":{"id":2372,"uuid":"042837ad-4ee8-4169-b58c-97278cf5c75a","name":"mac-shell-mcp","title":"Mac Shell MCP Server","description":"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.","avatar_url":"https://avatars.githubusercontent.com/u/1118320?v=4","created_at":"2025-03-13T07:03:22.362+00:00","updated_at":"2025-03-13T07:15:16.793+00:00","status":"created","author_name":"cfdude","author_avatar_url":"https://avatars.githubusercontent.com/u/1118320?v=4","tags":"zsh,mac,mcp","category":"os-automation","is_featured":false,"sort":1,"url":"https://github.com/cfdude/mac-shell-mcp","target":"_self","content":"$29","summary":"$2a","img_url":null,"type":null,"metadata":"{\"star\":\"1\",\"license\":\"\",\"language\":\"JavaScript\",\"is_official\":false,\"latest_commit_time\":\"2025-03-12 22:59:44\"}","user_uuid":null,"tools":null,"sse_url":null,"sse_provider":null,"sse_params":null,"is_official":false,"server_command":null,"server_params":null,"server_config":null,"allow_call":false,"is_innovation":false,"is_dxt":false,"dxt_manifest":null,"dxt_file_url":null,"is_audit":false},"randomProjects":[],"currentServerKey":"$undefined"}]]}]