Skip to content

Commit 3b968bd

Browse files
committed
chore: update documentation
1 parent 18941d5 commit 3b968bd

4 files changed

Lines changed: 59 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This project is a pure Rust rewrite of the JavaScript-based `@modelcontextprotoc
1919
- **🔄 MCP Roots support**: enabling clients to dynamically modify the list of allowed directories (disabled by default).
2020
- **📦 ZIP Archive Support**: Tools to create ZIP archives from files or directories and extract ZIP files with ease.
2121
- **🪶 Lightweight**: Standalone with no external dependencies (e.g., no Node.js, Python etc required), compiled to a single binary with a minimal resource footprint, ideal for both lightweight and extensive deployment scenarios.
22+
- **🎛️ Tool Disabling**: Disable specific tools to limit functionality and reduce the number of available tools, helping to save tokens.
2223

2324
#### 👉 Refer to [capabilities](https://rust-mcp-stack.github.io/rust-mcp-filesystem/#/capabilities) for a full list of tools and other capabilities.
2425

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project is a pure Rust rewrite of the JavaScript-based **@modelcontextproto
1111
- **🔄 MCP Roots support**: enabling clients to dynamically modify the list of allowed directories (disabled by default).
1212
- **📦 ZIP Archive Support**: Tools to create ZIP archives from files or directories and extract ZIP files with ease.
1313
- **🪶 Lightweight**: Standalone with no external dependencies (e.g., no Node.js, Python etc required), compiled to a single binary with a minimal resource footprint, ideal for both lightweight and extensive deployment scenarios.
14+
- **🎛️ Tool Disabling**: Disable specific tools to limit functionality and reduce the number of available tools, helping to save tokens.
1415

1516
#### Refer to   [capabilities](capabilities.md)   for a full list of tools and other capabilities.
1617

docs/_configs/claude-desktop.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,31 @@ Incorporate the following into your `claude_desktop_config.json`, based on your
3333
}
3434
```
3535

36+
### Disabling Specific Tools
37+
38+
You can disable specific tools using the `-d` or `--disable-tools` flag:
39+
40+
```json
41+
{
42+
"mcpServers": {
43+
"filesystem": {
44+
"command": "rust-mcp-filesystem",
45+
"args": [
46+
"-d", "write_file,edit_file,move_file",
47+
"~/Documents"
48+
]
49+
}
50+
}
51+
}
52+
```
53+
54+
This example disables `write_file`, `edit_file` and `move_file`. See the [CLI Options](../guide/cli-command-options.md) documentation for more details.
55+
3656
## Running via Docker
3757

3858
**Note:** In the example below, all allowed directories are mounted to `/projects`, and `/projects` is passed as the allowed directory argument to the server CLI. You can modify this as needed to fit your requirements.
3959

40-
`ALLOW_WRITE` and `ENABLE_ROOTS` environments could be used to enable write and MCP Roots support.
60+
`ALLOW_WRITE`, `ENABLE_ROOTS`, and `DISABLE_TOOLS` environments could be used to enable write, MCP Roots support, and disable specific tools.
4161

4262
```json
4363
{
@@ -52,6 +72,8 @@ Incorporate the following into your `claude_desktop_config.json`, based on your
5272
"ALLOW_WRITE=false",
5373
"-e",
5474
"ENABLE_ROOTS=false",
75+
"-e",
76+
"DISABLE_TOOLS=write_file,edit_file",
5577
"--mount",
5678
"type=bind,src=/Users/username/Documents,dst=/projects/Documents",
5779
"--mount",

docs/guide/cli-command-options.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ Arguments:
1111
Example: rust-mcp-filesystem /path/to/dir1 /path/to/dir2 /path/to/dir3
1212

1313
Options:
14+
-d, --disable-tools <DISABLE_TOOLS>
15+
Comma-separated list of tools to disable. By default, all tools are enabled.
16+
Visit https://rust-mcp-stack.github.io/rust-mcp-filesystem/#/capabilities to view the full list of available tools.
17+
18+
[env: DISABLE_TOOLS=]
19+
1420
-w, --allow-write [<ALLOW_WRITE>]
1521
Enables write mode for the app, allowing both reading and writing. Defaults to disabled.
1622

@@ -33,3 +39,31 @@ Options:
3339
-V, --version
3440
Print version
3541
```
42+
43+
## Disabling Tools
44+
45+
You can disable specific tools to limit the functionality of the server. This is useful for:
46+
47+
- Security hardening by disabling write operations
48+
- Reducing the number of available tools to save tokens
49+
- Customizing available functionality for specific use cases
50+
51+
### Examples
52+
53+
```sh
54+
# Disable write-related tools
55+
rust-mcp-filesystem -d write_file,edit_file,move_file /path/to/dir
56+
57+
# Disable multiple tools
58+
rust-mcp-filesystem -d read_text_file,search_files /path/to/dir
59+
60+
# Using environment variable
61+
DISABLE_TOOLS=write_file,edit_file rust-mcp-filesystem /path/to/dir
62+
63+
# Disable all write tools at once
64+
rust-mcp-filesystem -d write_file,edit_file,move_file,create_directory,delete_file,zip_files,unzip_file /path/to/dir
65+
```
66+
67+
### Available Tool Names
68+
69+
For a complete list of available tools and their names, see the [Capabilities](https://rust-mcp-stack.github.io/rust-mcp-filesystem/#/capabilities) page. Tool names are case-insensitive (e.g., `read_text_file` and `Read_Text_File` are equivalent).

0 commit comments

Comments
 (0)