bach-filecommander-mcp 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/LICENSE +21 -0
- package/README.md +225 -0
- package/SECURITY.md +49 -0
- package/THIRD_PARTY_NOTICES.md +36 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2037 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.3.0] - 2026-02-14
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- Project prepared for public open-source release
|
|
9
|
+
- README rewritten in English for international audience
|
|
10
|
+
- Added LICENSE (MIT), SECURITY.md, CONTRIBUTING.md
|
|
11
|
+
- Package metadata updated for NPM publishing
|
|
12
|
+
|
|
13
|
+
## [1.2.1] - 2025-01-05
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
- `fc_str_replace` - String replacement tool with unique-match validation
|
|
17
|
+
- Total tools: 29
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- `fc_safe_delete` PowerShell escaping for paths with special characters
|
|
21
|
+
- `&` character handling in Windows paths (PowerShell fallback)
|
|
22
|
+
|
|
23
|
+
## [1.2.0] - 2025-01-05
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- Async Search system (5 tools): `fc_start_search`, `fc_get_search_results`, `fc_stop_search`, `fc_list_searches`, `fc_clear_search`
|
|
27
|
+
- `fc_safe_delete` - Moves files to Recycle Bin (Windows) or Trash (macOS/Linux) instead of permanent deletion
|
|
28
|
+
|
|
29
|
+
## [1.1.0] - 2025-01-05
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
- `fc_read_multiple_files` - Read multiple files in one call
|
|
33
|
+
- `fc_edit_file` - Line-based file editing (replace/insert/delete)
|
|
34
|
+
- `fc_list_processes` - List running system processes
|
|
35
|
+
- `fc_kill_process` - Terminate processes by PID or name
|
|
36
|
+
- Interactive Sessions (4 tools): `fc_start_session`, `fc_read_output`, `fc_send_input`, `fc_close_session`
|
|
37
|
+
|
|
38
|
+
## [1.0.0] - 2025-01-05
|
|
39
|
+
|
|
40
|
+
### Added
|
|
41
|
+
- Initial release with 13 filesystem tools
|
|
42
|
+
- File operations: read, write, list, create directory, delete, move, copy, file info, search
|
|
43
|
+
- Process execution: `fc_execute_command`, `fc_start_process`
|
|
44
|
+
- System: `fc_get_time`
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Lukas (BACH)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# BACH FileCommander MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.npmjs.com/package/bach-filecommander-mcp)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
|
|
7
|
+
A comprehensive **Model Context Protocol (MCP) server** that gives AI assistants full filesystem access, process management, interactive shell sessions, and async file search capabilities.
|
|
8
|
+
|
|
9
|
+
**29 tools** in a single server - everything an AI agent needs to interact with the local system.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Why FileCommander?
|
|
14
|
+
|
|
15
|
+
Most filesystem MCP servers only cover basic read/write operations. FileCommander goes further:
|
|
16
|
+
|
|
17
|
+
- **Safe Delete** - Moves files to Recycle Bin (Windows) or Trash (macOS/Linux) instead of permanent deletion
|
|
18
|
+
- **Interactive Sessions** - Start and interact with REPLs (Python, Node.js, shells) through the MCP protocol
|
|
19
|
+
- **Async Search** - Search large directory trees in the background while the AI continues working
|
|
20
|
+
- **Process Management** - List, start, and terminate system processes
|
|
21
|
+
- **String Replace** - Edit files by matching unique strings with context validation
|
|
22
|
+
- **Cross-platform** - Works on Windows, macOS, and Linux with platform-specific optimizations
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### Prerequisites
|
|
29
|
+
|
|
30
|
+
- [Node.js](https://nodejs.org/) 18 or higher
|
|
31
|
+
- npm
|
|
32
|
+
|
|
33
|
+
### Option 1: Install from NPM
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g bach-filecommander-mcp
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Option 2: Install from Source
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/lukisch/bach-filecommander-mcp.git
|
|
43
|
+
cd bach-filecommander-mcp
|
|
44
|
+
npm install
|
|
45
|
+
npm run build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
### Claude Desktop
|
|
53
|
+
|
|
54
|
+
Add to your `claude_desktop_config.json`:
|
|
55
|
+
|
|
56
|
+
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
57
|
+
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
58
|
+
|
|
59
|
+
#### If installed globally via NPM:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"filecommander": {
|
|
65
|
+
"command": "bach-filecommander"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### If installed from source:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"filecommander": {
|
|
77
|
+
"command": "node",
|
|
78
|
+
"args": ["/absolute/path/to/filecommander-mcp/dist/index.js"]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Restart Claude Desktop after saving.
|
|
85
|
+
|
|
86
|
+
### Other MCP Clients
|
|
87
|
+
|
|
88
|
+
The server communicates via **stdio transport**. Point your MCP client to the `dist/index.js` entry point or the `bach-filecommander` binary.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Tools Overview
|
|
93
|
+
|
|
94
|
+
### Filesystem Operations (14 tools)
|
|
95
|
+
|
|
96
|
+
| Tool | Description |
|
|
97
|
+
|------|-------------|
|
|
98
|
+
| `fc_read_file` | Read file contents with optional line limit |
|
|
99
|
+
| `fc_read_multiple_files` | Read up to 20 files in a single call |
|
|
100
|
+
| `fc_write_file` | Write/create/append to files |
|
|
101
|
+
| `fc_edit_file` | Line-based editing (replace, insert, delete lines) |
|
|
102
|
+
| `fc_str_replace` | Replace a unique string in a file with context validation |
|
|
103
|
+
| `fc_list_directory` | List directory contents (recursive, configurable depth) |
|
|
104
|
+
| `fc_create_directory` | Create directories (including parents) |
|
|
105
|
+
| `fc_delete_file` | Delete a file (permanent) |
|
|
106
|
+
| `fc_delete_directory` | Delete a directory (with optional recursive flag) |
|
|
107
|
+
| `fc_safe_delete` | Move to Recycle Bin / Trash (recoverable!) |
|
|
108
|
+
| `fc_move` | Move or rename files and directories |
|
|
109
|
+
| `fc_copy` | Copy files and directories |
|
|
110
|
+
| `fc_file_info` | Get detailed file metadata (size, dates, type) |
|
|
111
|
+
| `fc_search_files` | Synchronous file search with wildcard patterns |
|
|
112
|
+
|
|
113
|
+
### Async Search (5 tools)
|
|
114
|
+
|
|
115
|
+
| Tool | Description |
|
|
116
|
+
|------|-------------|
|
|
117
|
+
| `fc_start_search` | Start a background search (returns immediately) |
|
|
118
|
+
| `fc_get_search_results` | Retrieve results with pagination |
|
|
119
|
+
| `fc_stop_search` | Cancel a running search |
|
|
120
|
+
| `fc_list_searches` | List all active/completed searches |
|
|
121
|
+
| `fc_clear_search` | Remove completed searches from memory |
|
|
122
|
+
|
|
123
|
+
### Process Management (4 tools)
|
|
124
|
+
|
|
125
|
+
| Tool | Description |
|
|
126
|
+
|------|-------------|
|
|
127
|
+
| `fc_execute_command` | Execute a shell command (blocking, with timeout) |
|
|
128
|
+
| `fc_start_process` | Start a background process (non-blocking) |
|
|
129
|
+
| `fc_list_processes` | List running system processes |
|
|
130
|
+
| `fc_kill_process` | Terminate a process by PID or name |
|
|
131
|
+
|
|
132
|
+
### Interactive Sessions (5 tools)
|
|
133
|
+
|
|
134
|
+
| Tool | Description |
|
|
135
|
+
|------|-------------|
|
|
136
|
+
| `fc_start_session` | Start an interactive process (Python, Node, shell...) |
|
|
137
|
+
| `fc_read_output` | Read session output |
|
|
138
|
+
| `fc_send_input` | Send input to a running session |
|
|
139
|
+
| `fc_list_sessions` | List all sessions |
|
|
140
|
+
| `fc_close_session` | Terminate a session |
|
|
141
|
+
|
|
142
|
+
### System (1 tool)
|
|
143
|
+
|
|
144
|
+
| Tool | Description |
|
|
145
|
+
|------|-------------|
|
|
146
|
+
| `fc_get_time` | Get current system time with timezone info |
|
|
147
|
+
|
|
148
|
+
**Total: 29 tools**
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Comparison with Alternatives
|
|
153
|
+
|
|
154
|
+
| Feature | FileCommander | [Desktop Commander](https://github.com/wonderwhy-er/DesktopCommanderMCP) | [Official Filesystem](https://www.npmjs.com/package/@modelcontextprotocol/server-filesystem) |
|
|
155
|
+
|---------|:---:|:---:|:---:|
|
|
156
|
+
| File read/write/copy/move | 14 tools | Yes | Yes |
|
|
157
|
+
| Safe delete (Recycle Bin) | Yes | No | No |
|
|
158
|
+
| Async background search | 5 tools | No | No |
|
|
159
|
+
| Interactive sessions (REPL) | 5 tools | Yes | No |
|
|
160
|
+
| Process management | 4 tools | Yes | No |
|
|
161
|
+
| Shell command execution | Yes | Yes | No |
|
|
162
|
+
| String replace with validation | Yes | Yes | No |
|
|
163
|
+
| Line-based file editing | Yes | No | No |
|
|
164
|
+
| Path allowlist / sandboxing | No | No | Yes |
|
|
165
|
+
| Excel / PDF support | No | Yes | No |
|
|
166
|
+
| HTTP transport | No | No | No |
|
|
167
|
+
| **Total tools** | **29** | ~15 | ~11 |
|
|
168
|
+
| **Servers needed** | **1** | 1 | + extra for processes |
|
|
169
|
+
|
|
170
|
+
**Key differentiators:**
|
|
171
|
+
- Only MCP server with **recoverable delete** (Recycle Bin / Trash)
|
|
172
|
+
- Only MCP server with **async background search** with pagination
|
|
173
|
+
- Most comprehensive single-server solution (29 tools)
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Tool Prefix
|
|
178
|
+
|
|
179
|
+
All tools use the `fc_` prefix (FileCommander) to avoid conflicts with other MCP servers.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Security
|
|
184
|
+
|
|
185
|
+
**This server has full filesystem access with the running user's permissions.**
|
|
186
|
+
|
|
187
|
+
See [SECURITY.md](SECURITY.md) for detailed security information and recommendations.
|
|
188
|
+
|
|
189
|
+
Key points:
|
|
190
|
+
- `fc_execute_command` runs arbitrary shell commands
|
|
191
|
+
- `fc_delete_*` tools perform permanent deletion (use `fc_safe_delete` for recoverable deletion)
|
|
192
|
+
- No built-in sandboxing - security is delegated to the MCP client layer
|
|
193
|
+
- Designed for local use via stdio transport only
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Development
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# Install dependencies
|
|
201
|
+
npm install
|
|
202
|
+
|
|
203
|
+
# Watch mode (auto-rebuild on changes)
|
|
204
|
+
npm run dev
|
|
205
|
+
|
|
206
|
+
# One-time build
|
|
207
|
+
npm run build
|
|
208
|
+
|
|
209
|
+
# Start the server
|
|
210
|
+
npm start
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Changelog
|
|
218
|
+
|
|
219
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full version history.
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
[MIT](LICENSE) - Lukas (BACH)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Important Security Notice
|
|
4
|
+
|
|
5
|
+
**This MCP server has full filesystem access with the permissions of the running user.**
|
|
6
|
+
|
|
7
|
+
By design, this server provides LLMs with powerful system access capabilities. Please understand the security implications before using it.
|
|
8
|
+
|
|
9
|
+
### High-Risk Tools
|
|
10
|
+
|
|
11
|
+
| Tool | Risk | Description |
|
|
12
|
+
|------|------|-------------|
|
|
13
|
+
| `fc_execute_command` | **Critical** | Executes arbitrary shell commands |
|
|
14
|
+
| `fc_start_process` | **High** | Starts background processes |
|
|
15
|
+
| `fc_kill_process` | **High** | Can terminate any accessible process |
|
|
16
|
+
| `fc_delete_file` | **High** | Permanently deletes files (no recycle bin) |
|
|
17
|
+
| `fc_delete_directory` | **High** | Recursively deletes directories |
|
|
18
|
+
| `fc_write_file` | **Medium** | Can overwrite any accessible file |
|
|
19
|
+
|
|
20
|
+
### Recommendations
|
|
21
|
+
|
|
22
|
+
1. **Use `fc_safe_delete`** instead of `fc_delete_file`/`fc_delete_directory` when possible - it moves items to the Recycle Bin instead of permanent deletion.
|
|
23
|
+
|
|
24
|
+
2. **Be cautious with `fc_execute_command`** - it runs commands with your full user permissions. Review commands before approving execution in your MCP client.
|
|
25
|
+
|
|
26
|
+
3. **Do not expose this server to untrusted networks.** It is designed for local use via stdio transport only.
|
|
27
|
+
|
|
28
|
+
4. **Review your MCP client's approval settings.** Most MCP clients (like Claude Desktop) prompt before executing destructive operations. Keep these prompts enabled.
|
|
29
|
+
|
|
30
|
+
### No Sandbox
|
|
31
|
+
|
|
32
|
+
This server does **not** implement:
|
|
33
|
+
- Path restrictions or allowlists
|
|
34
|
+
- Command filtering or blocklists
|
|
35
|
+
- Rate limiting
|
|
36
|
+
- Audit logging
|
|
37
|
+
|
|
38
|
+
These are intentional design decisions to keep the server simple and flexible. Security is delegated to the MCP client layer.
|
|
39
|
+
|
|
40
|
+
### Reporting Vulnerabilities
|
|
41
|
+
|
|
42
|
+
If you discover a security vulnerability, please open an issue on the GitHub repository. For sensitive disclosures, please use GitHub's private vulnerability reporting feature.
|
|
43
|
+
|
|
44
|
+
## Supported Versions
|
|
45
|
+
|
|
46
|
+
| Version | Supported |
|
|
47
|
+
|---------|-----------|
|
|
48
|
+
| 1.3.x | Yes |
|
|
49
|
+
| < 1.3 | No |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Third-Party Notices
|
|
2
|
+
|
|
3
|
+
This project uses the following third-party packages:
|
|
4
|
+
|
|
5
|
+
## Runtime Dependencies
|
|
6
|
+
|
|
7
|
+
### @modelcontextprotocol/sdk
|
|
8
|
+
- **License:** MIT
|
|
9
|
+
- **Copyright:** Copyright (c) Anthropic, PBC
|
|
10
|
+
- **Repository:** https://github.com/modelcontextprotocol/typescript-sdk
|
|
11
|
+
|
|
12
|
+
### zod
|
|
13
|
+
- **License:** MIT
|
|
14
|
+
- **Copyright:** Copyright (c) Colin McDonnell
|
|
15
|
+
- **Repository:** https://github.com/colinhacks/zod
|
|
16
|
+
|
|
17
|
+
## Development Dependencies
|
|
18
|
+
|
|
19
|
+
### typescript
|
|
20
|
+
- **License:** Apache-2.0
|
|
21
|
+
- **Copyright:** Copyright (c) Microsoft Corporation
|
|
22
|
+
- **Repository:** https://github.com/microsoft/TypeScript
|
|
23
|
+
- **Note:** Used only for compilation. Not included in the distributed package.
|
|
24
|
+
|
|
25
|
+
### @types/node
|
|
26
|
+
- **License:** MIT
|
|
27
|
+
- **Copyright:** DefinitelyTyped contributors
|
|
28
|
+
- **Repository:** https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
29
|
+
|
|
30
|
+
## Node.js Built-in Modules
|
|
31
|
+
|
|
32
|
+
This project uses Node.js built-in modules (`fs`, `path`, `child_process`, `util`) which are part of the Node.js runtime and licensed under the MIT License.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
All listed licenses are permissive and compatible with this project's MIT License.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* BACH FileCommander MCP Server
|
|
4
|
+
*
|
|
5
|
+
* A comprehensive MCP server for filesystem access, process management,
|
|
6
|
+
* interactive sessions, and async file search.
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) 2025-2026 Lukas (BACH). Licensed under MIT License.
|
|
9
|
+
* See LICENSE file for details.
|
|
10
|
+
*
|
|
11
|
+
* @author Lukas (BACH)
|
|
12
|
+
* @version 1.3.0
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG"}
|