Cover image
Try Now
2024-12-12

3 years

Works with Finder

2

Github Watches

2

Github Forks

2

Github Stars

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.

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Andris Teikmanis
  • Latvian GPT assistant for developing GPT applications

  • https://hubeiqiao.com
  • IT problem solver with clear, step-by-step guidance.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Navid RezaeiSarchoghaei
  • Professional Flask/SQLAlchemy code guide. Follow: https://x.com/navid_re

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • https://cantaspinar.com
  • Summarizes videos and answers related questions.

  • apappascs
  • Descubra la colección más completa y actualizada de servidores MCP en el mercado. Este repositorio sirve como un centro centralizado, que ofrece un extenso catálogo de servidores MCP de código abierto y propietarios, completos con características, enlaces de documentación y colaboradores.

  • ShrimpingIt
  • Manipulación basada en Micrypthon I2C del expansor GPIO de la serie MCP, derivada de AdaFruit_MCP230xx

  • OffchainLabs
  • Implementación de la prueba de estaca Ethereum

  • oatpp
  • Implementación del protocolo de contexto modelo de Anthrope para OAT ++

  • huahuayu
  • Una puerta de enlace de API unificada para integrar múltiples API de explorador de blockchain similar a Esterscan con soporte de protocolo de contexto modelo (MCP) para asistentes de IA.

  • deemkeen
  • Controle su MBOT2 con un combo de potencia: MQTT+MCP+LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocolo del conector de mensajes )服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 支持员工信息查询和消息发送等功能。 支持员工信息查询和消息发送等功能。

    Reviews

    4 (1)
    Avatar
    user_31E39Rfd
    2025-04-15

    As a dedicated user of the Contextual MCP Server by ContextualAI, I find it to be an exceptional tool for managing and deploying contextual AI applications. The seamless integration and user-friendly interface make it ideal for both beginners and experienced users. The real-time processing capabilities have significantly improved our workflow, providing precise and relevant context-based insights. Highly recommend checking it out at https://mcp.so/server/contextual-mcp-server/ContextualAI.