@@ -4,10 +4,35 @@ A secure shell command execution server implementing the Model Context Protocol
44
55## Features
66
7- - ** Secure Command Execution** : Only whitelisted commands can be executed
8- - ** Standard Input Support** : Pass input to commands via stdin
9- - ** Comprehensive Output** : Returns stdout, stderr, exit status, and execution time
10- - ** Shell Operator Safety** : Validates commands after shell operators (;, &&, ||, |)
7+ * ** Secure Command Execution** : Only whitelisted commands can be executed
8+ * ** Standard Input Support** : Pass input to commands via stdin
9+ * ** Comprehensive Output** : Returns stdout, stderr, exit status, and execution time
10+ * ** Shell Operator Safety** : Validates commands after shell operators (; , &&, ||, |)
11+
12+ ## MCP client setting in your Claude.app
13+
14+ ``` shell
15+ code ~ /Library/Application\ Support/Claude/claude_desktop_config.json
16+ ```
17+
18+ ``` json
19+ {
20+ "mcpServers" : {
21+ "shell" : {
22+ "command" : " uv" ,
23+ "args" : [
24+ " --directory" ,
25+ " ." ,
26+ " run" ,
27+ " mcp-shell-server"
28+ ],
29+ "env" : {
30+ "ALLOW_COMMANDS" : " ls,cat,pwd,grep,wc,touch,find"
31+ }
32+ },
33+ }
34+ }
35+ ```
1136
1237## Installation
1338
@@ -26,6 +51,7 @@ ALLOW_COMMANDS="ls,cat,echo" uvx mcp-shell-server
2651The ` ALLOW_COMMANDS ` environment variable specifies which commands are allowed to be executed. Commands can be separated by commas with optional spaces around them.
2752
2853Valid formats for ALLOW_COMMANDS:
54+
2955``` bash
3056ALLOW_COMMANDS=" ls,cat,echo" # Basic format
3157ALLOW_COMMANDS=" ls ,echo, cat" # With spaces
@@ -50,6 +76,7 @@ ALLOW_COMMANDS="ls, cat , echo" # Multiple spaces
5076### Response Format
5177
5278Successful response:
79+
5380``` json
5481{
5582 "stdout" : " command output" ,
@@ -60,6 +87,7 @@ Successful response:
6087```
6188
6289Error response:
90+
6391``` json
6492{
6593 "error" : " Command not allowed: rm" ,
@@ -83,12 +111,14 @@ The server implements several security measures:
83111### Setting up Development Environment
84112
851131 . Clone the repository
114+
86115``` bash
87116git clone https://github.com/yourusername/mcp-shell-server.git
88117cd mcp-shell-server
89118```
90119
911202 . Install dependencies including test requirements
121+
92122``` bash
93123pip install -e " .[test]"
94124```
@@ -120,9 +150,9 @@ pytest
120150
121151## Requirements
122152
123- - Python 3.11 or higher
124- - mcp>=1.1.0
153+ * Python 3.11 or higher
154+ * mcp>=1.1.0
125155
126156## License
127157
128- MIT License - See LICENSE file for details
158+ MIT License - See LICENSE file for details
0 commit comments