unix-disk-mcp 0.2.0 ā 0.3.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/commands/setup.js +34 -24
- package/package.json +1 -1
package/dist/commands/setup.js
CHANGED
|
@@ -17,11 +17,13 @@ const MCP_CONFIGS = {
|
|
|
17
17
|
? join(homedir(), "Library", "Application Support", "Code", "User", "mcp.json")
|
|
18
18
|
: join(homedir(), ".config", "Code", "User", "mcp.json"),
|
|
19
19
|
},
|
|
20
|
+
cursor: {
|
|
21
|
+
name: "Cursor",
|
|
22
|
+
path: join(homedir(), ".cursor", "mcp.json"),
|
|
23
|
+
},
|
|
20
24
|
claude: {
|
|
21
25
|
name: "Claude Desktop",
|
|
22
|
-
path:
|
|
23
|
-
? join(homedir(), "Library", "Application Support", "Claude", "claude_desktop_config.json")
|
|
24
|
-
: join(homedir(), ".config", "Claude", "claude_desktop_config.json"),
|
|
26
|
+
path: join(homedir(), ".claude.json"),
|
|
25
27
|
},
|
|
26
28
|
};
|
|
27
29
|
/**
|
|
@@ -81,19 +83,22 @@ async function configureProtectedPaths(rl) {
|
|
|
81
83
|
async function selectMCPClient(rl) {
|
|
82
84
|
console.log("\nš§ MCP Client Configuration\n");
|
|
83
85
|
console.log("Which MCP client would you like to configure?\n");
|
|
84
|
-
console.log(" 1. VS Code
|
|
85
|
-
console.log(" 2.
|
|
86
|
-
console.log(" 3.
|
|
87
|
-
console.log(" 4.
|
|
88
|
-
|
|
86
|
+
console.log(" 1. VS Code");
|
|
87
|
+
console.log(" 2. Cursor");
|
|
88
|
+
console.log(" 3. Claude Desktop");
|
|
89
|
+
console.log(" 4. All of the above");
|
|
90
|
+
console.log(" 5. None (manual configuration)\n");
|
|
91
|
+
const answer = await ask(rl, "Select [1-5]: ");
|
|
89
92
|
switch (answer.trim()) {
|
|
90
93
|
case "1":
|
|
91
94
|
return "vscode";
|
|
92
95
|
case "2":
|
|
93
|
-
return "
|
|
96
|
+
return "cursor";
|
|
94
97
|
case "3":
|
|
95
|
-
return "
|
|
98
|
+
return "claude";
|
|
96
99
|
case "4":
|
|
100
|
+
return "all";
|
|
101
|
+
case "5":
|
|
97
102
|
default:
|
|
98
103
|
return "none";
|
|
99
104
|
}
|
|
@@ -110,24 +115,24 @@ function updateMCPConfig(client, configPath) {
|
|
|
110
115
|
try {
|
|
111
116
|
const raw = readFileSync(config.path, "utf-8");
|
|
112
117
|
const data = JSON.parse(raw);
|
|
113
|
-
if (client === "
|
|
114
|
-
//
|
|
115
|
-
if (!data.
|
|
116
|
-
data.
|
|
118
|
+
if (client === "cursor") {
|
|
119
|
+
// Cursor format: uses "mcpServers" without "type"
|
|
120
|
+
if (!data.mcpServers) {
|
|
121
|
+
data.mcpServers = {};
|
|
117
122
|
}
|
|
118
|
-
data.
|
|
119
|
-
type: "stdio",
|
|
123
|
+
data.mcpServers["unix-disk-mcp"] = {
|
|
120
124
|
command: "unix-disk-mcp",
|
|
125
|
+
args: [],
|
|
121
126
|
};
|
|
122
127
|
}
|
|
123
128
|
else {
|
|
124
|
-
// Claude
|
|
125
|
-
if (!data.
|
|
126
|
-
data.
|
|
129
|
+
// VS Code & Claude format: use "servers" with "type"
|
|
130
|
+
if (!data.servers) {
|
|
131
|
+
data.servers = {};
|
|
127
132
|
}
|
|
128
|
-
data.
|
|
133
|
+
data.servers["unix-disk-mcp"] = {
|
|
134
|
+
type: "stdio",
|
|
129
135
|
command: "unix-disk-mcp",
|
|
130
|
-
args: [],
|
|
131
136
|
};
|
|
132
137
|
}
|
|
133
138
|
writeFileSync(config.path, JSON.stringify(data, null, 2));
|
|
@@ -166,8 +171,10 @@ function printManualInstructions() {
|
|
|
166
171
|
args: [],
|
|
167
172
|
},
|
|
168
173
|
}, null, 2));
|
|
169
|
-
console.log("\n\nVS Code
|
|
174
|
+
console.log("\n\nVS Code:");
|
|
170
175
|
console.log(` ${MCP_CONFIGS.vscode.path}\n`);
|
|
176
|
+
console.log("Cursor:");
|
|
177
|
+
console.log(` ${MCP_CONFIGS.cursor.path}\n`);
|
|
171
178
|
console.log("Claude Desktop:");
|
|
172
179
|
console.log(` ${MCP_CONFIGS.claude.path}\n`);
|
|
173
180
|
}
|
|
@@ -191,10 +198,13 @@ export async function runSetup() {
|
|
|
191
198
|
printManualInstructions();
|
|
192
199
|
}
|
|
193
200
|
else {
|
|
194
|
-
if (client === "vscode" || client === "
|
|
201
|
+
if (client === "vscode" || client === "all") {
|
|
195
202
|
updateMCPConfig("vscode", getConfigPath());
|
|
196
203
|
}
|
|
197
|
-
if (client === "
|
|
204
|
+
if (client === "cursor" || client === "all") {
|
|
205
|
+
updateMCPConfig("cursor", getConfigPath());
|
|
206
|
+
}
|
|
207
|
+
if (client === "claude" || client === "all") {
|
|
198
208
|
updateMCPConfig("claude", getConfigPath());
|
|
199
209
|
}
|
|
200
210
|
console.log("\nā
Setup complete! Restart your MCP client to use the server.\n");
|