kiviui-mcp 1.0.2 → 1.0.4
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/index.js +1 -1
- package/dist/install.js +21 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ program
|
|
|
20
20
|
.description("CLI and MCP Server for Kivi UI");
|
|
21
21
|
program
|
|
22
22
|
.command("install <client>")
|
|
23
|
-
.description("Install MCP server configuration for a specific client (claude, cursor, vscode, antigravity)")
|
|
23
|
+
.description("Install MCP server configuration for a specific client (claude, cursor, vscode, antigravity, zed)")
|
|
24
24
|
.action(async (client) => {
|
|
25
25
|
try {
|
|
26
26
|
await installForClient(client);
|
package/dist/install.js
CHANGED
|
@@ -8,8 +8,8 @@ const isMac = os.platform() === "darwin";
|
|
|
8
8
|
// npx -y kiviui-mcp
|
|
9
9
|
const MCP_SERVER_COMMAND = "npx";
|
|
10
10
|
const MCP_SERVER_ARGS = ["-y", "kiviui-mcp"];
|
|
11
|
-
async function updateJsonConfig(configPath, serverName, command, args) {
|
|
12
|
-
let config = {
|
|
11
|
+
async function updateJsonConfig(configPath, serverName, command, args, rootKey = "mcpServers") {
|
|
12
|
+
let config = {};
|
|
13
13
|
try {
|
|
14
14
|
const fileContent = await fs.readFile(configPath, "utf-8");
|
|
15
15
|
config = JSON.parse(fileContent);
|
|
@@ -20,10 +20,10 @@ async function updateJsonConfig(configPath, serverName, command, args) {
|
|
|
20
20
|
}
|
|
21
21
|
// File doesn't exist, will be created
|
|
22
22
|
}
|
|
23
|
-
if (!config
|
|
24
|
-
config
|
|
23
|
+
if (!config[rootKey]) {
|
|
24
|
+
config[rootKey] = {};
|
|
25
25
|
}
|
|
26
|
-
config
|
|
26
|
+
config[rootKey][serverName] = {
|
|
27
27
|
command,
|
|
28
28
|
args
|
|
29
29
|
};
|
|
@@ -96,9 +96,24 @@ export async function installForClient(client) {
|
|
|
96
96
|
console.log("Successfully configured Kivi UI MCP for Antigravity.");
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
|
+
case "zed": {
|
|
100
|
+
let configPath = "";
|
|
101
|
+
if (isMac) {
|
|
102
|
+
configPath = path.join(homeDir, "Library", "Application Support", "Zed", "settings.json");
|
|
103
|
+
}
|
|
104
|
+
else if (isWindows) {
|
|
105
|
+
configPath = path.join(process.env.APPDATA || path.join(homeDir, "AppData", "Roaming"), "Zed", "settings.json");
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
configPath = path.join(homeDir, ".config", "zed", "settings.json");
|
|
109
|
+
}
|
|
110
|
+
await updateJsonConfig(configPath, serverName, MCP_SERVER_COMMAND, MCP_SERVER_ARGS, "context_servers");
|
|
111
|
+
console.log("Successfully configured Kivi UI MCP for Zed.");
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
99
114
|
default: {
|
|
100
115
|
console.error(`Unknown client: ${client}`);
|
|
101
|
-
console.log("Supported clients: claude, cursor, vscode, antigravity");
|
|
116
|
+
console.log("Supported clients: claude, cursor, vscode, antigravity, zed");
|
|
102
117
|
process.exit(1);
|
|
103
118
|
}
|
|
104
119
|
}
|