mcp-shell-server
MCP 셸 서버
모델 컨텍스트 프로토콜(MCP)을 구현하는 보안 셸 명령 실행 서버입니다. 이 서버는 stdin 입력을 지원하여 허용 목록에 있는 셸 명령을 원격으로 실행할 수 있도록 합니다.
특징
보안 명령 실행 : 허용 목록에 있는 명령만 실행할 수 있습니다.
표준 입력 지원 : stdin을 통해 명령에 입력 전달
종합 출력 : stdout, stderr, 종료 상태 및 실행 시간을 반환합니다.
Shell Operator Safety : Shell 연산자(;, &&, ||, |) 다음에 나오는 명령을 검증합니다.
시간 제한 제어 : 명령에 대한 최대 실행 시간 설정
Related MCP server: Shell MCP Server
Claude.app의 MCP 클라이언트 설정
출판된 버전
지엑스피1
{
"mcpServers": {
"shell": {
"command": "uvx",
"args": [
"mcp-shell-server"
],
"env": {
"ALLOW_COMMANDS": "ls,cat,pwd,grep,wc,touch,find"
}
},
}
}로컬 버전
구성
code ~/Library/Application\ Support/Claude/claude_desktop_config.json{
"mcpServers": {
"shell": {
"command": "uv",
"args": [
"--directory",
".",
"run",
"mcp-shell-server"
],
"env": {
"ALLOW_COMMANDS": "ls,cat,pwd,grep,wc,touch,find"
}
},
}
}설치
Smithery를 통해 설치
Smithery를 통해 Claude Desktop용 Shell Server를 자동으로 설치하려면:
npx -y @smithery/cli install mcp-shell-server --client claude수동 설치
pip install mcp-shell-serverSmithery를 통해 설치
Smithery를 통해 Claude Desktop용 Shell Server를 자동으로 설치하려면:
npx -y @smithery/cli install mcp-shell-server --client claude용법
서버 시작
ALLOW_COMMANDS="ls,cat,echo" uvx mcp-shell-server
# Or using the alias
ALLOWED_COMMANDS="ls,cat,echo" uvx mcp-shell-serverALLOW_COMMANDS (또는 별칭 ALLOWED_COMMANDS ) 환경 변수는 실행 가능한 명령을 지정합니다. 명령은 쉼표로 구분할 수 있으며, 필요에 따라 공백을 사용할 수 있습니다.
ALLOW_COMMANDS 또는 ALLOWED_COMMANDS에 유효한 형식:
ALLOW_COMMANDS="ls,cat,echo" # Basic format
ALLOWED_COMMANDS="ls ,echo, cat" # With spaces (using alias)
ALLOW_COMMANDS="ls, cat , echo" # Multiple spaces요청 형식
# Basic command execution
{
"command": ["ls", "-l", "/tmp"]
}
# Command with stdin input
{
"command": ["cat"],
"stdin": "Hello, World!"
}
# Command with timeout
{
"command": ["long-running-process"],
"timeout": 30 # Maximum execution time in seconds
}
# Command with working directory and timeout
{
"command": ["grep", "-r", "pattern"],
"directory": "/path/to/search",
"timeout": 60
}응답 형식
성공적인 응답:
{
"stdout": "command output",
"stderr": "",
"status": 0,
"execution_time": 0.123
}오류 응답:
{
"error": "Command not allowed: rm",
"status": 1,
"stdout": "",
"stderr": "Command not allowed: rm",
"execution_time": 0
}보안
서버는 여러 가지 보안 조치를 구현합니다.
명령 허용 목록 : 명시적으로 허용된 명령만 실행할 수 있습니다.
Shell 연산자 검증 : Shell 연산자(;, &&, ||, |) 뒤에 오는 명령도 허용 목록에 대해 검증됩니다.
셸 주입 없음 : 셸 해석 없이 명령이 직접 실행됩니다.
개발
개발 환경 설정
저장소를 복제합니다
git clone https://github.com/yourusername/mcp-shell-server.git
cd mcp-shell-server테스트 요구 사항을 포함한 종속성 설치
pip install -e ".[test]"테스트 실행
pytestAPI 참조
요청 인수
필드 | 유형 | 필수의 | 설명 |
명령 | 끈[] | 예 | 명령과 해당 인수를 배열 요소로 사용 |
표준입력 | 끈 | 아니요 | 명령에 전달될 입력 |
예배 규칙서 | 끈 | 아니요 | 명령 실행을 위한 작업 디렉토리 |
타임아웃 | 정수 | 아니요 | 최대 실행 시간(초) |
응답 필드
필드 | 유형 | 설명 |
표준 출력 | 끈 | 명령의 표준 출력 |
표준 에러 | 끈 | 명령의 표준 오류 출력 |
상태 | 정수 | 종료 상태 코드 |
실행 시간 | 뜨다 | 실행에 걸리는 시간(초) |
오류 | 끈 | 오류 메시지(실패한 경우에만 표시됨) |
요구 사항
Python 3.11 이상
mcp>=1.1.0
특허
MIT 라이선스 - 자세한 내용은 라이선스 파일을 참조하세요.
Available Tools
1 toolshell_executeA
Execute a shell command Allowed commands: pwd, grep, cat, ls, wc Allowed patterns: Default timeout: 30s; maximum timeout: 300s; output cap: 1048576 bytes
| Name | Required | Description | Default |
|---|---|---|---|
| stdin | No | Input to be passed to the command via stdin | |
| command | Yes | Command and its arguments as array | |
| timeout | No | Maximum execution time in seconds; clamped to server maximum | |
| directory | No | Optional working directory. Omit to use the MCP server process current working directory; relative paths are resolved from that same server process CWD. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the transparency burden. It discloses the allowed commands, default/maximum timeout, and output cap, providing useful behavioral context. However, it omits details about stderr handling, output truncation behavior, or the fact that all allowed commands are read-only, preventing a perfect score.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is brief and front-loaded with the primary action, followed by key constraints. However, the 'Allowed patterns: ' line is empty and incomplete, which introduces a minor structural flaw and reduces clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description captures the essential constraints (allowed commands, timeout, output cap) and parameter semantics are handled by the schema. Yet it does not describe the return format, stderr handling, or exit code behavior, and the incomplete 'Allowed patterns' field leaves a gap in coverage for a shell execution tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides complete descriptions for all four parameters (100% coverage), so the baseline is 3. The description adds marginal value by mentioning the default timeout (30s) and maximum timeout (300s), which aligns with the 'timeout' parameter but does not elaborate on other parameters beyond what the schema already states.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states 'Execute a shell command' and lists the allowed commands (pwd, grep, cat, ls, wc), making the tool's purpose specific and unambiguous. Even without siblings, the allowed-command list defines scope clearly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description communicates constraints via 'Allowed commands' and 'Allowed patterns', indicating when the tool is appropriate. However, it does not explicitly state when to use this tool versus alternatives (there are none listed) or provide a 'when not to use' guideline, leaving usage context somewhat implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v1.1.0- Changed
shell_execute4 fields changed- changed
Input schema / properties / directory / descriptionPrevious value: -"Absolute path to a working directory where the command will be executed"New value: +"Optional working directory. Omit to use the MCP server process current working directory; relative paths are resolved from that same server process CWD." - changed
Input schema / properties / timeout / descriptionPrevious value: -"Maximum execution time in seconds"New value: +"Maximum execution time in seconds; clamped to server maximum" - changed
Input schema / properties / timeout / minimumPrevious value: -0New value: +1 - changed
Input schema / requiredPrevious value: -[ - "command", - "directory" -]New value: +[ + "command" +]
1 tool update
- First observed
shell_execute
TDQS
Only one tool exists, so there is no possibility of confusion or overlap. Every action goes through the single shell_execute tool.
The tool name shell_execute follows a clear verb_noun pattern, consistent with common MCP naming conventions. Even with a single tool, the name is predictable and descriptive.
With only one tool, the set feels thin, but for a restricted shell executor it could be acceptable. The scope is narrow, making the tool count borderline rather than clearly excessive or insufficient.
The tool covers the allowed commands (pwd, grep, cat, ls, wc), but the restricted set excludes many typical shell operations like file writing or process control. This suggests notable gaps for a server named 'shell', though the explicit allowlist mitigates some issues.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseBqualityDmaintenanceA secure MCP server for executing whitelisted shell commands with resource and timeout controls, designed for integration with Claude and other MCP-compatible LLMs.203897MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows LLMs to execute shell commands and receive their output in a controlled manner.7MIT
- AlicenseBqualityDmaintenanceA secure terminal execution server that enables controlled command execution with security features and resource limits via the Model Context Protocol (MCP).11211MIT
- AlicenseCqualityDmaintenanceA secure server that implements the Model Context Protocol (MCP) to enable controlled execution of authorized shell commands with stdin support.1MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/tumf/mcp-shell-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server