@flemist/mcp-project-tools 3.0.4 → 3.0.5

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,13 +1,14 @@
1
1
  import { Command as u } from "commander";
2
- import { S as c, a as p, A as f, s as g } from "./startMcpServer-C0W0ZLYo.js";
2
+ import { S as c, a as p, b as f, A as g, p as m, s as d } from "./startMcpServer-B-t6kivp.js";
3
3
  import * as i from "path";
4
- import * as m from "fs";
5
- import d from "deepmerge";
6
- import { pathToFileURL as C } from "url";
7
- const v = {
4
+ import * as C from "fs";
5
+ import h from "deepmerge";
6
+ import { pathToFileURL as v } from "url";
7
+ const w = {
8
8
  port: 8e3,
9
9
  host: "localhost",
10
- authToken: f,
10
+ authToken: g,
11
+ title: f,
11
12
  name: p,
12
13
  version: c,
13
14
  logDir: "tmp/mcp-project-tools/logs",
@@ -46,24 +47,24 @@ const v = {
46
47
  }
47
48
  }
48
49
  };
49
- async function h(e, a) {
50
+ async function E(e, a) {
50
51
  e || (e = "flemist-mcp.config.js");
51
- let r = {};
52
- if (e && m.existsSync(e))
52
+ let t = {};
53
+ if (e && C.existsSync(e))
53
54
  try {
54
55
  const o = i.resolve(e);
55
56
  console.log(`Loading configuration from: ${o}`);
56
- const t = await import(C(o).href);
57
- r = t.default || t;
57
+ const r = await import(v(o).href);
58
+ t = r.default || r;
58
59
  } catch (o) {
59
60
  throw console.error(`Failed to load config from ${e}:`), o;
60
61
  }
61
62
  else e && console.warn(
62
63
  `Config file not found: ${e}. Using default configuration`
63
64
  );
64
- const s = d(v, r, {
65
- arrayMerge(o, t) {
66
- return t;
65
+ const s = h(w, t, {
66
+ arrayMerge(o, r) {
67
+ return r;
67
68
  }
68
69
  });
69
70
  return s.tools?.fsManager && (s.tools.fsManager.globsExclude = [
@@ -73,22 +74,20 @@ async function h(e, a) {
73
74
  exclude: !0
74
75
  },
75
76
  ...s.tools.fsManager.globsExclude || []
76
- ]), s.tools.fsManager?.globsExclude?.forEach((o, t, l) => {
77
- o.valueType === "file-contains-patterns" && (l[t].value = i.resolve(o.value));
77
+ ]), s.tools.fsManager?.globsExclude?.forEach((o, r, l) => {
78
+ o.valueType === "file-contains-patterns" && (l[r].value = i.resolve(o.value));
78
79
  }), s;
79
80
  }
80
- const w = "3.0.4", M = {
81
- version: w
82
- }, n = new u();
83
- n.name("mcp-project-tools").description("MCP project tools server").version(M.version, "-v, --version", "output the current version");
84
- E(n);
85
- function E(e) {
81
+ const n = new u();
82
+ n.name("mcp-project-tools").description("MCP project tools server").version(m.version, "-v, --version", "output the current version");
83
+ M(n);
84
+ function M(e) {
86
85
  e.option("-c, --config [path]", "Path to configuration file (optional)").option("-i, --ignore [path]", "Path to .flemist-mcpignore file (optional)").action(async (a) => {
87
86
  try {
88
- const r = await h(a.config, a.ignore);
89
- await g(r);
90
- } catch (r) {
91
- console.error("Failed to start MCP server:", r), process.exit(1);
87
+ const t = await E(a.config, a.ignore);
88
+ await d(t);
89
+ } catch (t) {
90
+ console.error("Failed to start MCP server:", t), process.exit(1);
92
91
  }
93
92
  });
94
93
  }
package/build/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
1
2
  import { Server } from 'http';
2
3
 
3
4
  declare type CommandLineRule = {
@@ -8,6 +9,12 @@ declare type CommandLineRule = {
8
9
  regexp: string;
9
10
  };
10
11
 
12
+ declare type CreateMcpRouterOptions = {
13
+ authToken: string;
14
+ logFilePath: string;
15
+ createMcpServer: () => McpServer;
16
+ };
17
+
11
18
  declare type CreateServerOptions = {
12
19
  logFilePath: string;
13
20
  };
@@ -37,9 +44,9 @@ declare type Glob = {
37
44
  export declare type McpConfig = Partial<StartMcpServerOptions>;
38
45
 
39
46
  declare type McpServerOptions = {
47
+ title: string;
40
48
  name: string;
41
49
  version: string;
42
- authToken: string;
43
50
  logFilePath: string;
44
51
  };
45
52
 
@@ -72,7 +79,7 @@ declare type ProcessManagerOptions = {
72
79
 
73
80
  export declare function startMcpServer(options: StartMcpServerOptions): Promise<Server>;
74
81
 
75
- declare type StartMcpServerOptions = Omit<CreateServerOptions & McpServerOptions & StartServerOptions, 'logFilePath'> & {
82
+ declare type StartMcpServerOptions = Omit<CreateServerOptions & McpServerOptions & CreateMcpRouterOptions & StartServerOptions, 'logFilePath' | 'createMcpServer'> & {
76
83
  logDir: string;
77
84
  tools: {
78
85
  processManager?: null | ProcessManagerOptions;
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s } from "./startMcpServer-C0W0ZLYo.js";
1
+ import { s } from "./startMcpServer-B-t6kivp.js";
2
2
  export {
3
3
  s as startMcpServer
4
4
  };