Skip to main content
Glama

mcp-shell-server

by tumf

MCP 셸 서버

모델 컨텍스트 프로토콜(MCP)을 구현하는 보안 셸 명령 실행 서버입니다. 이 서버는 stdin 입력을 지원하여 허용 목록에 있는 셸 명령을 원격으로 실행할 수 있도록 합니다.

특징

  • 보안 명령 실행 : 허용 목록에 있는 명령만 실행할 수 있습니다.
  • 표준 입력 지원 : stdin을 통해 명령에 입력 전달
  • 종합 출력 : stdout, stderr, 종료 상태 및 실행 시간을 반환합니다.
  • Shell Operator Safety : Shell 연산자(;, &&, ||, |) 다음에 나오는 명령을 검증합니다.
  • 시간 제한 제어 : 명령에 대한 최대 실행 시간 설정

Claude.app의 MCP 클라이언트 설정

출판된 버전

지엑스피1

{ "mcpServers": { "shell": { "command": "uvx", "args": [ "mcp-shell-server" ], "env": { "ALLOW_COMMANDS": "ls,cat,pwd,grep,wc,touch,find" } }, } }

로컬 버전

구성
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
{ "mcpServers": { "shell": { "command": "uv", "args": [ "--directory", ".", "run", "mcp-shell-server" ], "env": { "ALLOW_COMMANDS": "ls,cat,pwd,grep,wc,touch,find" } }, } }
설치

Smithery를 통해 설치

Smithery를 통해 Claude Desktop용 Shell Server를 자동으로 설치하려면:

npx -y @smithery/cli install mcp-shell-server --client claude

수동 설치

pip install mcp-shell-server

Smithery를 통해 설치

Smithery를 통해 Claude Desktop용 Shell Server를 자동으로 설치하려면:

npx -y @smithery/cli install mcp-shell-server --client claude

용법

서버 시작

ALLOW_COMMANDS="ls,cat,echo" uvx mcp-shell-server # Or using the alias ALLOWED_COMMANDS="ls,cat,echo" uvx mcp-shell-server

ALLOW_COMMANDS (또는 별칭 ALLOWED_COMMANDS ) 환경 변수는 실행 가능한 명령을 지정합니다. 명령은 쉼표로 구분할 수 있으며, 필요에 따라 공백을 사용할 수 있습니다.

ALLOW_COMMANDS 또는 ALLOWED_COMMANDS에 유효한 형식:

ALLOW_COMMANDS="ls,cat,echo" # Basic format ALLOWED_COMMANDS="ls ,echo, cat" # With spaces (using alias) ALLOW_COMMANDS="ls, cat , echo" # Multiple spaces

요청 형식

# Basic command execution { "command": ["ls", "-l", "/tmp"] } # Command with stdin input { "command": ["cat"], "stdin": "Hello, World!" } # Command with timeout { "command": ["long-running-process"], "timeout": 30 # Maximum execution time in seconds } # Command with working directory and timeout { "command": ["grep", "-r", "pattern"], "directory": "/path/to/search", "timeout": 60 }

응답 형식

성공적인 응답:

{ "stdout": "command output", "stderr": "", "status": 0, "execution_time": 0.123 }

오류 응답:

{ "error": "Command not allowed: rm", "status": 1, "stdout": "", "stderr": "Command not allowed: rm", "execution_time": 0 }

보안

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

  1. 명령 허용 목록 : 명시적으로 허용된 명령만 실행할 수 있습니다.
  2. Shell 연산자 검증 : Shell 연산자(;, &&, ||, |) 뒤에 오는 명령도 허용 목록에 대해 검증됩니다.
  3. 셸 주입 없음 : 셸 해석 없이 명령이 직접 실행됩니다.

개발

개발 환경 설정

  1. 저장소를 복제합니다
git clone https://github.com/yourusername/mcp-shell-server.git cd mcp-shell-server
  1. 테스트 요구 사항을 포함한 종속성 설치
pip install -e ".[test]"

테스트 실행

pytest

API 참조

요청 인수

필드유형필수의설명
명령[]명령과 해당 인수를 배열 요소로 사용
표준입력아니요명령에 전달될 입력
예배 규칙서아니요명령 실행을 위한 작업 디렉토리
타임아웃정수아니요최대 실행 시간(초)

응답 필드

필드유형설명
표준 출력명령의 표준 출력
표준 에러명령의 표준 오류 출력
상태정수종료 상태 코드
실행 시간뜨다실행에 걸리는 시간(초)
오류오류 메시지(실패한 경우에만 표시됨)

요구 사항

  • Python 3.11 이상
  • mcp>=1.1.0

특허

MIT 라이선스 - 자세한 내용은 라이선스 파일을 참조하세요.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

모델 컨텍스트 프로토콜(MCP)을 구현하는 보안 셸 명령 실행 서버입니다. 이 서버는 stdin 입력을 지원하여 허용 목록에 있는 셸 명령을 원격으로 실행할 수 있도록 합니다.

  1. 특징
    1. Claude.app의 MCP 클라이언트 설정
      1. 출판된 버전
      2. 로컬 버전
      3. Smithery를 통해 설치
      4. 수동 설치
      5. Smithery를 통해 설치
    2. 용법
      1. 서버 시작
      2. 요청 형식
      3. 응답 형식
    3. 보안
      1. 개발
        1. 개발 환경 설정
        2. 테스트 실행
      2. API 참조
        1. 요청 인수
        2. 응답 필드
      3. 요구 사항
        1. 특허

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A secure MCP server for executing whitelisted shell commands with resource and timeout controls, designed for integration with Claude and other MCP-compatible LLMs.
            Last updated -
            20
            143
            2
            TypeScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that provides secure command-line access to Windows systems, allowing MCP clients like Claude Desktop to safely execute commands in PowerShell, CMD, and Git Bash shells with configurable security controls.
            Last updated -
            9
            350
            105
            JavaScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            A secure terminal execution server that enables controlled command execution with security features and resource limits via the Model Context Protocol (MCP).
            Last updated -
            1
            12
            1
            JavaScript
            MIT License
            • Apple
          • -
            security
            A
            license
            -
            quality
            An MCP server that enables secure execution of shell commands across Windows, macOS, and Linux with built-in whitelisting and approval mechanisms for enhanced security.
            Last updated -
            13
            JavaScript
            MIT License
            • Linux
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/tumf/mcp-shell-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server