ls-mcp 1.9.1 → 1.11.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/dist/main.d.cts CHANGED
@@ -1,12 +1,22 @@
1
- interface MCPServerInfo {
1
+ interface MCPConfigData {
2
+ raw: any;
3
+ parsed: boolean;
4
+ valid: boolean;
5
+ servers: Record<string, MCPServerConfig>;
6
+ }
7
+ interface MCPServerConfig {
2
8
  name: string;
3
9
  command: string;
4
10
  args?: string[];
5
11
  transport?: 'stdio' | 'sse' | 'http';
6
- type?: 'sse' | 'http' | 'stdio';
7
- source?: string;
12
+ type?: 'sse' | 'http' | 'stdio' | 'streamable-http';
13
+ url?: string;
8
14
  env?: Record<string, string>;
9
- status?: 'running' | 'stopped';
15
+ }
16
+ interface MCPAppMetadata {
17
+ name: string;
18
+ friendlyName: string;
19
+ paths: MCPFilePath[];
10
20
  }
11
21
  interface MCPFilePath {
12
22
  filePath: string;
@@ -14,6 +24,17 @@ interface MCPFilePath {
14
24
  parsable?: boolean;
15
25
  servers?: MCPServerInfo[];
16
26
  }
27
+ interface MCPServerInfo {
28
+ name: string;
29
+ command: string;
30
+ args?: string[];
31
+ transport?: 'stdio' | 'sse' | 'http';
32
+ type?: 'sse' | 'http' | 'stdio' | 'streamable-http';
33
+ source?: string;
34
+ env?: Record<string, string>;
35
+ status?: 'running' | 'stopped';
36
+ credentials?: CredentialAnalysisResult;
37
+ }
17
38
  interface MCPFileGroups {
18
39
  name: string;
19
40
  friendlyName: string;
@@ -22,21 +43,68 @@ interface MCPFileGroups {
22
43
  serversCount?: number;
23
44
  };
24
45
  }
25
- interface MCPFileGroupsResult {
46
+ type MCPFileGroupsResultRecord = Record<string, MCPFileGroups>;
47
+ type MCPAppPathsRecord = Record<string, MCPFilePath[]>;
48
+ interface CredentialVariable {
26
49
  name: string;
27
- friendlyName: string;
28
- paths: MCPFilePath[];
29
- stats: {
30
- serversCount?: number;
31
- };
50
+ value: string;
51
+ riskLevel: 'low' | 'high';
52
+ }
53
+ interface CredentialAnalysisResult {
54
+ hasCredentials: boolean;
55
+ credentialVars: CredentialVariable[];
56
+ riskLevel: 'none' | 'low' | 'high';
57
+ }
58
+
59
+ declare class MCPConfigParser {
60
+ private filePath;
61
+ private fileContents;
62
+ private parsed;
63
+ private valid;
64
+ private fileContentsData;
65
+ constructor(filePath: string);
66
+ parseConfigFile(): Promise<MCPConfigData>;
67
+ extractMCPServers(configData: any): Promise<Record<string, MCPServerConfig>>;
68
+ private normalizeServerConfigs;
69
+ private validateType;
70
+ private inferTransportType;
71
+ validateServerConfig(serverConfig: MCPServerConfig): boolean;
72
+ getSupportedConfigKeys(): string[];
73
+ isValidSyntax(): Promise<boolean>;
74
+ countMCPServers(): Promise<number>;
75
+ private getFileContent;
76
+ }
77
+
78
+ interface MCPConfigServiceOptions {
79
+ enableDirectoryBubbling?: boolean;
80
+ }
81
+ declare class MCPConfigService {
82
+ private pathRegistry;
83
+ private currentOS;
84
+ private debug;
85
+ private directoryBubbleService;
86
+ private enableDirectoryBubbling;
87
+ constructor(options?: MCPConfigServiceOptions);
88
+ getConfigFilesPerApp(appName: string): MCPFilePath[];
89
+ getAllConfigFiles(): MCPAppPathsRecord;
90
+ getMCPServersPerApp(appName: string): Promise<MCPServerInfo[]>;
91
+ getAllMCPServers(): Promise<Record<string, MCPServerInfo[]>>;
92
+ getSupportedApps(): MCPAppMetadata[];
93
+ getSupportedOperatingSystems(): string[];
94
+ validateConfigFile(filePath: string): Promise<boolean>;
95
+ protected createParser(filePath: string): MCPConfigParser;
96
+ getMCPFileGroups(): Promise<MCPFileGroupsResultRecord>;
97
+ registerCustomApp(appName: string, paths: MCPFilePath[]): void;
98
+ private parseConfigFileForServers;
99
+ private convertToMCPServerInfo;
100
+ private getFriendlyName;
32
101
  }
33
- type MCPFilePathGroupsRecord = Record<string, MCPFileGroups>;
34
- type MCPFileGroupsResultRecord = Record<string, MCPFileGroupsResult>;
35
102
 
36
103
  declare class MCPFiles {
37
- private mcpFilePathGroups;
38
- constructor(mcpFilePathGroups?: MCPFilePathGroupsRecord);
104
+ private mcpConfigService;
105
+ constructor();
39
106
  findFiles(): Promise<MCPFileGroupsResultRecord>;
107
+ getMCPConfigService(): MCPConfigService;
40
108
  }
41
109
 
42
110
  export { MCPFiles };
package/dist/main.d.ts CHANGED
@@ -1,12 +1,22 @@
1
- interface MCPServerInfo {
1
+ interface MCPConfigData {
2
+ raw: any;
3
+ parsed: boolean;
4
+ valid: boolean;
5
+ servers: Record<string, MCPServerConfig>;
6
+ }
7
+ interface MCPServerConfig {
2
8
  name: string;
3
9
  command: string;
4
10
  args?: string[];
5
11
  transport?: 'stdio' | 'sse' | 'http';
6
- type?: 'sse' | 'http' | 'stdio';
7
- source?: string;
12
+ type?: 'sse' | 'http' | 'stdio' | 'streamable-http';
13
+ url?: string;
8
14
  env?: Record<string, string>;
9
- status?: 'running' | 'stopped';
15
+ }
16
+ interface MCPAppMetadata {
17
+ name: string;
18
+ friendlyName: string;
19
+ paths: MCPFilePath[];
10
20
  }
11
21
  interface MCPFilePath {
12
22
  filePath: string;
@@ -14,6 +24,17 @@ interface MCPFilePath {
14
24
  parsable?: boolean;
15
25
  servers?: MCPServerInfo[];
16
26
  }
27
+ interface MCPServerInfo {
28
+ name: string;
29
+ command: string;
30
+ args?: string[];
31
+ transport?: 'stdio' | 'sse' | 'http';
32
+ type?: 'sse' | 'http' | 'stdio' | 'streamable-http';
33
+ source?: string;
34
+ env?: Record<string, string>;
35
+ status?: 'running' | 'stopped';
36
+ credentials?: CredentialAnalysisResult;
37
+ }
17
38
  interface MCPFileGroups {
18
39
  name: string;
19
40
  friendlyName: string;
@@ -22,21 +43,68 @@ interface MCPFileGroups {
22
43
  serversCount?: number;
23
44
  };
24
45
  }
25
- interface MCPFileGroupsResult {
46
+ type MCPFileGroupsResultRecord = Record<string, MCPFileGroups>;
47
+ type MCPAppPathsRecord = Record<string, MCPFilePath[]>;
48
+ interface CredentialVariable {
26
49
  name: string;
27
- friendlyName: string;
28
- paths: MCPFilePath[];
29
- stats: {
30
- serversCount?: number;
31
- };
50
+ value: string;
51
+ riskLevel: 'low' | 'high';
52
+ }
53
+ interface CredentialAnalysisResult {
54
+ hasCredentials: boolean;
55
+ credentialVars: CredentialVariable[];
56
+ riskLevel: 'none' | 'low' | 'high';
57
+ }
58
+
59
+ declare class MCPConfigParser {
60
+ private filePath;
61
+ private fileContents;
62
+ private parsed;
63
+ private valid;
64
+ private fileContentsData;
65
+ constructor(filePath: string);
66
+ parseConfigFile(): Promise<MCPConfigData>;
67
+ extractMCPServers(configData: any): Promise<Record<string, MCPServerConfig>>;
68
+ private normalizeServerConfigs;
69
+ private validateType;
70
+ private inferTransportType;
71
+ validateServerConfig(serverConfig: MCPServerConfig): boolean;
72
+ getSupportedConfigKeys(): string[];
73
+ isValidSyntax(): Promise<boolean>;
74
+ countMCPServers(): Promise<number>;
75
+ private getFileContent;
76
+ }
77
+
78
+ interface MCPConfigServiceOptions {
79
+ enableDirectoryBubbling?: boolean;
80
+ }
81
+ declare class MCPConfigService {
82
+ private pathRegistry;
83
+ private currentOS;
84
+ private debug;
85
+ private directoryBubbleService;
86
+ private enableDirectoryBubbling;
87
+ constructor(options?: MCPConfigServiceOptions);
88
+ getConfigFilesPerApp(appName: string): MCPFilePath[];
89
+ getAllConfigFiles(): MCPAppPathsRecord;
90
+ getMCPServersPerApp(appName: string): Promise<MCPServerInfo[]>;
91
+ getAllMCPServers(): Promise<Record<string, MCPServerInfo[]>>;
92
+ getSupportedApps(): MCPAppMetadata[];
93
+ getSupportedOperatingSystems(): string[];
94
+ validateConfigFile(filePath: string): Promise<boolean>;
95
+ protected createParser(filePath: string): MCPConfigParser;
96
+ getMCPFileGroups(): Promise<MCPFileGroupsResultRecord>;
97
+ registerCustomApp(appName: string, paths: MCPFilePath[]): void;
98
+ private parseConfigFileForServers;
99
+ private convertToMCPServerInfo;
100
+ private getFriendlyName;
32
101
  }
33
- type MCPFilePathGroupsRecord = Record<string, MCPFileGroups>;
34
- type MCPFileGroupsResultRecord = Record<string, MCPFileGroupsResult>;
35
102
 
36
103
  declare class MCPFiles {
37
- private mcpFilePathGroups;
38
- constructor(mcpFilePathGroups?: MCPFilePathGroupsRecord);
104
+ private mcpConfigService;
105
+ constructor();
39
106
  findFiles(): Promise<MCPFileGroupsResultRecord>;
107
+ getMCPConfigService(): MCPConfigService;
40
108
  }
41
109
 
42
110
  export { MCPFiles };