file-share-mcp 1.0.17 → 1.0.19
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.md +18 -3
- package/dist/gui.js +3 -4
- package/dist/version.js +1 -1
- package/package.json +2 -4
package/README.md
CHANGED
|
@@ -126,9 +126,9 @@ Nothing to configure.
|
|
|
126
126
|
the server runs on the gateway machine, and neither path means anything there. MCP has no
|
|
127
127
|
file-transfer primitive — only the bytes a message carries actually travel — so the relay,
|
|
128
128
|
which runs next to the agent in `--mcp` mode, fills the gap in both directions. Configure it
|
|
129
|
-
with `GATEWAY_INLINE_ROOTS` (reading, for `copy_file`)
|
|
130
|
-
(writing, for `download_file`)
|
|
131
|
-
|
|
129
|
+
with `GATEWAY_INLINE_ROOTS` (reading, for `copy_file`) and `GATEWAY_INLINE_WRITE_ROOTS`
|
|
130
|
+
(writing, for `download_file`). Those two directory lists are the whole configuration: every
|
|
131
|
+
file type is allowed by default.
|
|
132
132
|
|
|
133
133
|
Neither direction has a fallback. With the relay in the chain but the matching root
|
|
134
134
|
unconfigured, the call fails and names the variable to set; nothing is read, written, or
|
|
@@ -182,6 +182,21 @@ where `MCP_DATA_DIR` and a custom `shared_folder_path` sit on different volumes.
|
|
|
182
182
|
|
|
183
183
|
---
|
|
184
184
|
|
|
185
|
+
## Network exposure
|
|
186
|
+
|
|
187
|
+
The GUI server listens on `127.0.0.1` only. Other machines reach it through the proxy or
|
|
188
|
+
the gateway manager, which relay to `localhost`.
|
|
189
|
+
|
|
190
|
+
Every GUI request goes through the request guard of `@imenam/mcp-gui-interface`: it
|
|
191
|
+
refuses (HTTP 403) a `Host` header other than `localhost` / `127.0.0.1` / `::1`, and any
|
|
192
|
+
modifying request (other than GET, HEAD, OPTIONS) that the browser marks as coming from
|
|
193
|
+
another site (`Sec-Fetch-Site`, or `Origin` outside this machine and the proxy).
|
|
194
|
+
|
|
195
|
+
The GUI sends no CORS headers: the frontend is served by the same server, and other
|
|
196
|
+
websites cannot read the shared files through the browser.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
185
200
|
## Development
|
|
186
201
|
|
|
187
202
|
```bash
|
package/dist/gui.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import express from 'express';
|
|
2
2
|
import multer from 'multer';
|
|
3
|
-
import cors from 'cors';
|
|
4
3
|
import path from 'path';
|
|
5
4
|
import { fileURLToPath } from 'url';
|
|
6
5
|
import fs from 'fs';
|
|
7
|
-
import { setupLogging, createLogger, ProxyClient } from '@imenam/mcp-gui-interface';
|
|
6
|
+
import { setupLogging, createLogger, ProxyClient, GUI_LISTEN_HOST, expressGuiGuard } from '@imenam/mcp-gui-interface';
|
|
8
7
|
import { getConfig, saveConfig } from './utils/config-manager.js';
|
|
9
8
|
import { getSharedFiles, validateSafePath, deleteFile, createDirectory, moveFile, deleteDirectory, movePath, UPLOAD_TMP_DIRNAME } from './utils/file-manager.js';
|
|
10
9
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -12,7 +11,7 @@ const __dirname = path.dirname(__filename);
|
|
|
12
11
|
setupLogging({ processLabel: 'GUI', logDir: path.join(getConfig().MCP_DATA_DIR, 'logs') });
|
|
13
12
|
const logger = createLogger('GUI');
|
|
14
13
|
const app = express();
|
|
15
|
-
app.use(
|
|
14
|
+
app.use(expressGuiGuard());
|
|
16
15
|
app.use(express.json());
|
|
17
16
|
// Stage uploads inside the shared folder: the destination always lives there, so
|
|
18
17
|
// the final rename stays within one mount. os.tmpdir() cannot promise that — under
|
|
@@ -257,7 +256,7 @@ async function startServer() {
|
|
|
257
256
|
if (process.send && process.connected) {
|
|
258
257
|
process.send({ type: 'READY', data: { url: result.url } });
|
|
259
258
|
}
|
|
260
|
-
server = app.listen(port, () => {
|
|
259
|
+
server = app.listen(port, GUI_LISTEN_HOST, () => {
|
|
261
260
|
logger.info(`GUI API server listening on port ${port}`);
|
|
262
261
|
});
|
|
263
262
|
server.on('error', (err) => {
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.0.
|
|
1
|
+
export const VERSION = '1.0.19';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "file-share-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.19",
|
|
4
4
|
"description": "MCP server for bidirectional file sharing between AI agents and users, with a built-in web GUI",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -37,17 +37,15 @@
|
|
|
37
37
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@imenam/mcp-gui-interface": "^1.0.
|
|
40
|
+
"@imenam/mcp-gui-interface": "^1.0.14",
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
42
42
|
"axios": "^1.13.5",
|
|
43
|
-
"cors": "^2.8.6",
|
|
44
43
|
"dotenv": "^17.3.1",
|
|
45
44
|
"express": "^5.2.1",
|
|
46
45
|
"multer": "^2.0.2",
|
|
47
46
|
"zod": "^4.3.6"
|
|
48
47
|
},
|
|
49
48
|
"devDependencies": {
|
|
50
|
-
"@types/cors": "^2.8.19",
|
|
51
49
|
"@types/express": "^5.0.6",
|
|
52
50
|
"@types/multer": "^2.0.0",
|
|
53
51
|
"@types/node": "^25.2.3",
|