Skip to main content
Glama

Command Executor MCP Server

명령 실행자 MCP 서버

사전 승인된 명령을 안전하게 실행하기 위한 모델 컨텍스트 프로토콜 서버입니다.

🎥 데모

https://github.com/user-attachments/assets/ed763a12-b685-4e0b-b9a5-bc948a590f51

✨ 특징

  • 사전 승인된 명령 목록을 통한 안전한 명령 실행
  • 환경 변수를 통해 구성 가능한 허용 명령
  • TypeScript 및 MCP SDK로 구축됨
  • 원활한 통합을 위한 stdio를 통한 통신
  • 오류 처리 및 보안 검증
  • 실시간 명령 출력 스트리밍

🚀 설치

종속성 설치:

지엑스피1

서버를 빌드하세요:

npm run build

자동 재빌드를 사용한 개발의 경우:

npm run watch

⚙️ 구성

🔒 허용된 명령어

기본적으로 다음 명령이 허용됩니다.

  • git
  • 엘에스
  • mkdir
  • CD
  • 엔피엠
  • 엔피엑스
  • 파이썬

ALLOWED_COMMANDS 환경 변수를 설정하여 허용되는 명령을 사용자 정의할 수 있습니다.

export ALLOWED_COMMANDS=git,ls,mkdir,python

🔌 Claude 데스크톱 통합

Claude Desktop과 함께 사용하려면 서버 구성을 추가하세요.

MacOS의 경우:

~/Library/Application Support/Claude/claude_desktop_config.json

Windows의 경우:

%APPDATA%/Claude/claude_desktop_config.json

구성 예:

{ "mcpServers": { "command-executor": { "command": "/path/to/command-executor/build/index.js" } } }

🛡️ 보안 고려 사항

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

  1. 사전 승인된 명령 목록
    • 명시적으로 허용된 명령만 실행할 수 있습니다.
    • 기본 목록은 제한적이고 보안에 중점을 둡니다.
    • 명령은 주입을 방지하기 위해 접두사로 검증됩니다.
  2. 명령 검증
    • 명령어 접두사 검증으로 명령어 주입이 방지됩니다.
    • 보안 강화를 위해 셸 실행 없음
    • 환경 변수가 적절하게 정리되었습니다.
  3. 오류 처리
    • 허가되지 않은 명령에 대한 포괄적인 오류 처리
    • 디버깅을 위한 오류 메시지 지우기
    • 실패한 명령으로 인해 서버가 충돌하지 않습니다.
  4. 환경 격리
    • 서버는 자체 환경에서 실행됩니다.
    • 환경 변수를 제어할 수 있습니다
    • 제한된 시스템 접근

💻 개발

📁 프로젝트 구조

command-executor/ ├─ src/ │ └─ index.ts # Main server implementation ├─ build/ │ └─ index.js # Compiled JavaScript ├─ assets/ │ └─ header.svg # Project header image └─ package.json # Project configuration

🐛 디버깅

MCP 서버는 stdio를 통해 통신하므로 디버깅이 어려울 수 있습니다. MCP Inspector 사용을 권장합니다.

npm run inspector

검사기는 브라우저에서 디버깅 도구에 액세스할 수 있는 URL을 제공합니다.

🛠️ 도구 API

서버는 단일 도구를 제공합니다.

실행 명령

미리 승인된 명령을 실행합니다.

매개변수:

  • command (문자열, 필수): 실행할 명령

요청 예시:

{ "name": "execute_command", "arguments": { "command": "git status" } }

응답 예시:

{ "content": [ { "type": "text", "text": "On branch main\nNothing to commit, working tree clean" } ] }

오류 응답:

{ "content": [ { "type": "text", "text": "Command execution failed: Command not allowed" } ], "isError": true }

❌ 오류 처리

서버는 다양한 시나리오에 대한 자세한 오류 메시지를 제공합니다.

  1. 허가되지 않은 명령
    { "code": "InvalidParams", "message": "Command not allowed: [command]. Allowed commands: git, ls, mkdir, cd, npm, npx, python" }
  2. 실행 실패
    { "content": [ { "type": "text", "text": "Command execution failed: [error message]" } ], "isError": true }

🤝 기여하기

  1. 저장소를 포크하세요
  2. 기능 브랜치를 생성하세요
  3. 변경 사항을 커밋하세요
  4. 지점으로 밀어 넣기
  5. 새로운 풀 리퀘스트 만들기

📄 라이센스

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다. 자세한 내용은 라이선스 파일을 참조하세요.

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

사전 승인된 명령을 안전하게 실행할 수 있는 모델 컨텍스트 프로토콜 서버로, AI 보조자가 사용자 시스템과 안전하게 상호 작용할 수 있도록 지원합니다.

  1. 🎥 데모
    1. ✨ 특징
      1. 🚀 설치
        1. ⚙️ 구성
          1. 🔒 허용된 명령어
          2. 🔌 Claude 데스크톱 통합
        2. 🛡️ 보안 고려 사항
          1. 💻 개발
            1. 📁 프로젝트 구조
            2. 🐛 디버깅
          2. 🛠️ 도구 API
            1. 실행 명령
          3. ❌ 오류 처리
            1. 🤝 기여하기
              1. 📄 라이센스

                Related MCP Servers

                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.
                  Last updated -
                  1
                  Python
                  • Linux
                  • Apple
                • A
                  security
                  F
                  license
                  A
                  quality
                  A Model Context Protocol server that enables AI assistants to interact with Bluesky/ATProtocol, providing authentication, timeline access, post creation, and social features like likes and follows.
                  Last updated -
                  18
                  10
                  TypeScript
                  • Apple
                  • Linux
                • -
                  security
                  F
                  license
                  -
                  quality
                  A Model Context Protocol server that provides persistent task management capabilities for AI assistants, allowing them to create, update, and track tasks beyond their usual context limitations.
                  Last updated -
                  1
                  TypeScript
                • -
                  security
                  F
                  license
                  -
                  quality
                  A comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.
                  Last updated -
                  16
                  TypeScript

                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/Sunwood-ai-labs/command-executor-mcp-server'

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