Integrations
Enables execution of Git commands through the shell interface, allowing AI agents to perform version control operations like commits, pulls, pushes, and branch management.
Supports running npm commands through the shell interface, enabling package management operations like installing, updating, and removing JavaScript packages.
Facilitates running pnpm commands through the shell interface, offering fast, disk-space efficient package management for JavaScript projects.
MCP Shell Server
A server that uses the Model Context Protocol (MCP) to execute shell commands. It functions as a bridge that allows AI agents to safely execute shell commands.
Features
- Execute shell commands (single-line and multi-line support)
- Support for various shells (bash, zsh, fish, powershell, cmd, etc.)
- Detailed error handling and logging
- MCP Inspector compatible
Installation
From npm (as a user)
From source (for development)
MCP Configuration
Cursor Configuration
Add the following to your Cursor configuration file (~/.cursor/config.json
):
Cline Integration
Cline is a VS Code extension that allows you to use MCP servers with Claude AI. To set up this MCP shell server with Cline:
- Open your Cline MCP settings file:
- macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
- Windows:
%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
- Linux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
- macOS:
- Add the shell server MCP configuration:Alternatively, if you want to use a locally installed package:CopyCopy
Rule Configuration
Add the following to your AI assistant's rules or prompt:
Usage
Direct Execution
Development Mode
Testing with MCP Inspector
Command Line Arguments
Tool Reference
shell_exec
Executes commands in the specified shell.
Parameters:
command
(string, required): The shell command to executeworkingDir
(string, optional): The working directory to execute the command in. Must be under $HOME.
Resource Reference
The server provides the following system information as resources:
hostname
Returns the hostname of the system.
URI: hostname://
platform
Returns the operating system platform.
URI: platform://
shell
Returns the shell path being used by the server.
URI: shell://
username
Returns the current username.
URI: username://
system-info
Returns comprehensive system information in JSON format, including:
- hostname
- platform
- shell
- username
- CPU count
- Total memory
- Free memory
- System uptime
Usage Examples
Basic Command Execution
Multi-line Command (Heredoc) Execution
Development
Project Structure
Logging
Logs are written to the mcp-shell.log
file.
License
MIT
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
A server that uses the Model Context Protocol (MCP) to allow AI agents to safely execute shell commands on a host system.
Related MCP Servers
- AsecurityAlicenseAqualityA secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.Last updated -174PythonMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server that allows AI models to safely access and interact with local file systems, enabling reading file contents, listing directories, and retrieving file metadata.Last updated -471JavaScriptMIT License
- -securityAlicense-qualityA secure, container-based implementation of the Model Context Protocol (MCP) that provides sandboxed environments for AI systems to safely execute code, run commands, access files, and perform web operations.Last updated -4PythonApache 2.0
- AsecurityAlicenseAqualityA server that enables AI assistants to execute terminal commands and retrieve outputs via the Model Context Protocol (MCP).Last updated -33PythonMIT License