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
):
Rule Configuration
Add the following to your Cursor rules file:
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 execute
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.
Tools
A server that uses the Model Context Protocol (MCP) to allow AI agents to safely execute shell commands on a host system.