Skip to content

Commit 048b1b5

Browse files
committed
docs(README.md): update README to enhance clarity and add MCP client setup instructions for better user guidance
1 parent 9e06324 commit 048b1b5

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

README.md

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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
2651
The `ALLOW_COMMANDS` environment variable specifies which commands are allowed to be executed. Commands can be separated by commas with optional spaces around them.
2752

2853
Valid formats for ALLOW_COMMANDS:
54+
2955
```bash
3056
ALLOW_COMMANDS="ls,cat,echo" # Basic format
3157
ALLOW_COMMANDS="ls ,echo, cat" # With spaces
@@ -50,6 +76,7 @@ ALLOW_COMMANDS="ls, cat , echo" # Multiple spaces
5076
### Response Format
5177

5278
Successful response:
79+
5380
```json
5481
{
5582
"stdout": "command output",
@@ -60,6 +87,7 @@ Successful response:
6087
```
6188

6289
Error 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

85113
1. Clone the repository
114+
86115
```bash
87116
git clone https://github.com/yourusername/mcp-shell-server.git
88117
cd mcp-shell-server
89118
```
90119

91120
2. Install dependencies including test requirements
121+
92122
```bash
93123
pip 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

Comments
 (0)