HM

hdresearch/mcp-shell

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

41 stars 8 forks 품질 61 트렌드 0MIT

hdresearch/mcp-shell는 MCP 서버 후보자는 https://github.com/hdresearch/mcp-shell.에서 수입했습니다

개요

hdresearch/mcp-shell는 MCP 서버 후보자는 https://github.com/hdresearch/mcp-shell.에서 수입했습니다

개요(AI 번역)

안전한 쉘 명령 실행 기능을 제공하는 Model Context Protocol (MCP)의 Node.js 구현. 이 서버는 AI 모델을 사용하여 내장 보안 측정을 사용하여 제어 된 환경에서 쉘 명령을 실행할 수 있습니다. 쉘과 Claude를 연결하기 위해 Claude Desktop과 쉽게 통합합니다.

특징

  • MCP-compliant 서버 구현
  • 블랙리스트 보호와 보안 명령 실행
  • 명령 존재 검증
  • 표준 I/O 기반 운송
  • 오류 처리 및 우아한 폐쇄

설치

실행 npx mcp-shell.

Claude Desktop에 추가하려면 npx mcp-shell config를 실행하십시오. 또는 npx -y mcp-shell를 수동으로 설정한다.

시작 (또는 다시 시작) Claude Desktop 당신은 착륙 페이지에서 MCP 도구를 볼 수 있어야합니다.

보안 기능

서버는 여러 보안 조치를 구현합니다.

  1. 명령 블랙리스트링
  • 위험한 시스템 명령의 실행 방지
  • 중요한 시스템 수정에 대한 블록 접근
  • 파일 시스템 파괴에 대한 보호
  • 특권 에스컬레이션 방지
  1. 명령 검증
  • 실행하기 전에 명령 존재를 검증
  • 블랙리스트에 대한 검증

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

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:

  1. Command Blacklisting

    • Prevents execution of dangerous system commands
    • Blocks access to critical system modifications
    • Protects against file system destruction
    • Prevents privilege escalation
  2. 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:

  1. Edit the BLACKLISTED_COMMANDS set to adjust blocked commands
  2. Modify the validateCommand function to add additional validation rules
  3. Enhance the command parsing logic in the CallToolRequestSchema handler
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →