MCP-ShellJS

by erniebrodeur
Verified

local-only server

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

Integrations

  • Provides controlled access to ShellJS commands for filesystem operations, including read-only functions (ls, grep, find) and optional read-write capabilities (mkdir, touch, cp, mv, rm, sed).

  • Built with TypeScript for strong typing, enabling integration with TypeScript applications through a programmatic API.

  • Implements schema-based validation for command inputs and responses, ensuring that all operations conform to defined security constraints.

MCP-ShellJS

Claude와 같은 LLM에게 안전하고 통제된 ShellJS 액세스를 제공하는 MCP 서버입니다.

개요

MCP-ShellJS는 모델 컨텍스트 프로토콜(MCP)과 ShellJS를 연결하여 AI 시스템이 안전한 샌드박스 내에서 셸 명령을 실행할 수 있도록 합니다. 여러 보안 계층을 통해 제어된 파일 시스템 액세스를 제공합니다.

특징

  • 간소화된 보안 :
    • 기본적으로 읽기 전용 모드
    • 명령줄 플래그를 통한 선택적 읽기-쓰기 모드
    • 명령줄 플래그를 통한 선택적 exec 권한
  • Zod를 사용한 스키마 기반 검증
  • ShellJS의 모든 기능( ls , grep , sed , find 등)
  • 강력한 타이핑을 사용한 TypeScript 구현
  • LLM 통합을 위한 간단한 API

설치

지엑스피1

용법

명령줄

# Default mode (read-only) node dist/index.js # Enable read-write operations node dist/index.js --enable-rw # Enable exec command (careful!) node dist/index.js --enable-exec # Enable both node dist/index.js --enable-rw --enable-exec

TypeScript 통합

// Import and initialize the MCP server import { startMCPServer } from 'mcp-shelljs'; // Start the server with default configuration (read-only) startMCPServer(); // Or with custom security configuration startMCPServer({ enableRw: true, // Enable read-write operations enableExec: false // Keep exec disabled });

보안 설계

MCP-ShellJS는 간단한 보안 모델을 구현합니다.

  1. 읽기 전용 모드 (기본값): 파일 시스템을 수정하지 않는 명령만 사용 가능합니다.
  2. 읽기-쓰기 모드 ( --enable-rw ): 파일을 생성, 수정 또는 삭제할 수 있는 명령을 활성화합니다.
  3. 실행 모드 ( --enable-exec ): 임의의 셸 명령을 실행하기 위해 잠재적으로 위험한 exec 명령을 활성화합니다.

이 서버는 stdio 전송으로만 실행되므로 데스크톱 LLM 애플리케이션과 통합하는 데 적합합니다.

왜 MCP-ShellJS를 사용해야 하나요?

AI 개발자를 위해 MCP-ShellJS는 통제된 위험과 함께 강력한 파일 시스템 기능을 제공합니다.

  • 효율적인 탐색 : grep 사용한 빠른 검색 및 코드베이스 전반에서 find
  • 텍스트 처리 : 파일을 완전히 로드하지 않고 sed 로 변환
  • 안전한 자동화 : AI가 파일 구성 및 관리를 돕습니다.
  • 강력한 파이프라인 : Unix 스타일 파이핑을 통한 체인 작업

자원

디렉토리 리소스

directory://{path}?include={glob}&exclude={glob}&honor_gitignore={boolean}

강력한 필터링 기능을 갖춘 디렉토리 목록을 제공합니다.

매개변수설명
include포함할 Glob 패턴(예: *.js,*.ts )
exclude제외할 Glob 패턴(예: node_modules,dist )
honor_gitignoretrue 경우 .gitignore의 패턴과 일치하는 파일을 필터링합니다.
recursivetrue 인 경우 하위 디렉토리를 재귀적으로 포함합니다.

예:

directory:///project/src?include=*.ts&exclude=*.test.ts&honor_gitignore=true

파일 리소스

file://{path}?lines={boolean}&start={number}&end={number}

특정 부분을 볼 수 있는 옵션과 함께 파일 내용을 제공합니다.

매개변수설명
linestrue 경우 출력에 줄 번호가 포함됩니다.
start포함할 첫 번째 줄(1부터 인덱싱)
end포함할 마지막 줄
highlight일치하는 텍스트를 강조하기 위한 Glob 패턴

예:

file:///project/src/index.ts?lines=true&start=10&end=50

도구

MCP-ShellJS는 ShellJS 명령을 보안 위험 수준별로 그룹화된 도구로 노출합니다.

읽기 전용 도구

도구설명인수
cat출력 파일 내용files : 문자열/배열, options : -n (숫자 줄)을 사용하는 객체
grep파일에서 패턴 검색regex , files , options : -v (반전), -l (파일 이름만), -i (대소문자 무시)를 포함한 객체
find재귀적으로 파일 찾기paths : 문자열/배열(기본 디렉터리를 포함한 파일 경로를 반환)
ls디렉토리 내용 나열paths : 문자열/배열, options : -R (재귀적), -A (모두), -L (심볼릭 링크를 따름), -d (디렉토리만)를 포함한 객체
which명령 찾기command : 문자열(명령 경로를 반환)
pwd작업 디렉토리 인쇄(인수 없음)
test테스트 파일 조건expression : 문자열(예: -d path 디렉토리가 존재함, -f path 파일이 존재함)
head첫 번째 줄 표시files : 문자열/배열, options : -n <num> 사용한 객체(표시할 줄)
tail마지막 줄 표시files : 문자열/배열, options : -n <num> 사용한 객체(표시할 줄)
sort줄 정렬files : 문자열/배열, options : -r (역방향), -n (숫자)이 있는 객체
uniq중복된 줄 필터링input : 문자열, output : 문자열, options : -i (대소문자 구분), -c (개수), -d (중복만) 기능이 있는 객체

읽기-쓰기 도구

도구설명인수
mkdir디렉토리 생성dir : 문자열/배열, options : -p 사용한 객체(중간 디렉토리 생성)
touch파일 생성/업데이트files : 문자열/배열, options : -c (생성 안 함), -a (액세스 시간만), -m (수정 시간만)이 있는 객체
cp파일/디렉토리 복사source : 문자열/배열, dest : 문자열, options : -R (재귀적), -n (클러버 없음), -f (강제)가 있는 객체
mv파일/디렉토리 이동source : 문자열/배열, dest : 문자열, options : -f (강제), -n (차단 안 함)이 있는 객체
rm파일/디렉토리 제거files : 문자열/배열, options : -r/-R (재귀), -f (강제)를 사용하는 객체
sed파일용 스트림 편집기search_regex : 정규식, replacement : 문자열, files : 문자열/배열, options : -i (제자리)를 사용한 객체

특별 허가 도구

도구설명인수
exec명령 실행command : 문자열, options : async , silent , allowExec: true 구성이 필요한 객체

특허

GPL-3.0 이상

-
security - not tested
F
license - not found
-
quality - not tested

LLM에 대한 제어된 ShellJS 액세스를 제공하는 안전한 MCP 서버로, AI 시스템이 구성 가능한 보안 샌드박스 내에서 셸 명령을 안전하게 실행하고 파일 시스템과 상호 작용할 수 있도록 합니다.

  1. Overview
    1. Features
      1. Installation
        1. Usage
          1. Command Line
          2. TypeScript Integration
        2. Security Design
          1. Why Use MCP-ShellJS?
            1. Resources
              1. Directory Resource
              2. File Resource
            2. Tools
              1. Read-Only Tools
              2. Read-Write Tools
              3. Special Permission Tools
            3. License
              ID: lyxa7v4e53