@j0hanz/filesystem-mcp 1.7.0 → 1.7.2
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/dist/lib/constants.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function parseTrueEnvFlag(value: string | undefined): boolean;
|
|
2
|
+
export declare function parseEnvInt(envVar: string, defaultValue: number, min: number, max: number): number;
|
|
2
3
|
export declare const DEFAULT_LOG_LEVEL: "debug" | "info" | "notice" | "warning" | "error" | "critical" | "alert" | "emergency";
|
|
3
4
|
export declare const REQUIRED_MCP_PROTOCOL_VERSION = "2025-11-25";
|
|
4
5
|
export declare const PARALLEL_CONCURRENCY: number;
|
package/dist/lib/constants.js
CHANGED
|
@@ -12,7 +12,7 @@ function logInvalidEnvValue(envVar, value, expected, defaultValue) {
|
|
|
12
12
|
console.error(`[WARNING] Invalid ${envVar} value: ${value} (must be ${expected}). Using default: ${String(defaultValue)}`);
|
|
13
13
|
}
|
|
14
14
|
// Helper for parsing environment variables (only used for configurable values)
|
|
15
|
-
function parseEnvInt(envVar, defaultValue, min, max) {
|
|
15
|
+
export function parseEnvInt(envVar, defaultValue, min, max) {
|
|
16
16
|
const value = process.env[envVar];
|
|
17
17
|
if (!value)
|
|
18
18
|
return defaultValue;
|
package/dist/server/bootstrap.js
CHANGED
|
@@ -7,7 +7,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
7
7
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
8
8
|
import { isInitializeRequest, SetLevelRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
9
9
|
import { registerCompletions } from '../completions.js';
|
|
10
|
-
import { DEFAULT_LOG_LEVEL, REQUIRED_MCP_PROTOCOL_VERSION, } from '../lib/constants.js';
|
|
10
|
+
import { DEFAULT_LOG_LEVEL, parseEnvInt, REQUIRED_MCP_PROTOCOL_VERSION, } from '../lib/constants.js';
|
|
11
11
|
import { formatUnknownErrorMessage } from '../lib/errors.js';
|
|
12
12
|
import { createInMemoryResourceStore } from '../lib/resource-store.js';
|
|
13
13
|
import { pkgInfo } from '../pkg-info.js';
|
|
@@ -104,16 +104,14 @@ export async function startServer(server) {
|
|
|
104
104
|
rootsManager.registerHandlers(server);
|
|
105
105
|
await rootsManager.recomputeAllowedDirectories();
|
|
106
106
|
await server.connect(transport);
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
transportAny.onclose = () => {
|
|
107
|
+
const sdkOnClose = transport.onclose;
|
|
108
|
+
transport.onclose = () => {
|
|
110
109
|
rootsManager.destroy();
|
|
111
110
|
sdkOnClose?.();
|
|
112
111
|
};
|
|
113
112
|
rootsManager.logMissingDirectoriesIfNeeded(server);
|
|
114
113
|
}
|
|
115
|
-
const MAX_REQUEST_BODY_BYTES =
|
|
116
|
-
4 * 1024 * 1024; // 4 MB default
|
|
114
|
+
const MAX_REQUEST_BODY_BYTES = parseEnvInt('FS_CONTEXT_MAX_REQUEST_BYTES', 4 * 1024 * 1024, 1024, 256 * 1024 * 1024);
|
|
117
115
|
class RequestBodyError extends Error {
|
|
118
116
|
statusCode;
|
|
119
117
|
constructor(message, statusCode) {
|
|
@@ -20,14 +20,16 @@ function getExperimentalTaskRegistration(server) {
|
|
|
20
20
|
return tasks;
|
|
21
21
|
}
|
|
22
22
|
function hasTaskToolCapability(server) {
|
|
23
|
-
const
|
|
24
|
-
const serverRuntime =
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const serverRecord = server;
|
|
24
|
+
const { server: serverRuntime } = serverRecord;
|
|
25
|
+
if (!isRecord(serverRuntime))
|
|
26
|
+
return true;
|
|
27
|
+
const { getCapabilities } = serverRuntime;
|
|
28
|
+
if (typeof getCapabilities !== 'function') {
|
|
27
29
|
// Fallback for tests or custom wrappers that provide only registerTool/experimental.
|
|
28
30
|
return true;
|
|
29
31
|
}
|
|
30
|
-
const capabilities =
|
|
32
|
+
const capabilities = getCapabilities.call(serverRuntime);
|
|
31
33
|
if (!isRecord(capabilities))
|
|
32
34
|
return false;
|
|
33
35
|
const { tasks } = capabilities;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@j0hanz/filesystem-mcp",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"mcpName": "io.github.j0hanz/filesystem-mcp",
|
|
5
5
|
"description": "MCP Server that enables LLMs to interact with the local filesystem.",
|
|
6
6
|
"type": "module",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://github.com/j0hanz/filesystem-mcp#readme",
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
64
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
65
65
|
"commander": "^14.0.3",
|
|
66
66
|
"diff": "^8.0.3",
|
|
67
67
|
"ignore": "^7.0.5",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@eslint/js": "^10.0.1",
|
|
74
|
-
"eslint": "^10.0.
|
|
74
|
+
"eslint": "^10.0.2",
|
|
75
75
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
76
76
|
"@types/node": "^24",
|
|
77
77
|
"eslint-config-prettier": "^10.1.8",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"prettier": "^3.8.1",
|
|
84
84
|
"tsx": "^4.21.0",
|
|
85
85
|
"typescript": "^5.9.3",
|
|
86
|
-
"typescript-eslint": "^8.56.
|
|
86
|
+
"typescript-eslint": "^8.56.1"
|
|
87
87
|
},
|
|
88
88
|
"engines": {
|
|
89
89
|
"node": ">=24"
|