
hdresearch/mcp-shell
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
hdresearch/mcp-shell - кандидат на сервер MCP, импортированный из https://github.com/hdresearch/mcp-shell.
Обзор
hdresearch/mcp-shell - кандидат на сервер MCP, импортированный из https://github.com/hdresearch/mcp-shell.
Обзор (машинный перевод)
Реализация протокола Model Context Protocol (MCP) Node.js, который обеспечивает безопасные возможности выполнения команд оболочки. Этот сервер позволяет моделям ИИ выполнять команды оболочки в контролируемой среде со встроенными мерами безопасности. Легко интегрируется с Claude Desktop для подключения Claude к вашей оболочке.
Особенности
- MCP-совместимая реализация сервера Безопасное выполнение команд с защитой черного списка Проверка существования команд Стандартный транспорт на основе ввода/вывода
- Обработка ошибок и изящное отключение
##Установка
Беги [[Т0]].
Чтобы добавить его в Claude Desktop, запустите npx mcp-shell config. Или добавить npx -y mcp-shell в конфигурацию вручную.
Начните (или перезапустите) Claude Desktop, и вы увидите инструмент MCP, указанный на целевой странице.
Функции безопасности
Сервер реализует несколько мер безопасности:
1.Командир черного списка
Предотвращает выполнение опасных системных команд блокирует доступ к критическим модификациям системы; Защита от разрушения файловой системы Предотвращение эскалации привилегий
2.Командная проверка Проверяет наличие команды перед выполнением Валидаты против черного списка
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Shell MCP Server
A Node.js implementation of the Model Context Protocol (MCP) that provides secure shell command execution capabilities. This server allows AI models to execute shell commands in a controlled environment with built-in security measures. Easily integrates with Claude Desktop for connecting Claude with your shell.
Features
- MCP-compliant server implementation
- Secure command execution with blacklist protection
- Command existence validation
- Standard I/O based transport
- Error handling and graceful shutdown
Installation
Run npx mcp-shell.
To add it to Claude Desktop, run npx mcp-shell config. Or add npx -y mcp-shell to your config manually.
Start (or restart) Claude Desktop and you should see the MCP tool listed on the landing page.
Security Features
The server implements several security measures:
-
Command Blacklisting
- Prevents execution of dangerous system commands
- Blocks access to critical system modifications
- Protects against file system destruction
- Prevents privilege escalation
-
Command Validation
- Verifies command existence before execution
- Validates against the blacklist
- Returns clear error messages for invalid commands
Available Tools
The server provides one tool:
run_command
Executes a shell command and returns its output.
Input Schema:
{
"type": "object",
"properties": {
"command": { "type": "string" }
}
}
Response:
- Success: Command output as plain text
- Error: Error message as plain text
Blacklisted Commands
The following command categories are blocked for security:
- File System Destruction Commands (rm, rmdir, del)
- Disk/Filesystem Commands (format, mkfs, dd)
- Permission/Ownership Commands (chmod, chown)
- Privilege Escalation Commands (sudo, su)
- Code Execution Commands (exec, eval)
- System Communication Commands (write, wall)
- System Control Commands (shutdown, reboot, init)
Error Handling
The server includes comprehensive error handling:
- Command not found errors
- Blacklisted command errors
- Execution errors
- MCP protocol errors
- Graceful shutdown on SIGINT
Implementation Details
The server is built using:
- Model Context Protocol SDK
- StdioServerTransport for communication
- execa for command execution
- command-exists for command validation
Development
To modify the security settings, you can:
- Edit the
BLACKLISTED_COMMANDSset to adjust blocked commands - Modify the
validateCommandfunction to add additional validation rules - Enhance the command parsing logic in the
CallToolRequestSchemahandler
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →