Skip to main content

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:

Using uvx
"mcpServers": {
  "shell": {
    "command": "uvx",
    "args": ["mcp-server-shell"]
  }
}
Using pip installation
"mcpServers": {
  "shell": {
    "command": "python",
    "args": ["-m", "mcp_server_shell"]
  }
}

Configure for Zed

Add to your Zed settings.json:

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

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.

Metadata

Release files for mcp-server-shell 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-server-shell 0.1.0
File Size Uploaded Provenance
mcp_server_shell-0.1.0.tar.gz 20.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-server-shell 0.1.0
File Interpreter ABI Platform
mcp_server_shell-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.3 kB

Release files / mcp_server_shell-0.1.0.tar.gz

Download URL mcp_server_shell-0.1.0.tar.gz
Size 20.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b00ccba3c442ca93aed36f3625eb860d665fd46c7fd1960e6c98a636a4fbcb6a
BLAKE2b-256 checksum
How to use checksums
3832feec56cb1654bb4fda83aae985fa8bbd5840598381d615aaf0a6d61eeca7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.5

Release files / mcp_server_shell-0.1.0-py3-none-any.whl

Download URL mcp_server_shell-0.1.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f52bec43f70ba0d128fee3af5f1061c0427dfa2abbe30a61c36a78f1fbc37a0a
BLAKE2b-256 checksum
How to use checksums
c3c0e208b4e1c6ca8c04a7038fd160e0e44c8395800c1c970433ba437cf74fb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.5

Security for mcp-server-shell 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page