@flemist/mcp-project-tools 3.0.20 → 4.0.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/build/cli.js CHANGED
@@ -1,96 +1,34 @@
1
- import { Command as u } from "commander";
2
- import { S as c, a as p, b as f, A as g, p as m, s as d } from "./startMcpServer-cVbuoauk.js";
3
- import * as i from "path";
4
- import * as h from "fs";
5
- import C from "deepmerge";
6
- import { pathToFileURL as v } from "url";
7
- const w = {
1
+ import { Command as s } from "commander";
2
+ import { l as a, A as i, S as n, a as c, b as p, p as l, s as f } from "./startMcpServer-DlH29csG.js";
3
+ import * as m from "path";
4
+ const v = {
5
+ title: p,
6
+ name: c,
7
+ version: n,
8
8
  port: 8e3,
9
9
  host: "localhost",
10
- authToken: g,
11
- title: f,
12
- name: p,
13
- version: c,
10
+ authToken: i,
14
11
  logDir: "tmp/mcp-project-tools/logs",
15
- tools: {
16
- processManager: {
17
- workingDir: null,
18
- commandLineRules: [],
19
- run: !0,
20
- status: !0,
21
- wait: !0,
22
- list: !0,
23
- kill: !0
24
- },
25
- fsManager: {
26
- workingDir: null,
27
- globsExclude: null,
28
- list: !0,
29
- snapshotQueryCreate: !0,
30
- snapshotCreate: !0,
31
- snapshotBrowse: !0,
32
- snapshotSearch: !0,
33
- snapshotReplace: !0
34
- },
35
- playwrightManager: {
36
- browserCreate: !0,
37
- browserList: !0,
38
- browserClose: !0,
39
- contextCreate: !0,
40
- contextList: !0,
41
- contextClose: !0,
42
- pageCreate: !0,
43
- pageList: !0,
44
- pageClose: !0,
45
- pageGoto: !0,
46
- domSnapshotQueryCreate: !0,
47
- domSnapshotCreate: !0,
48
- domSnapshotBrowse: !0
49
- }
50
- }
12
+ projects: {}
51
13
  };
52
- async function E(e, a) {
53
- e || (e = "flemist-mcp.config.js");
54
- let t = {};
55
- if (e && h.existsSync(e))
56
- try {
57
- const o = i.resolve(e);
58
- console.log(`Loading configuration from: ${o}`);
59
- const r = await import(v(o).href);
60
- t = r.default || r;
61
- } catch (o) {
62
- throw console.error(`Failed to load config from ${e}:`), o;
63
- }
64
- else e && console.warn(
65
- `Config file not found: ${e}. Using default configuration`
66
- );
67
- const s = C(w, t, {
68
- arrayMerge(o, r) {
69
- return r;
70
- }
71
- });
72
- return s.tools?.fsManager && (s.tools.fsManager.globsExclude = [
73
- {
74
- value: a || ".flemist-mcpignore",
75
- valueType: "file-contains-patterns",
76
- exclude: !0
77
- },
78
- ...s.tools.fsManager.globsExclude || []
79
- ]), s.tools.fsManager?.globsExclude?.forEach((o, r, l) => {
80
- o.valueType === "file-contains-patterns" && (l[r].value = i.resolve(o.value));
81
- }), s;
14
+ async function g(r) {
15
+ const t = m.resolve(r || ""), o = await a(t);
16
+ return {
17
+ ...v,
18
+ ...o
19
+ };
82
20
  }
83
- const n = new u();
84
- n.name("mcp-project-tools").description("MCP project tools server").version(m.version, "-v, --version", "output the current version");
85
- M(n);
86
- function M(e) {
87
- e.option("-c, --config [path]", "Path to configuration file (optional)").option("-i, --ignore [path]", "Path to .flemist-mcpignore file (optional)").action(async (a) => {
21
+ const e = new s();
22
+ e.name("mcp-project-tools").description("MCP project tools server").version(l.version, "-v, --version", "output the current version");
23
+ E(e);
24
+ function E(r) {
25
+ r.option("-c, --config [path]", "Path to server configuration directory (optional)").action(async (t) => {
88
26
  try {
89
- const t = await E(a.config, a.ignore);
90
- await d(t);
91
- } catch (t) {
92
- console.error("Failed to start MCP server:", t), process.exit(1);
27
+ const o = await g(t.config);
28
+ await f(o);
29
+ } catch (o) {
30
+ console.error("Failed to start MCP server:", o), process.exit(1);
93
31
  }
94
32
  });
95
33
  }
96
- n.parse();
34
+ e.parse();
package/build/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { PromiseOrValue } from '@flemist/async-utils';
3
+ import { Request as Request_2 } from 'express';
2
4
  import { Server } from 'http';
3
5
 
4
6
  declare type CommandLineRule = {
@@ -12,9 +14,11 @@ declare type CommandLineRule = {
12
14
  declare type CreateMcpRouterOptions = {
13
15
  authToken: string;
14
16
  logFilePath: string;
15
- createMcpServer: () => McpServer;
17
+ createMcpServer: CreateMcpServer;
16
18
  };
17
19
 
20
+ declare type CreateMcpServer = (req: Request_2) => PromiseOrValue<McpServer>;
21
+
18
22
  declare type CreateServerOptions = {
19
23
  logFilePath: string;
20
24
  };
@@ -33,6 +37,7 @@ declare type FsManagerOptions = {
33
37
  /**
34
38
  * @import {CreateMatchPathOptions} from "./walkPaths/createMatchPath"
35
39
  */
40
+ /** @deprecated Use @flemist/simple-utils */
36
41
  declare type Glob = {
37
42
  value: string;
38
43
  valueType: 'file-contains-patterns' | 'pattern';
@@ -43,8 +48,6 @@ declare type Glob = {
43
48
  exclude: boolean;
44
49
  };
45
50
 
46
- export declare type McpConfig = Partial<StartMcpServerOptions>;
47
-
48
51
  declare type McpServerOptions = {
49
52
  title: string;
50
53
  name: string;
@@ -79,9 +82,11 @@ declare type ProcessManagerOptions = {
79
82
  kill?: null | boolean;
80
83
  };
81
84
 
82
- export declare function startMcpServer(options: StartMcpServerOptions): Promise<Server>;
85
+ export declare type ProjectConfig = Partial<ProjectConfig_2> & {
86
+ tools?: Partial<ProjectConfig_2['tools']>;
87
+ };
83
88
 
84
- declare type StartMcpServerOptions = Omit<CreateServerOptions & McpServerOptions & CreateMcpRouterOptions & StartServerOptions, 'logFilePath' | 'createMcpServer'> & {
89
+ declare type ProjectConfig_2 = {
85
90
  logDir: string;
86
91
  tools: {
87
92
  processManager?: null | ProcessManagerOptions;
@@ -90,6 +95,15 @@ declare type StartMcpServerOptions = Omit<CreateServerOptions & McpServerOptions
90
95
  };
91
96
  };
92
97
 
98
+ export declare type ServerConfig = Partial<ServerConfig_2>;
99
+
100
+ declare type ServerConfig_2 = Omit<CreateServerOptions & McpServerOptions & CreateMcpRouterOptions & StartServerOptions, 'logFilePath' | 'createMcpServer'> & {
101
+ logDir: string;
102
+ projects: Record<string, string>;
103
+ };
104
+
105
+ export declare function startMcpServer(serverConfig: ServerConfig_2): Promise<Server>;
106
+
93
107
  declare type StartServerOptions = {
94
108
  host?: string | null;
95
109
  port?: number | null;
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s } from "./startMcpServer-cVbuoauk.js";
1
+ import { s } from "./startMcpServer-DlH29csG.js";
2
2
  export {
3
3
  s as startMcpServer
4
4
  };