Skip to main content
Glama

Bash MCP

by yannbam

Bash MCP(마스터 제어 프로그램)

Claude가 보안 기능을 통해 bash 명령을 안전하게 실행할 수 있도록 하는 TypeScript 애플리케이션입니다. 이 프로젝트는 Claude와 같은 AI 비서에서 bash 명령을 실행하기 위한 안전한 인터페이스를 제공하기 위해 모델 컨텍스트 프로토콜(MCP)을 구현합니다.

특징

  • 제어된 환경에서 bash 명령 실행
  • 상태 비저장 및 상태 저장(대화형) 명령 실행 모두 지원
  • 보안 보호 장치:
    • 허용 목록에 있는 명령
    • 허용 목록에 있는 디렉토리
    • 명령 검증
    • 출력 정리
  • 대화형 명령에 대한 세션 관리
  • 종합 로깅
  • AI 통합을 위한 MCP 서버 구현

설치

지엑스피1

구성

구성은 config/default.json 에 저장됩니다. 다음을 사용자 지정할 수 있습니다.

  • 허용된 명령
  • 허용된 디렉토리
  • 세션 설정
  • 보안 설정
  • 로깅 설정

구성 예:

{ "allowedCommands": ["ls", "cat", "echo", "pwd"], "allowedDirectories": ["/tmp", "/home"], "session": { "timeout": 300, "maxActiveSessions": 5, "defaultMode": "stateless" }, "security": { "validateCommandsStrictly": true, "sanitizeOutput": true, "maxOutputSize": 1048576, "commandTimeout": 30 }, "logging": { "level": "info", "file": "logs/bash-mcp.log", "maxSize": 10485760, "maxFiles": 5 } }

용법

도서관으로서

간단한 명령 실행
import { executeCommand } from 'bash-mcp'; const result = await executeCommand('ls -la', { cwd: '/home/user' }); console.log(result.output);
대화형 세션
import { initBashMCP } from 'bash-mcp'; const mcp = await initBashMCP(); // Create a session const session = mcp.createSession('/home/user'); const sessionId = session.sessionId; // Execute a command in the session const result1 = await mcp.executeCommand('ls -la', { sessionId }); console.log(result1.output); // Send input to the session const result2 = await mcp.sendInput({ sessionId, input: 'echo "Hello, world!"' }); console.log(result2.output); // Close the session when done mcp.closeSession(sessionId);

MCP 서버로서

이 프로젝트에는 Claude Desktop이나 다른 MCP 클라이언트와 함께 사용할 수 있는 MCP 서버 구현이 포함되어 있습니다.

# Start the TypeScript MCP server npm run mcp # Start the JavaScript MCP server npm run mcp-js # Start with MCP Inspector npm run inspector

MCP 서버 구현에 대한 자세한 내용은 MCP.md 참조하세요.

보안 고려 사항

이 MCP는 보안을 염두에 두고 설계되었지만 다음 사항이 중요합니다.

  • 허용되는 명령 및 디렉토리 목록을 최대한 제한적으로 유지하세요.
  • 구성을 정기적으로 검토하고 업데이트하세요
  • 의심스러운 활동에 대한 로그를 모니터링합니다.
  • MCP와 해당 종속성을 최신 상태로 유지하세요.

개발

건물

npm run build

린팅 및 포맷팅

린팅 문제를 확인하려면:

npm run lint

린팅 및 서식 문제를 자동으로 해결하려면 다음을 수행합니다.

./fix-lint.sh

또는 수동으로:

npm run lint:fix # Fix linting issues npm run format # Format code

테스트

npm test

MCP SDK 버전

이 프로젝트에서는 MCP SDK 버전 1.0.1을 사용합니다.

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

local-only server

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

Claude가 보안 보호 기능을 통해 bash 명령을 안전하게 실행할 수 있도록 하는 TypeScript 애플리케이션으로, Model Context Protocol을 통해 안전한 인터페이스를 제공합니다.

  1. 특징
    1. 설치
      1. 구성
        1. 용법
          1. 도서관으로서
          2. MCP 서버로서
        2. 보안 고려 사항
          1. 개발
            1. 건물
            2. 린팅 및 포맷팅
            3. 테스트
          2. MCP SDK 버전

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A secure shell command execution server implementing the Model Context Protocol (MCP). This server allows remote execution of whitelisted shell commands with support for stdin input.
              Last updated -
              1
              74
              Python
              MIT License
              • Apple
            • 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 Node.js implementation of the Model Context Protocol that provides secure shell command execution capabilities, allowing AI models like Claude to run shell commands in a controlled environment with built-in security measures.
              Last updated -
              1
              110
              25
              JavaScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              A TypeScript application that allows Claude to safely execute bash commands with security safeguards including whitelisted commands, directories, and comprehensive logging.
              Last updated -
              TypeScript
              • Linux

            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/yannbam/fresh-bash-mcp'

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