@mcptoolshop/file-forge 0.1.0 → 0.2.1
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/README.es.md +241 -0
- package/README.fr.md +241 -0
- package/README.hi.md +265 -0
- package/README.it.md +241 -0
- package/README.ja.md +241 -0
- package/README.md +170 -54
- package/README.pt-BR.md +241 -0
- package/README.zh.md +242 -0
- package/package.json +3 -1
- package/build/config/index.d.ts +0 -29
- package/build/config/index.d.ts.map +0 -1
- package/build/config/index.js +0 -229
- package/build/config/index.js.map +0 -1
- package/build/index.d.ts +0 -9
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -23
- package/build/index.js.map +0 -1
- package/build/security/index.d.ts +0 -8
- package/build/security/index.d.ts.map +0 -1
- package/build/security/index.js +0 -8
- package/build/security/index.js.map +0 -1
- package/build/security/read-only.d.ts +0 -32
- package/build/security/read-only.d.ts.map +0 -1
- package/build/security/read-only.js +0 -62
- package/build/security/read-only.js.map +0 -1
- package/build/security/sandbox.d.ts +0 -60
- package/build/security/sandbox.d.ts.map +0 -1
- package/build/security/sandbox.js +0 -231
- package/build/security/sandbox.js.map +0 -1
- package/build/server.d.ts +0 -20
- package/build/server.d.ts.map +0 -1
- package/build/server.js +0 -63
- package/build/server.js.map +0 -1
- package/build/tools/metadata.d.ts +0 -11
- package/build/tools/metadata.d.ts.map +0 -1
- package/build/tools/metadata.js +0 -423
- package/build/tools/metadata.js.map +0 -1
- package/build/tools/read.d.ts +0 -11
- package/build/tools/read.d.ts.map +0 -1
- package/build/tools/read.js +0 -335
- package/build/tools/read.js.map +0 -1
- package/build/tools/scaffold.d.ts +0 -11
- package/build/tools/scaffold.d.ts.map +0 -1
- package/build/tools/scaffold.js +0 -345
- package/build/tools/scaffold.js.map +0 -1
- package/build/tools/search.d.ts +0 -11
- package/build/tools/search.d.ts.map +0 -1
- package/build/tools/search.js +0 -250
- package/build/tools/search.js.map +0 -1
- package/build/tools/write.d.ts +0 -11
- package/build/tools/write.d.ts.map +0 -1
- package/build/tools/write.js +0 -538
- package/build/tools/write.js.map +0 -1
- package/build/types.d.ts +0 -402
- package/build/types.d.ts.map +0 -1
- package/build/types.js +0 -146
- package/build/types.js.map +0 -1
- package/build/utils/errors.d.ts +0 -43
- package/build/utils/errors.d.ts.map +0 -1
- package/build/utils/errors.js +0 -125
- package/build/utils/errors.js.map +0 -1
- package/build/utils/index.d.ts +0 -10
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/index.js +0 -9
- package/build/utils/index.js.map +0 -1
- package/build/utils/logger.d.ts +0 -88
- package/build/utils/logger.d.ts.map +0 -1
- package/build/utils/logger.js +0 -166
- package/build/utils/logger.js.map +0 -1
- package/build/utils/validation.d.ts +0 -43
- package/build/utils/validation.d.ts.map +0 -1
- package/build/utils/validation.js +0 -196
- package/build/utils/validation.js.map +0 -1
package/README.ja.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="README.md">English</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center"><img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/mcp-file-forge/readme.png" alt="MCP File Forge" width="400"></p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
Secure file operations and project scaffolding for AI agents.
|
|
9
|
+
<br />
|
|
10
|
+
Part of <a href="https://mcp-tool-shop.github.io/">MCP Tool Shop</a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://www.npmjs.com/package/@mcptoolshop/file-forge"><img alt="npm version" src="https://img.shields.io/npm/v/@mcptoolshop/file-forge"></a>
|
|
15
|
+
<a href="https://github.com/mcp-tool-shop-org/mcp-file-forge/blob/main/LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-blue"></a>
|
|
16
|
+
<a href="https://mcp-tool-shop-org.github.io/mcp-file-forge/"><img alt="Landing Page" src="https://img.shields.io/badge/Landing_Page-live-blue"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 概要
|
|
22
|
+
|
|
23
|
+
MCP File Forgeは、[Model Context Protocol](https://modelcontextprotocol.io) (MCP) サーバーであり、AIエージェントがローカルファイルシステムにアクセスする際に、サンドボックス環境とポリシーによる制御を提供します。 5つのカテゴリに分けて、**17種類のツール**を提供します。
|
|
24
|
+
|
|
25
|
+
| カテゴリ | ツール | 説明 |
|
|
26
|
+
| ---------- | ------- | ------------- |
|
|
27
|
+
| **Reading** | `read_file`, `read_directory`, `read_multiple` | ファイルの読み込みとディレクトリ一覧の表示 |
|
|
28
|
+
| **Writing** | `write_file`, `create_directory`, `copy_file`, `move_file`, `delete_file` | ファイルの作成、編集、コピー、移動、削除 |
|
|
29
|
+
| **Search** | `glob_search`, `grep_search`, `find_by_content` | ファイル名パターンまたは内容によるファイルの検索 |
|
|
30
|
+
| **Metadata** | `file_stat`, `file_exists`, `get_disk_usage`, `compare_files` | ファイルサイズ、タイムスタンプ、存在確認 |
|
|
31
|
+
| **Scaffolding** | `scaffold_project`, `list_templates` | テンプレートを使用してプロジェクトを作成(変数置換可能) |
|
|
32
|
+
|
|
33
|
+
主な機能:
|
|
34
|
+
|
|
35
|
+
- **サンドボックス化:** 実行は、明示的に許可されたディレクトリに限定されます。
|
|
36
|
+
- **読み取り専用モード:** 環境変数を変更することで、すべての書き込み機能を無効にできます。
|
|
37
|
+
- **シンボリックリンク対応:** デフォルトではシンボリックリンクを追跡しないため、サンドボックスからのエスケープを防ぎます。
|
|
38
|
+
- **Windows優先:** Windowsのパスと規約に合わせて設計されており、他の環境でも動作します。
|
|
39
|
+
- **テンプレートエンジン:** `{{var}}` / `${var}` による変数置換に加え、パスレベルでの `__var__` による名前変更が可能です。
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## インストール
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g @mcptoolshop/file-forge
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
または、npxで直接実行します。
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx @mcptoolshop/file-forge
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Claude Desktopの設定
|
|
58
|
+
|
|
59
|
+
`claude_desktop_config.json` に以下の項目を追加します。
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"file-forge": {
|
|
65
|
+
"command": "npx",
|
|
66
|
+
"args": ["-y", "@mcptoolshop/file-forge"],
|
|
67
|
+
"env": {
|
|
68
|
+
"MCP_FILE_FORGE_ALLOWED_PATHS": "C:/Projects,C:/Users/you/Documents"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
グローバルにインストールした場合は、直接実行ファイルを参照できます。
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"file-forge": {
|
|
81
|
+
"command": "mcp-file-forge",
|
|
82
|
+
"env": {
|
|
83
|
+
"MCP_FILE_FORGE_ALLOWED_PATHS": "C:/Projects"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## ツールの参照
|
|
93
|
+
|
|
94
|
+
### 読み込み
|
|
95
|
+
|
|
96
|
+
| ツール | 説明 | 主要なパラメータ |
|
|
97
|
+
| ------ | ------------- | ---------------- |
|
|
98
|
+
| `read_file` | ファイルの内容を読み込む | `path`, `encoding?`, `start_line?`, `end_line?`, `max_size_kb?` |
|
|
99
|
+
| `read_directory` | ディレクトリの内容を一覧表示する | `path`, `recursive?`, `max_depth?`, `include_hidden?`, `pattern?` |
|
|
100
|
+
| `read_multiple` | 複数のファイルをまとめて読み込む | `paths`, `encoding?`, `fail_on_error?` |
|
|
101
|
+
|
|
102
|
+
### 書き込み
|
|
103
|
+
|
|
104
|
+
| ツール | 説明 | 主要なパラメータ |
|
|
105
|
+
| ------ | ------------- | ---------------- |
|
|
106
|
+
| `write_file` | ファイルへの書き込みまたは上書き | `path`, `content`, `encoding?`, `create_dirs?`, `overwrite?`, `backup?` |
|
|
107
|
+
| `create_directory` | ディレクトリの作成 | `path`, `recursive?` |
|
|
108
|
+
| `copy_file` | ファイルのコピーまたはディレクトリのコピー | `source`, `destination`, `overwrite?`, `recursive?` |
|
|
109
|
+
| `move_file` | ファイルの移動または名前変更 | `source`, `destination`, `overwrite?` |
|
|
110
|
+
| `delete_file` | ファイルの削除またはディレクトリの削除 | `path`, `recursive?`, `force?` |
|
|
111
|
+
|
|
112
|
+
### 検索
|
|
113
|
+
|
|
114
|
+
| ツール | 説明 | 主要なパラメータ |
|
|
115
|
+
| ------ | ------------- | ---------------- |
|
|
116
|
+
| `glob_search` | globパターンによるファイルの検索 | `pattern`, `base_path?`, `max_results?`, `include_dirs?` |
|
|
117
|
+
| `grep_search` | 正規表現によるファイル内容の検索 | `pattern`, `path?`, `glob?`, `case_sensitive?`, `max_results?`, `context_lines?` |
|
|
118
|
+
| `find_by_content` | 正規表現を使用しないテキスト検索 | `text`, `path?`, `file_pattern?`, `max_results?` |
|
|
119
|
+
|
|
120
|
+
### メタデータ
|
|
121
|
+
|
|
122
|
+
| ツール | 説明 | 主要なパラメータ |
|
|
123
|
+
| ------ | ------------- | ---------------- |
|
|
124
|
+
| `file_stat` | ファイル/ディレクトリの統計情報 | `path` |
|
|
125
|
+
| `file_exists` | 存在確認と種類の確認 | `path`, `type?` (`file` / `directory` / `any`) |
|
|
126
|
+
| `get_disk_usage` | ディレクトリのサイズ内訳 | `path`, `max_depth?` |
|
|
127
|
+
| `compare_files` | 2つのパスの比較 | `path1`, `path2` |
|
|
128
|
+
|
|
129
|
+
### テンプレート
|
|
130
|
+
|
|
131
|
+
| ツール | 説明 | 主要なパラメータ |
|
|
132
|
+
| ------ | ------------- | ---------------- |
|
|
133
|
+
| `scaffold_project` | テンプレートからプロジェクトを作成 | `template`, `destination`, `variables?`, `overwrite?` |
|
|
134
|
+
| `list_templates` | 利用可能なテンプレートの一覧表示 | `category?` |
|
|
135
|
+
|
|
136
|
+
詳細なパラメータ、例、およびエラーコードは、[HANDBOOK.md](HANDBOOK.md) に記載されています。
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## 環境変数
|
|
141
|
+
|
|
142
|
+
| 変数 | 説明 | デフォルト値 |
|
|
143
|
+
| ---------- | ------------- | --------- |
|
|
144
|
+
| `MCP_FILE_FORGE_ALLOWED_PATHS` | 許可されたルートディレクトリのカンマ区切りリスト | `.` (カレントディレクトリ) |
|
|
145
|
+
| `MCP_FILE_FORGE_DENIED_PATHS` | 禁止されたパスのglobパターン (カンマ区切り) | `**/node_modules/**`, `**/.git/**` |
|
|
146
|
+
| `MCP_FILE_FORGE_READ_ONLY` | すべての書き込み操作を無効にする | `false` |
|
|
147
|
+
| `MCP_FILE_FORGE_MAX_FILE_SIZE` | ファイルの最大サイズ (バイト) | `104857600` (100 MB) |
|
|
148
|
+
| `MCP_FILE_FORGE_MAX_DEPTH` | 最大再帰深度 | `20` |
|
|
149
|
+
| `MCP_FILE_FORGE_FOLLOW_SYMLINKS` | サンドボックス外のシンボリックリンクを追跡する | `false` |
|
|
150
|
+
| `MCP_FILE_FORGE_TEMPLATE_PATHS` | カンマ区切りのテンプレートディレクトリ | `./templates` |
|
|
151
|
+
| `MCP_FILE_FORGE_LOG_LEVEL` | ログの詳細度 (`error`, `warn`, `info`, `debug`) | `info` |
|
|
152
|
+
| `MCP_FILE_FORGE_LOG_FILE` | ログファイルのパス (stderrに加えて) | _なし_ |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## 設定ファイル
|
|
157
|
+
|
|
158
|
+
作業ディレクトリ内またはその上位ディレクトリに `mcp-file-forge.json` (または `.mcp-file-forge.json`) を作成します。
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"sandbox": {
|
|
163
|
+
"allowed_paths": ["C:/Projects", "C:/Users/you/Documents"],
|
|
164
|
+
"denied_paths": ["**/secrets/**", "**/.env"],
|
|
165
|
+
"follow_symlinks": false,
|
|
166
|
+
"max_file_size": 52428800,
|
|
167
|
+
"max_depth": 20
|
|
168
|
+
},
|
|
169
|
+
"templates": {
|
|
170
|
+
"paths": ["./templates", "~/.mcp-file-forge/templates"]
|
|
171
|
+
},
|
|
172
|
+
"logging": {
|
|
173
|
+
"level": "info",
|
|
174
|
+
"file": "./logs/mcp-file-forge.log"
|
|
175
|
+
},
|
|
176
|
+
"read_only": false
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
設定の優先順位 (最も優先されるものが優先されます):
|
|
181
|
+
|
|
182
|
+
1. 環境変数
|
|
183
|
+
2. 設定ファイル
|
|
184
|
+
3. デフォルト設定
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## セキュリティ
|
|
189
|
+
|
|
190
|
+
MCP File Forge は、AIエージェントが指定された作業領域から逸脱しないように、いくつかの保護機能を備えています。
|
|
191
|
+
|
|
192
|
+
- **パスサンドボックス化:** すべてのパスが絶対パスに解決され、I/O 操作が行われる前に、`allowed_paths` リストに対してチェックされます。
|
|
193
|
+
- **禁止パス:** 許可されたディレクトリ内でもブロックされるグローブパターン (例: `**/secrets/**`)。
|
|
194
|
+
- **シンボリックリンク保護:** デフォルトではシンボリックリンクは追跡されません。シンボリックリンクのターゲットがサンドボックス外にある場合、操作は拒否されます。
|
|
195
|
+
- **パストラバーサル検出:** サンドボックスから抜け出す `..` シーケンスは拒否されます。
|
|
196
|
+
- **サイズ制限:** `max_file_size` を超えるファイルは、メモリ不足を防ぐために拒否されます。
|
|
197
|
+
- **深さ制限:** 再帰的な操作は `max_depth` レベルで制限されます。
|
|
198
|
+
- **読み取り専用モード:** `MCP_FILE_FORGE_READ_ONLY=true` を設定すると、`write_file`、`create_directory`、`copy_file`、`move_file`、`delete_file`、および `scaffold_project` が無効になります。
|
|
199
|
+
- **ヌルバイトの拒否:** `\0` を含むパスは拒否されます。
|
|
200
|
+
- **Windows の長いパスガード:** 32,767 文字を超えるパスは拒否されます。
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## ドキュメント
|
|
205
|
+
|
|
206
|
+
| ドキュメント | 説明 |
|
|
207
|
+
| ---------- | ------------- |
|
|
208
|
+
| [HANDBOOK.md](HANDBOOK.md) | 詳細: セキュリティモデル、ツールリファレンス、テンプレート、アーキテクチャ、FAQ |
|
|
209
|
+
| [CHANGELOG.md](CHANGELOG.md) | リリース履歴 (Keep a Changelog 形式) |
|
|
210
|
+
| [docs/PLANNING.md](docs/PLANNING.md) | 内部計画および調査ノート |
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## 開発
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# Install dependencies
|
|
218
|
+
npm install
|
|
219
|
+
|
|
220
|
+
# Build
|
|
221
|
+
npm run build
|
|
222
|
+
|
|
223
|
+
# Watch mode
|
|
224
|
+
npm run dev
|
|
225
|
+
|
|
226
|
+
# Run tests
|
|
227
|
+
npm test
|
|
228
|
+
|
|
229
|
+
# Lint
|
|
230
|
+
npm run lint
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## ライセンス
|
|
236
|
+
|
|
237
|
+
[MIT](LICENSE)
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
<a href="https://mcp-tool-shop.github.io/">MCP Tool Shop</a> によって作成されました。
|
package/README.md
CHANGED
|
@@ -1,33 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center"><img src="https://raw.githubusercontent.com/mcp-tool-shop-org/brand/main/logos/mcp-file-forge/readme.png" alt="MCP File Forge" width="400"></p>
|
|
2
6
|
|
|
3
|
-
|
|
7
|
+
<p align="center">
|
|
8
|
+
Secure file operations and project scaffolding for AI agents.
|
|
9
|
+
<br />
|
|
10
|
+
Part of <a href="https://mcp-tool-shop.github.io/">MCP Tool Shop</a>
|
|
11
|
+
</p>
|
|
4
12
|
|
|
5
|
-
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://www.npmjs.com/package/@mcptoolshop/file-forge"><img alt="npm version" src="https://img.shields.io/npm/v/@mcptoolshop/file-forge"></a>
|
|
15
|
+
<a href="https://github.com/mcp-tool-shop-org/mcp-file-forge/blob/main/LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-blue"></a>
|
|
16
|
+
<a href="https://mcp-tool-shop-org.github.io/mcp-file-forge/"><img alt="Landing Page" src="https://img.shields.io/badge/Landing_Page-live-blue"></a>
|
|
17
|
+
</p>
|
|
6
18
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## At a Glance
|
|
22
|
+
|
|
23
|
+
MCP File Forge is a [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server that gives AI agents sandboxed, policy-controlled access to the local file system. It ships **17 tools** across five categories:
|
|
24
|
+
|
|
25
|
+
| Category | Tools | Description |
|
|
26
|
+
|----------|-------|-------------|
|
|
27
|
+
| **Reading** | `read_file`, `read_directory`, `read_multiple` | Read files and directory listings |
|
|
28
|
+
| **Writing** | `write_file`, `create_directory`, `copy_file`, `move_file`, `delete_file` | Create, modify, copy, move, and delete |
|
|
29
|
+
| **Search** | `glob_search`, `grep_search`, `find_by_content` | Find files by name pattern or content |
|
|
30
|
+
| **Metadata** | `file_stat`, `file_exists`, `get_disk_usage`, `compare_files` | Inspect size, timestamps, existence |
|
|
31
|
+
| **Scaffolding** | `scaffold_project`, `list_templates` | Create projects from templates with variable substitution |
|
|
32
|
+
|
|
33
|
+
Key properties:
|
|
34
|
+
|
|
35
|
+
- **Sandboxed** -- operations are restricted to explicitly allowed directories.
|
|
36
|
+
- **Read-only mode** -- flip one env var to disable all write tools.
|
|
37
|
+
- **Symlink-safe** -- symlink following is off by default to prevent sandbox escapes.
|
|
38
|
+
- **Windows-first** -- designed for Windows paths and conventions, works everywhere.
|
|
39
|
+
- **Template engine** -- `{{var}}` / `${var}` substitution plus path-level `__var__` renaming.
|
|
40
|
+
|
|
41
|
+
---
|
|
12
42
|
|
|
13
43
|
## Installation
|
|
14
44
|
|
|
15
45
|
```bash
|
|
16
|
-
npm install @
|
|
46
|
+
npm install -g @mcptoolshop/file-forge
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or run directly with npx:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx @mcptoolshop/file-forge
|
|
17
53
|
```
|
|
18
54
|
|
|
19
|
-
|
|
55
|
+
---
|
|
20
56
|
|
|
21
|
-
|
|
57
|
+
## Claude Desktop Configuration
|
|
22
58
|
|
|
23
|
-
Add to your `claude_desktop_config.json`:
|
|
59
|
+
Add the following to your `claude_desktop_config.json`:
|
|
24
60
|
|
|
25
61
|
```json
|
|
26
62
|
{
|
|
27
63
|
"mcpServers": {
|
|
28
64
|
"file-forge": {
|
|
29
|
-
"command": "
|
|
30
|
-
"args": ["
|
|
65
|
+
"command": "npx",
|
|
66
|
+
"args": ["-y", "@mcptoolshop/file-forge"],
|
|
31
67
|
"env": {
|
|
32
68
|
"MCP_FILE_FORGE_ALLOWED_PATHS": "C:/Projects,C:/Users/you/Documents"
|
|
33
69
|
}
|
|
@@ -36,69 +72,144 @@ Add to your `claude_desktop_config.json`:
|
|
|
36
72
|
}
|
|
37
73
|
```
|
|
38
74
|
|
|
39
|
-
|
|
75
|
+
If you installed globally you can point directly at the binary:
|
|
40
76
|
|
|
41
|
-
```
|
|
42
|
-
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"file-forge": {
|
|
81
|
+
"command": "mcp-file-forge",
|
|
82
|
+
"env": {
|
|
83
|
+
"MCP_FILE_FORGE_ALLOWED_PATHS": "C:/Projects"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
43
88
|
```
|
|
44
89
|
|
|
45
|
-
|
|
90
|
+
---
|
|
46
91
|
|
|
47
|
-
|
|
48
|
-
- `read_file` - Read file contents with encoding and line range options
|
|
49
|
-
- `read_directory` - List directory contents with metadata
|
|
50
|
-
- `read_multiple` - Batch read multiple files
|
|
92
|
+
## Tool Reference
|
|
51
93
|
|
|
52
|
-
###
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
94
|
+
### Reading
|
|
95
|
+
|
|
96
|
+
| Tool | Description | Key Parameters |
|
|
97
|
+
|------|-------------|----------------|
|
|
98
|
+
| `read_file` | Read file contents | `path`, `encoding?`, `start_line?`, `end_line?`, `max_size_kb?` |
|
|
99
|
+
| `read_directory` | List directory entries | `path`, `recursive?`, `max_depth?`, `include_hidden?`, `pattern?` |
|
|
100
|
+
| `read_multiple` | Batch-read multiple files | `paths`, `encoding?`, `fail_on_error?` |
|
|
101
|
+
|
|
102
|
+
### Writing
|
|
103
|
+
|
|
104
|
+
| Tool | Description | Key Parameters |
|
|
105
|
+
|------|-------------|----------------|
|
|
106
|
+
| `write_file` | Write or overwrite a file | `path`, `content`, `encoding?`, `create_dirs?`, `overwrite?`, `backup?` |
|
|
107
|
+
| `create_directory` | Create a directory | `path`, `recursive?` |
|
|
108
|
+
| `copy_file` | Copy a file or directory | `source`, `destination`, `overwrite?`, `recursive?` |
|
|
109
|
+
| `move_file` | Move or rename | `source`, `destination`, `overwrite?` |
|
|
110
|
+
| `delete_file` | Delete a file or directory | `path`, `recursive?`, `force?` |
|
|
58
111
|
|
|
59
112
|
### Search
|
|
60
|
-
|
|
61
|
-
|
|
113
|
+
|
|
114
|
+
| Tool | Description | Key Parameters |
|
|
115
|
+
|------|-------------|----------------|
|
|
116
|
+
| `glob_search` | Find files by glob pattern | `pattern`, `base_path?`, `max_results?`, `include_dirs?` |
|
|
117
|
+
| `grep_search` | Search file contents with regex | `pattern`, `path?`, `glob?`, `case_sensitive?`, `max_results?`, `context_lines?` |
|
|
118
|
+
| `find_by_content` | Literal text search (no regex) | `text`, `path?`, `file_pattern?`, `max_results?` |
|
|
62
119
|
|
|
63
120
|
### Metadata
|
|
64
|
-
|
|
65
|
-
|
|
121
|
+
|
|
122
|
+
| Tool | Description | Key Parameters |
|
|
123
|
+
|------|-------------|----------------|
|
|
124
|
+
| `file_stat` | File/directory statistics | `path` |
|
|
125
|
+
| `file_exists` | Check existence and type | `path`, `type?` (`file` / `directory` / `any`) |
|
|
126
|
+
| `get_disk_usage` | Directory size breakdown | `path`, `max_depth?` |
|
|
127
|
+
| `compare_files` | Compare two paths | `path1`, `path2` |
|
|
66
128
|
|
|
67
129
|
### Scaffolding
|
|
68
|
-
- `scaffold_project` - Create project from template
|
|
69
|
-
- `list_templates` - List available templates
|
|
70
130
|
|
|
71
|
-
|
|
131
|
+
| Tool | Description | Key Parameters |
|
|
132
|
+
|------|-------------|----------------|
|
|
133
|
+
| `scaffold_project` | Create project from template | `template`, `destination`, `variables?`, `overwrite?` |
|
|
134
|
+
| `list_templates` | List available templates | `category?` |
|
|
72
135
|
|
|
73
|
-
|
|
136
|
+
Full parameter documentation, examples, and error codes are in the [HANDBOOK.md](HANDBOOK.md).
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Environment Variables
|
|
74
141
|
|
|
75
142
|
| Variable | Description | Default |
|
|
76
143
|
|----------|-------------|---------|
|
|
77
|
-
| `MCP_FILE_FORGE_ALLOWED_PATHS` | Comma-separated allowed
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
144
|
+
| `MCP_FILE_FORGE_ALLOWED_PATHS` | Comma-separated list of allowed root directories | `.` (cwd) |
|
|
145
|
+
| `MCP_FILE_FORGE_DENIED_PATHS` | Comma-separated denied path glob patterns | `**/node_modules/**`, `**/.git/**` |
|
|
146
|
+
| `MCP_FILE_FORGE_READ_ONLY` | Disable all write operations | `false` |
|
|
147
|
+
| `MCP_FILE_FORGE_MAX_FILE_SIZE` | Maximum file size in bytes | `104857600` (100 MB) |
|
|
148
|
+
| `MCP_FILE_FORGE_MAX_DEPTH` | Maximum recursion depth | `20` |
|
|
149
|
+
| `MCP_FILE_FORGE_FOLLOW_SYMLINKS` | Allow following symlinks outside sandbox | `false` |
|
|
150
|
+
| `MCP_FILE_FORGE_TEMPLATE_PATHS` | Comma-separated template directories | `./templates` |
|
|
151
|
+
| `MCP_FILE_FORGE_LOG_LEVEL` | Log verbosity (`error`, `warn`, `info`, `debug`) | `info` |
|
|
152
|
+
| `MCP_FILE_FORGE_LOG_FILE` | Path to a log file (in addition to stderr) | _none_ |
|
|
153
|
+
|
|
154
|
+
---
|
|
81
155
|
|
|
82
|
-
|
|
156
|
+
## Config File
|
|
83
157
|
|
|
84
|
-
Create `mcp-file-forge.json` in
|
|
158
|
+
Create `mcp-file-forge.json` (or `.mcp-file-forge.json`) in or above your working directory:
|
|
85
159
|
|
|
86
160
|
```json
|
|
87
161
|
{
|
|
88
162
|
"sandbox": {
|
|
89
|
-
"allowed_paths": ["
|
|
90
|
-
"denied_paths": ["**/secrets/**"],
|
|
91
|
-
"
|
|
92
|
-
|
|
163
|
+
"allowed_paths": ["C:/Projects", "C:/Users/you/Documents"],
|
|
164
|
+
"denied_paths": ["**/secrets/**", "**/.env"],
|
|
165
|
+
"follow_symlinks": false,
|
|
166
|
+
"max_file_size": 52428800,
|
|
167
|
+
"max_depth": 20
|
|
168
|
+
},
|
|
169
|
+
"templates": {
|
|
170
|
+
"paths": ["./templates", "~/.mcp-file-forge/templates"]
|
|
171
|
+
},
|
|
172
|
+
"logging": {
|
|
173
|
+
"level": "info",
|
|
174
|
+
"file": "./logs/mcp-file-forge.log"
|
|
175
|
+
},
|
|
176
|
+
"read_only": false
|
|
93
177
|
}
|
|
94
178
|
```
|
|
95
179
|
|
|
180
|
+
Configuration priority (highest wins):
|
|
181
|
+
|
|
182
|
+
1. Environment variables
|
|
183
|
+
2. Config file
|
|
184
|
+
3. Built-in defaults
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
96
188
|
## Security
|
|
97
189
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
190
|
+
MCP File Forge enforces several layers of protection to keep AI agents from reaching outside their designated workspace:
|
|
191
|
+
|
|
192
|
+
- **Path sandboxing** -- every path is resolved to an absolute path and checked against the `allowed_paths` list before any I/O occurs.
|
|
193
|
+
- **Denied paths** -- glob patterns that are blocked even within allowed directories (e.g. `**/secrets/**`).
|
|
194
|
+
- **Symlink protection** -- symlinks are not followed by default; if a symlink target resolves outside the sandbox, the operation is denied.
|
|
195
|
+
- **Path traversal detection** -- `..` sequences that would escape the sandbox are rejected.
|
|
196
|
+
- **Size limits** -- files larger than `max_file_size` are refused to prevent memory exhaustion.
|
|
197
|
+
- **Depth limits** -- recursive operations are capped at `max_depth` levels.
|
|
198
|
+
- **Read-only mode** -- set `MCP_FILE_FORGE_READ_ONLY=true` to disable `write_file`, `create_directory`, `copy_file`, `move_file`, `delete_file`, and `scaffold_project`.
|
|
199
|
+
- **Null-byte rejection** -- paths containing `\0` are refused.
|
|
200
|
+
- **Windows long-path guard** -- paths exceeding 32,767 characters are refused.
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Documentation
|
|
205
|
+
|
|
206
|
+
| Document | Description |
|
|
207
|
+
|----------|-------------|
|
|
208
|
+
| [HANDBOOK.md](HANDBOOK.md) | Deep-dive: security model, tool reference, templates, architecture, FAQ |
|
|
209
|
+
| [CHANGELOG.md](CHANGELOG.md) | Release history (Keep a Changelog format) |
|
|
210
|
+
| [docs/PLANNING.md](docs/PLANNING.md) | Internal planning and research notes |
|
|
211
|
+
|
|
212
|
+
---
|
|
102
213
|
|
|
103
214
|
## Development
|
|
104
215
|
|
|
@@ -109,17 +220,22 @@ npm install
|
|
|
109
220
|
# Build
|
|
110
221
|
npm run build
|
|
111
222
|
|
|
112
|
-
#
|
|
223
|
+
# Watch mode
|
|
113
224
|
npm run dev
|
|
114
225
|
|
|
115
226
|
# Run tests
|
|
116
227
|
npm test
|
|
228
|
+
|
|
229
|
+
# Lint
|
|
230
|
+
npm run lint
|
|
117
231
|
```
|
|
118
232
|
|
|
233
|
+
---
|
|
234
|
+
|
|
119
235
|
## License
|
|
120
236
|
|
|
121
|
-
MIT
|
|
237
|
+
[MIT](LICENSE)
|
|
122
238
|
|
|
123
|
-
|
|
239
|
+
---
|
|
124
240
|
|
|
125
|
-
mcp-tool-shop
|
|
241
|
+
Built by <a href="https://mcp-tool-shop.github.io/">MCP Tool Shop</a>
|