Skip to main content
Glama
sonirico

mcp-shell

by sonirico

mcp-shell

Trust Score glama

MCP 서버로 셸 명령을 실행합니다. 당신의 LLM은 도구를 얻고, 당신은 무엇이 어떻게 실행되는지 제어합니다.

mark3labs/mcp-go 기반으로 제작되었습니다. Go로 작성되었습니다.


실행

Docker (가장 쉬움):

docker run -it --rm -v /tmp/mcp-workspace:/tmp/mcp-workspace sonirico/mcp-shell:latest

소스에서:

git clone https://github.com/sonirico/mcp-shell && cd mcp-shell
make install
mcp-shell

Related MCP server: MCP Shell Server

구성

보안 모드가 기본입니다. 구성 파일이 없으면 mcp-shell은 읽기 전용 유틸리티의 좁은 허용 목록(ls, cat, grep, find, head, tail, ...)으로 제한된 보안 모드로 시작됩니다. 정책을 확장하거나 변경하려면 구성 파일만 있으면 됩니다. 완전히 제한 없이 실행하려면 명시적으로 옵트인해야 합니다:

MCP_SHELL_ALLOW_UNSAFE=true mcp-shell   # disables all validation - do not use in production

정책을 사용자 지정하려면 YAML 구성을 지정하세요:

export MCP_SHELL_SEC_CONFIG_FILE=/path/to/security.yaml
mcp-shell

보안 모드 (권장) — 셸 해석 없음, 실행 파일 허용 목록만:

security:
  enabled: true
  use_shell_execution: false
  allowed_executables:
    - ls
    - cat
    - grep
    - find
    - echo
  # WARNING: never add shell/language interpreters (bash, sh, python, perl,
  # ruby, node) or alias-capable tools (git) here - the interpreter executes
  # whatever it is handed, bypassing secure mode entirely. mcp-shell warns at
  # startup if it finds one.
  blocked_patterns:          # optional: restrict args on allowed commands
    - '(^|\s)remote\s+(-v|--verbose)(\s|$)'
  max_execution_time: 30s
  max_output_size: 1048576
  working_directory: /tmp/mcp-workspace
  audit_log: true

레거시 모드 — 셸 실행, 명령 문자열 기반 허용/차단 목록 (주의하지 않으면 주입에 취약):

security:
  enabled: true
  use_shell_execution: true
  allowed_commands: [ls, cat, grep, echo]
  blocked_patterns: ['rm\s+-rf', 'sudo\s+']
  max_execution_time: 30s
  audit_log: true

연결

Claude Desktop — MCP 구성에 추가:

{
  "mcpServers": {
    "shell": {
      "command": "docker",
      "args": ["run", "--rm", "-i", "sonirico/mcp-shell:latest"],
      "env": { "MCP_SHELL_LOG_LEVEL": "info" }
    }
  }
}

사용자 지정 구성의 경우 파일을 마운트하고 환경 변수를 설정하세요:

{
  "command": "docker",
  "args": ["run", "--rm", "-i", "-v", "/path/to/security.yaml:/etc/mcp-shell/security.yaml", "-e", "MCP_SHELL_SEC_CONFIG_FILE=/etc/mcp-shell/security.yaml", "sonirico/mcp-shell:latest"]
}

도구 API

Parameter

Type

Description

command

string

실행할 셸 명령 (필수)

base64

boolean

stdout/stderr를 base64로 인코딩 (기본값: false)

응답에는 status, exit_code, stdout, stderr, command, execution_time 및 선택적 security_info가 포함됩니다.


환경 변수

Variable

Description

MCP_SHELL_SEC_CONFIG_FILE

보안 YAML 경로 (내장 보안 기본값을 재정의)

MCP_SHELL_ALLOW_UNSAFE

true로 설정하면 모든 검증을 비활성화하고 제한 없이 실행 (옵트인)

MCP_SHELL_SERVER_NAME

서버 이름 (기본값: "mcp-shell 🐚")

MCP_SHELL_LOG_LEVEL

debug, info, warn, error, fatal

MCP_SHELL_LOG_FORMAT

json, console

MCP_SHELL_LOG_OUTPUT

stdout, stderr, file


개발

make install dev-tools   # deps + goimports, golines
make fmt test lint
make docker-build       # build image locally
make release            # binary + docker image

보안

  • 기본값: 보안 모드, 읽기 전용 유틸리티의 좁은 허용 목록으로 제한. 인터프리터 없음.

  • 보안 모드 (use_shell_execution: false): 명령은 셸 AST로 파싱되며 단일의 완전히 리터럴한 단순 명령만 허용됩니다 (파이프, 리스트, 치환, 리다이렉션, 글로브 없음). 실행 파일은 허용 목록에 있어야 합니다. 인터프리터(bash/sh/python)는 허용 목록에 있어도 하드 거부되며, 도구별 정책은 기본 거부입니다: 관리되는 바이너리(git, find, sort, tar)의 경우 명시적으로 안전한 플래그만 허용되고, 알 수 없거나 향후 탈출구 플래그를 포함한 다른 모든 것은 거부됩니다 (git -c/config, find -exec/-fls, sort -o/--compress-program, tar -I/-C). Git은 읽기 전용 하위 명령으로 제한됩니다. 이는 조기 거부 계층이지 샌드박스가 아닙니다.

  • 제한 없음: MCP_SHELL_ALLOW_UNSAFE=true를 통해서만 가능. 전체 액세스; 로컬 개발에는 적합하지만 그 외에는 위험.

  • Docker: 비루트로 실행되며 Alpine 기반입니다. 프로덕션에서 사용하세요. 심층 방어를 위해 OS 샌드박스(읽기 전용 파일 시스템, 권한 삭제)와 함께 사용하는 것이 가장 좋습니다.


기여

포크, 브랜치, make fmt test, PR 열기.

A
license - permissive license
Not graded
quality - not tested
A
maintenance

Maintenance

Maintainers
<1hResponse time
7wRelease cycle
8Releases (12mo)
Commit activity
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    A secure and pluggable MCP server to run terminal commands on your local machine or cloud server — remotely, safely, and with LLMs or agentic clients.
  • A
    license
    Not graded
    quality
    F
    maintenance
    A secure MCP server for shell operations, terminal management, and process control, enabling AI assistants to safely execute commands and manage interactive sessions.
    143
    5
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Universal MCP server that wraps any CLI tool, enabling AI assistants to run commands via natural language.
    MIT

View all related MCP servers

Related MCP Connectors

  • Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.

  • MCP server for AI dialogue using various LLM models via AceDataCloud

  • MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.

View all MCP Connectors

Latest Blog Posts

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/sonirico/mcp-shell'

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