Shell MCP Server

Shell MCP Server

A Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.

odysseus0

OS Automation
Visit Server

README

Shell MCP Server

A Model Context Protocol server that provides shell command execution capabilities. This server enables LLMs to execute shell commands and receive their output in a controlled manner.

Available Tools

  • execute_command - Execute a shell command and return its output
    • Required arguments:
      • command (string): Shell command to execute
    • Returns:
      • Command result containing:
        • command: The executed command
        • output: Combined stdout and stderr output
        • return_code: Command execution return code

Installation

Using uv (recommended)

When using uv no specific installation is needed. We will use uvx to directly run mcp-server-shell.

Using PIP

Alternatively you can install mcp-server-shell via pip:

pip install mcp-server-shell

After installation, you can run it as a script using:

python -m mcp_server_shell

Configuration

Configure for Claude.app

Add to your Claude settings:

<details> <summary>Using uvx</summary>

"mcpServers": {
  "shell": {
    "command": "uvx",
    "args": ["mcp-server-shell"]
  }
}

</details>

<details> <summary>Using pip installation</summary>

"mcpServers": {
  "shell": {
    "command": "python",
    "args": ["-m", "mcp_server_shell"]
  }
}

</details>

Configure for Zed

Add to your Zed settings.json:

<details> <summary>Using uvx</summary>

"context_servers": {
  "mcp-server-shell": {
    "command": "uvx",
    "args": ["mcp-server-shell"]
  }
},

</details>

<details> <summary>Using pip installation</summary>

"context_servers": {
  "mcp-server-shell": {
    "command": "python",
    "args": ["-m", "mcp_server_shell"]
  }
},

</details>

Example Interactions

Execute a shell command:

{
  "name": "execute_command",
  "arguments": {
    "command": "ls -la"
  }
}

Response:

{
  "command": "ls -la",
  "output": "total 24\ndrwxr-xr-x  5 user  group   160 Jan  1 12:00 .\ndrwxr-xr-x  3 user  group    96 Jan  1 12:00 ..",
  "return_code": 0
}

Debugging

You can use the MCP inspector to debug the server. For uvx installations:

npx @modelcontextprotocol/inspector uvx mcp-server-shell

Or if you've installed the package in a specific directory or are developing on it:

cd path/to/servers/src/shell
npx @modelcontextprotocol/inspector uv run mcp-server-shell

Examples of Questions for Claude

  1. "What files are in the current directory?"
  2. "Show me the contents of the README.md file"
  3. "What's the current system date?"
  4. "Check if Python is installed and show its version"

Security Considerations

⚠️ Warning: This server executes shell commands directly on your system. Use with caution and implement appropriate security measures to prevent unauthorized or dangerous command execution.

Contributing

We encourage contributions to help expand and improve mcp-server-shell. Whether you want to add new features, enhance security, or improve documentation, your input is valuable.

For examples of other MCP servers and implementation patterns, see: https://github.com/modelcontextprotocol/servers

Pull requests are welcome! Feel free to contribute new ideas, bug fixes, or enhancements to make mcp-server-shell even more powerful and useful.

License

mcp-server-shell is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

Recommended Servers

@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
ThingsPanel MCP

ThingsPanel MCP

An integration server that connects AI models with ThingsPanel IoT platform, allowing AI assistants to interact with IoT devices through natural language for device control, data retrieval, and management operations.

Official
Python
Beamlit MCP Server

Beamlit MCP Server

An MCP server implementation that enables seamless integration between Beamlit CLI and AI models using the Model Context Protocol standard.

Official
TypeScript
mcp-screenshot

mcp-screenshot

Provides screenshot and OCR capabilities for macOS.

Local
JavaScript
macOS Defaults MCP Server

macOS Defaults MCP Server

MCP server that enables reading and writing macOS system preferences and application settings through the defaults system.

Local
Python
MCP Command Server

MCP Command Server

A secure server that allows LLM applications like Claude to execute whitelisted system commands with user confirmation and comprehensive security features.

Local
Python
iTerm MCP Server

iTerm MCP Server

This MCP server enables users to execute shell commands in the current iTerm2 session through integration with Claude Desktop, facilitating seamless command execution via the Model Context Protocol.

Local
TypeScript
WinTerm MCP

WinTerm MCP

A Model Context Protocol server that provides programmatic access to the Windows terminal, enabling AI models to interact with the Windows command line through standardized tools for writing commands, reading output, and sending control signals.

Local
JavaScript
Everything Search MCP Server

Everything Search MCP Server

Provides integration with Everything Search Engine allowing powerful file search capabilities through the Model Context Protocol with advanced search options like regex, case sensitivity, and sorting.

Local
JavaScript