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