Shell MCP Server

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Allows execution of git commands for repository management, including viewing repository status and differences between commits.

  • Enables secure execution of shell commands in specified directories with support for multiple shell types, timeout control, and built-in security features to safely run system commands for file operations, git commands, package management, and system monitoring.

🖥️ 셸 MCP 서버

🚀 Shell MCP 서버를 사용하여 AI 애플리케이션에 보안 셸 명령 실행 기능을 추가하세요! 모델 컨텍스트 프로토콜(MCP)을 위해 설계되었습니다.

✨ 특징

  • 🔒 안전한 실행 - 명령은 지정된 디렉토리에서만 실행됩니다.
  • 🐚 다중 셸 - bash, sh, cmd, powershell 지원
  • ⏱️ 시간 초과 제어 - 장기 실행 명령의 자동 종료
  • 🌍 크로스 플랫폼 - Unix 및 Windows 시스템 모두에서 작동합니다.
  • 🛡️ 기본적으로 안전함 - 내장된 디렉토리 및 셸 검증

🚀 빠른 시작

설치

지엑스피1

🔌 Claude 데스크톱 통합

셸 명령 실행을 활성화하려면 Claude Desktop 구성에 다음을 추가하세요.

{ "mcpServers": { "shell-mcp-server": { "command": "uv", "args": [ "--directory", "/path/to/shell-mcp-server", "run", "shell-mcp-server", "/path/to/allowed/dir1", "/path/to/allowed/dir2", "--shell", "bash", "/bin/bash", "--shell", "zsh", "/bin/zsh" ] } } }

🎮 사용 예시

기본 파일 작업

# List directory contents result = execute_command( command="ls -la", shell="bash", cwd="/path/to/project" ) # Find files by pattern result = execute_command( command="find . -name '*.py'", shell="bash", cwd="/path/to/project" )

프로젝트 관리

# Git operations result = execute_command( command="git status && git diff", shell="bash", cwd="/path/to/repo" ) # Package management result = execute_command( command="pip list --outdated", shell="bash", cwd="/path/to/python/project" )

시스템 정보

# Resource usage result = execute_command( command="df -h && free -h", shell="bash", cwd="/path/to/dir" ) # Process monitoring result = execute_command( command="ps aux | grep python", shell="bash", cwd="/path/to/dir" )

파일 처리

# Search file content result = execute_command( command="grep -r 'TODO' .", shell="bash", cwd="/path/to/project" ) # File manipulation result = execute_command( command="awk '{print $1}' data.csv | sort | uniq -c", shell="bash", cwd="/path/to/data" )

Windows 관련 예제

# List processes result = execute_command( command="Get-Process | Where-Object {$_.CPU -gt 10}", shell="powershell", cwd="C:\\path\\to\\dir" ) # System information result = execute_command( command="systeminfo | findstr /B /C:'OS'", shell="cmd", cwd="C:\\path\\to\\dir" )

⚙️ 구성

명령줄 인수를 사용하여 동작을 구성합니다.

논쟁설명
directories📁 허용된 디렉토리 목록
--shell name path🐚 셸 사양(이름 및 경로)

환경 변수:

  • COMMAND_TIMEOUT : ⏱️ 최대 실행 시간(초) (기본값: 30)

🛡️ 보안 기능

  • 🔐 디렉토리 격리 : 명령은 지정된 디렉토리에서만 실행될 수 있습니다.
  • 🔒 셸 제어 : 구성된 셸만 허용됩니다.
  • 시간 초과 보호 : 모든 명령에는 구성 가능한 시간 초과가 있습니다.
  • 🛑 경로 검증 : 작업 디렉터리 검증은 트래버설 공격을 방지합니다.
  • 👤 권한 격리 : 명령은 서버 프로세스와 동일한 권한으로 실행됩니다.

🛠️ 개발

개발 환경을 설정하세요.

# Create and activate virtual environment uv venv source .venv/bin/activate # Install development dependencies uv pip install -e ".[test]" # Run tests python -m pytest # Run tests with coverage python -m pytest --cov=shell_mcp_server

🤝 기여하기

여러분의 참여를 환영합니다! 자유롭게 참여해 주세요:

  • 🐛 버그 신고
  • 💡 기능 제안
  • 🔧 풀 리퀘스트 제출
  • 📚 문서 개선

📜 라이센스

MIT 라이센스 - 자세한 내용은 라이센스를 참조하세요.


🌟 Secure Shell Access로 AI를 강화하세요! 🌟

모델 컨텍스트 프로토콜 용으로 제작 | MCP 커뮤니티에서 ❤️로 제작

-
security - not tested
A
license - permissive license
-
quality - not tested

AI 애플리케이션이 지정된 디렉토리에서 셸 명령을 실행할 수 있도록 하는 보안 서버로, 디렉토리 격리 및 시간 초과 제어와 같은 내장 보안 기능이 있는 여러 셸 유형(bash, sh, cmd, powershell)을 지원합니다.

  1. ✨ Features
    1. 🚀 Quick Start
      1. Installation
      2. 🔌 Claude Desktop Integration
    2. 🎮 Usage Examples
      1. Basic File Operations
      2. Project Management
      3. System Information
      4. File Processing
      5. Windows-Specific Examples
    3. ⚙️ Configuration
      1. 🛡️ Security Features
        1. 🛠️ Development
          1. 🤝 Contributing
            1. 📜 License
              1. 🌟 Enhance Your AI with Secure Shell Access! 🌟
            ID: oqel9j0pea