mcp-user-system 1.0.2 → 1.0.3
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/install.cjs +79 -24
- package/package.json +1 -1
package/install.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
3
|
* One-click installer for mcp-user-system
|
|
4
|
-
*
|
|
4
|
+
* Supports: Claude Desktop, Cursor, VS Code (Cline), and generic JSON output
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const fs = require("fs");
|
|
@@ -18,19 +18,34 @@ function question(prompt) {
|
|
|
18
18
|
return new Promise((resolve) => rl.question(prompt, resolve));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
// ── Config paths for different tools ──
|
|
22
|
+
function getConfigPaths() {
|
|
23
|
+
const home = os.homedir();
|
|
24
|
+
return {
|
|
25
|
+
claude: {
|
|
26
|
+
darwin: path.join(home, "Library/Application Support/Claude/claude_desktop_config.json"),
|
|
27
|
+
win32: path.join(home, "AppData/Roaming/Claude/claude_desktop_config.json"),
|
|
28
|
+
linux: path.join(home, ".config/claude/claude_desktop_config.json"),
|
|
29
|
+
},
|
|
30
|
+
cursor: {
|
|
31
|
+
darwin: path.join(home, "Library/Application Support/Cursor/mcp.json"),
|
|
32
|
+
win32: path.join(home, "AppData/Roaming/Cursor/mcp.json"),
|
|
33
|
+
linux: path.join(home, ".config/Cursor/mcp.json"),
|
|
34
|
+
},
|
|
35
|
+
vscode: {
|
|
36
|
+
darwin: path.join(home, "Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json"),
|
|
37
|
+
win32: path.join(home, "AppData/Roaming/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json"),
|
|
38
|
+
linux: path.join(home, ".config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json"),
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getGlobalPackagePath() {
|
|
44
|
+
const home = os.homedir();
|
|
45
|
+
if (os.platform() === "win32") {
|
|
46
|
+
return path.join(home, "AppData/Roaming/npm/node_modules/mcp-user-system/dist/index.js");
|
|
33
47
|
}
|
|
48
|
+
return path.join(home, ".npm-global/lib/node_modules/mcp-user-system/dist/index.js");
|
|
34
49
|
}
|
|
35
50
|
|
|
36
51
|
function readConfig(configPath) {
|
|
@@ -53,6 +68,17 @@ function writeConfig(configPath, config) {
|
|
|
53
68
|
async function main() {
|
|
54
69
|
console.log("=== mcp-user-system Installer ===\n");
|
|
55
70
|
|
|
71
|
+
// Select target tool
|
|
72
|
+
console.log("Select your AI tool:");
|
|
73
|
+
console.log(" 1. Claude Desktop (default)");
|
|
74
|
+
console.log(" 2. Cursor");
|
|
75
|
+
console.log(" 3. VS Code (Cline extension)");
|
|
76
|
+
console.log(" 4. Output JSON only (copy manually)\n");
|
|
77
|
+
|
|
78
|
+
const toolChoice = await question("Choice [1-4, default 1]: ");
|
|
79
|
+
const toolMap = { "1": "claude", "2": "cursor", "3": "vscode", "4": "json" };
|
|
80
|
+
const tool = toolMap[toolChoice.trim() || "1"] || "claude";
|
|
81
|
+
|
|
56
82
|
const baseUrl = await question("Backend URL (e.g. https://api.example.com): ");
|
|
57
83
|
const token = await question("Access Token (JWT): ");
|
|
58
84
|
|
|
@@ -61,26 +87,55 @@ async function main() {
|
|
|
61
87
|
process.exit(1);
|
|
62
88
|
}
|
|
63
89
|
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
config.mcpServers = {};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
config.mcpServers["user-system"] = {
|
|
72
|
-
command: "npx",
|
|
73
|
-
args: ["mcp-user-system"],
|
|
90
|
+
const packagePath = getGlobalPackagePath();
|
|
91
|
+
const serverConfig = {
|
|
92
|
+
command: "node",
|
|
93
|
+
args: [packagePath],
|
|
74
94
|
env: {
|
|
75
95
|
TUS_BASE_URL: baseUrl.trim(),
|
|
76
96
|
TUS_ACCESS_TOKEN: token.trim(),
|
|
77
97
|
},
|
|
78
98
|
};
|
|
79
99
|
|
|
100
|
+
if (tool === "json") {
|
|
101
|
+
// Just output JSON
|
|
102
|
+
const output = { mcpServers: { "user-system": serverConfig } };
|
|
103
|
+
console.log("\n--- Copy this to your MCP config ---");
|
|
104
|
+
console.log(JSON.stringify(output, null, 2));
|
|
105
|
+
rl.close();
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Write to tool-specific config file
|
|
110
|
+
const platform = os.platform();
|
|
111
|
+
const configPaths = getConfigPaths();
|
|
112
|
+
const configPath = configPaths[tool]?.[platform] || configPaths[tool]?.linux;
|
|
113
|
+
|
|
114
|
+
if (!configPath) {
|
|
115
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const config = readConfig(configPath);
|
|
120
|
+
|
|
121
|
+
if (tool === "vscode") {
|
|
122
|
+
// VS Code Cline uses "mcpServers" at top level
|
|
123
|
+
if (!config.mcpServers) {
|
|
124
|
+
config.mcpServers = {};
|
|
125
|
+
}
|
|
126
|
+
config.mcpServers["user-system"] = serverConfig;
|
|
127
|
+
} else {
|
|
128
|
+
// Claude Desktop & Cursor
|
|
129
|
+
if (!config.mcpServers) {
|
|
130
|
+
config.mcpServers = {};
|
|
131
|
+
}
|
|
132
|
+
config.mcpServers["user-system"] = serverConfig;
|
|
133
|
+
}
|
|
134
|
+
|
|
80
135
|
writeConfig(configPath, config);
|
|
81
136
|
|
|
82
137
|
console.log(`\nConfiguration written to: ${configPath}`);
|
|
83
|
-
console.log("Restart
|
|
138
|
+
console.log("Restart your AI tool to apply changes.");
|
|
84
139
|
}
|
|
85
140
|
|
|
86
141
|
main().catch((err) => {
|