@flemist/mcp-project-tools 1.0.0 → 1.0.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/build/cli.js +54 -29
- package/build/cli.js.map +1 -1
- package/package.json +2 -1
package/build/cli.js
CHANGED
|
@@ -1,33 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { S as SERVER_VERSION, s as startMcpServer, a as SERVER_NAME, A as AUTH_TOKEN } from "./startMcpServer-CA4IQ8YJ.js";
|
|
2
3
|
import * as path from "path";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
const program = new Command();
|
|
5
|
+
program.name("mcp-project-tools").description("MCP project tools server").version(SERVER_VERSION);
|
|
6
|
+
mcpCliRegister(program);
|
|
7
|
+
function mcpCliRegister(program2) {
|
|
8
|
+
program2.option("-p, --port <number>", "Server port").option("-h, --host <string>", "Server host").option("--auth-token <string>", "Authentication token").option("--log-dir <string>", "Log directory").option("--disable-process-manager", "Disable process manager tools").option("--disable-fs-manager", "Disable file system manager tools").option("--process-working-dir <string>", "Process manager working directory").option("--process-allowed-commands <commands>", "Comma-separated list of allowed commands").option("--fs-working-dir <string>", "File system manager working directory").option("--fs-exclude-patterns <patterns>", "Comma-separated list of exclude patterns").option("--mcpignore-file <string>", "Path to .mcpignore file").action(async (options) => {
|
|
9
|
+
try {
|
|
10
|
+
const processAllowedCommands = options.processAllowedCommands ? options.processAllowedCommands.split(",").map((cmd) => cmd.trim()) : ["pnpm", "echo", "vitest", "eslint", "stylelint"];
|
|
11
|
+
const fsExcludePatterns = options.fsExcludePatterns ? options.fsExcludePatterns.split(",").map((pattern) => pattern.trim()) : [];
|
|
12
|
+
const mcpignoreFile = path.resolve(options.mcpignoreFile || ".mcpignore");
|
|
13
|
+
const defaultFsExcludes = [
|
|
14
|
+
{
|
|
15
|
+
value: mcpignoreFile,
|
|
16
|
+
valueType: "file-contains-patterns",
|
|
17
|
+
exclude: true
|
|
18
|
+
}
|
|
19
|
+
];
|
|
20
|
+
const additionalFsExcludes = fsExcludePatterns.map((pattern) => ({
|
|
21
|
+
value: pattern,
|
|
22
|
+
valueType: "pattern",
|
|
23
|
+
exclude: true
|
|
24
|
+
}));
|
|
25
|
+
await startMcpServer({
|
|
26
|
+
port: options.port ? parseInt(options.port, 10) : 8e3,
|
|
27
|
+
host: options.host || "local.host",
|
|
28
|
+
authToken: options.authToken || AUTH_TOKEN,
|
|
29
|
+
name: SERVER_NAME,
|
|
30
|
+
version: SERVER_VERSION,
|
|
31
|
+
logDir: options.logDir || "tmp/mcp-project-tools/logs",
|
|
32
|
+
enableJsonResponse: false,
|
|
33
|
+
tools: {
|
|
34
|
+
processManager: options.disableProcessManager ? null : {
|
|
35
|
+
workingDir: options.processWorkingDir || null,
|
|
36
|
+
run: {
|
|
37
|
+
allowedCommands: processAllowedCommands
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
fsManager: options.disableFsManager ? null : {
|
|
41
|
+
workingDir: options.fsWorkingDir || null,
|
|
42
|
+
list: {
|
|
43
|
+
globsExclude: [
|
|
44
|
+
...defaultFsExcludes,
|
|
45
|
+
...additionalFsExcludes
|
|
46
|
+
]
|
|
47
|
+
}
|
|
24
48
|
}
|
|
25
|
-
|
|
26
|
-
}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error("Failed to start MCP server:", error);
|
|
53
|
+
process.exit(1);
|
|
27
54
|
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
process.exit(1);
|
|
32
|
-
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
program.parse();
|
|
33
58
|
//# sourceMappingURL=cli.js.map
|
package/build/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":["import { startMcpServer } from 'src/server/startMcpServer'\nimport { AUTH_TOKEN, SERVER_NAME, SERVER_VERSION } from 'src/config/constants'\nimport * as path from 'path'\n\
|
|
1
|
+
{"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":["import { Command } from 'commander'\nimport { startMcpServer } from 'src/server/startMcpServer'\nimport { AUTH_TOKEN, SERVER_NAME, SERVER_VERSION } from 'src/config/constants'\nimport * as path from 'path'\n\nconst program = new Command()\nprogram\n .name('mcp-project-tools')\n .description('MCP project tools server')\n .version(SERVER_VERSION)\n\nmcpCliRegister(program)\n\nfunction mcpCliRegister(program: Command): void {\n program\n .option('-p, --port <number>', 'Server port')\n .option('-h, --host <string>', 'Server host')\n .option('--auth-token <string>', 'Authentication token')\n .option('--log-dir <string>', 'Log directory')\n .option('--disable-process-manager', 'Disable process manager tools')\n .option('--disable-fs-manager', 'Disable file system manager tools')\n .option('--process-working-dir <string>', 'Process manager working directory')\n .option('--process-allowed-commands <commands>', 'Comma-separated list of allowed commands')\n .option('--fs-working-dir <string>', 'File system manager working directory')\n .option('--fs-exclude-patterns <patterns>', 'Comma-separated list of exclude patterns')\n .option('--mcpignore-file <string>', 'Path to .mcpignore file')\n .action(async (options) => {\n try {\n const processAllowedCommands = options.processAllowedCommands\n ? options.processAllowedCommands.split(',').map((cmd: string) => cmd.trim())\n : ['pnpm', 'echo', 'vitest', 'eslint', 'stylelint']\n\n const fsExcludePatterns = options.fsExcludePatterns\n ? options.fsExcludePatterns.split(',').map((pattern: string) => pattern.trim())\n : []\n\n const mcpignoreFile = path.resolve(options.mcpignoreFile || '.mcpignore')\n const defaultFsExcludes = [\n {\n value: mcpignoreFile,\n valueType: 'file-contains-patterns' as const,\n exclude: true,\n },\n ]\n\n const additionalFsExcludes = fsExcludePatterns.map(pattern => ({\n value: pattern,\n valueType: 'pattern' as const,\n exclude: true,\n }))\n\n await startMcpServer({\n port: options.port ? parseInt(options.port, 10) : 8000,\n host: options.host || 'local.host',\n authToken: options.authToken || AUTH_TOKEN,\n name: SERVER_NAME,\n version: SERVER_VERSION,\n logDir: options.logDir || 'tmp/mcp-project-tools/logs',\n enableJsonResponse: false,\n tools: {\n processManager: options.disableProcessManager ? null : {\n workingDir: options.processWorkingDir || null,\n run: {\n allowedCommands: processAllowedCommands,\n },\n },\n fsManager: options.disableFsManager ? null : {\n workingDir: options.fsWorkingDir || null,\n list: {\n globsExclude: [\n ...defaultFsExcludes,\n ...additionalFsExcludes,\n ],\n },\n },\n },\n })\n } catch (error) {\n console.error('Failed to start MCP server:', error)\n process.exit(1)\n }\n })\n}\n\nprogram.parse()\n"],"names":["program"],"mappings":";;;AAKA,MAAM,UAAU,IAAI,QAAA;AACpB,QACG,KAAK,mBAAmB,EACxB,YAAY,0BAA0B,EACtC,QAAQ,cAAc;AAEzB,eAAe,OAAO;AAEtB,SAAS,eAAeA,UAAwB;AAC9CA,WACG,OAAO,uBAAuB,aAAa,EAC3C,OAAO,uBAAuB,aAAa,EAC3C,OAAO,yBAAyB,sBAAsB,EACtD,OAAO,sBAAsB,eAAe,EAC5C,OAAO,6BAA6B,+BAA+B,EACnE,OAAO,wBAAwB,mCAAmC,EAClE,OAAO,kCAAkC,mCAAmC,EAC5E,OAAO,yCAAyC,0CAA0C,EAC1F,OAAO,6BAA6B,uCAAuC,EAC3E,OAAO,oCAAoC,0CAA0C,EACrF,OAAO,6BAA6B,yBAAyB,EAC7D,OAAO,OAAO,YAAY;AACzB,QAAI;AACF,YAAM,yBAAyB,QAAQ,yBACnC,QAAQ,uBAAuB,MAAM,GAAG,EAAE,IAAI,CAAC,QAAgB,IAAI,KAAA,CAAM,IACzE,CAAC,QAAQ,QAAQ,UAAU,UA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
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "MCP project tools",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"@flemist/priority-queue": "^1.0.1",
|
|
67
67
|
"@flemist/time-limits": "^1.0.2",
|
|
68
68
|
"@modelcontextprotocol/sdk": "^1.16.0",
|
|
69
|
+
"commander": "14.0.0",
|
|
69
70
|
"cors": "2.8.5",
|
|
70
71
|
"express": "5.1.0",
|
|
71
72
|
"globby": "=11.1.0",
|