🖥️ 셸 MCP 서버
🚀 Shell MCP 서버를 사용하여 AI 애플리케이션에 보안 셸 명령 실행 기능을 추가하세요! 모델 컨텍스트 프로토콜(MCP)을 위해 설계되었습니다.
✨ 특징
🔒 안전한 실행 - 명령은 지정된 디렉토리에서만 실행됩니다.
🐚 다중 셸 - bash, sh, cmd, powershell 지원
⏱️ 시간 초과 제어 - 장기 실행 명령의 자동 종료
🌍 크로스 플랫폼 - Unix 및 Windows 시스템 모두에서 작동합니다.
🛡️ 기본적으로 안전함 - 내장된 디렉토리 및 셸 검증
Related MCP server: MCP Server Enhanced SSH
🚀 빠른 시작
설치
지엑스피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"
)⚙️ 구성
명령줄 인수를 사용하여 동작을 구성합니다.
논쟁 | 설명 |
| 📁 허용된 디렉토리 목록 |
| 🐚 셸 사양(이름 및 경로) |
환경 변수:
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 커뮤니티에서 ❤️로 제작