1- import { intro , isCancel , multiselect , select , spinner , log , outro , confirm } from "@clack/prompts" ;
1+ import { confirm , intro , isCancel , log , multiselect , select , spinner } from "@clack/prompts" ;
2+ import chalk from "chalk" ;
23import { Command } from "commander" ;
4+ import { extname } from "node:path" ;
35import { z } from "zod" ;
46import { OutroCommandError , wrapCommandAction } from "../cli/common.js" ;
7+ import { cliLink } from "../utilities/cliOutput.js" ;
8+ import { writeConfigHasSeenMCPInstallPrompt } from "../utilities/configFiles.js" ;
59import {
610 expandTilde ,
7- safeReadJSONFile ,
11+ safeReadJSONCFile ,
812 safeReadTomlFile ,
913 writeJSONFile ,
1014 writeTomlFile ,
1115} from "../utilities/fileSystem.js" ;
1216import { printStandloneInitialBanner } from "../utilities/initialBanner.js" ;
1317import { VERSION } from "../version.js" ;
14- import chalk from "chalk" ;
15- import { cliLink } from "../utilities/cliOutput.js" ;
16- import { extname } from "node:path" ;
17- import { writeConfigHasSeenMCPInstallPrompt } from "../utilities/configFiles.js" ;
1818
1919const cliVersion = VERSION as string ;
2020const cliTag = cliVersion . includes ( "v4-beta" ) ? "v4-beta" : "latest" ;
@@ -23,6 +23,7 @@ const clients = [
2323 "claude-code" ,
2424 "cursor" ,
2525 "vscode" ,
26+ "zed" ,
2627 "windsurf" ,
2728 "gemini-cli" ,
2829 "crush" ,
@@ -56,6 +57,9 @@ const clientScopes: ClientScopes = {
5657 user : "~/Library/Application Support/Code/User/mcp.json" ,
5758 project : "./.vscode/mcp.json" ,
5859 } ,
60+ zed : {
61+ user : "~/.config/zed/settings.json" ,
62+ } ,
5963 windsurf : {
6064 user : "~/.codeium/windsurf/mcp_config.json" ,
6165 } ,
@@ -83,6 +87,7 @@ const clientLabels: ClientLabels = {
8387 "claude-code" : "Claude Code" ,
8488 cursor : "Cursor" ,
8589 vscode : "VSCode" ,
90+ zed : "Zed" ,
8691 windsurf : "Windsurf" ,
8792 "gemini-cli" : "Gemini CLI" ,
8893 crush : "Charm Crush" ,
@@ -344,7 +349,7 @@ async function writeMcpServerConfig(
344349
345350 switch ( extension ) {
346351 case ".json" : {
347- let existingConfig = await safeReadJSONFile ( fullPath ) ;
352+ let existingConfig = await safeReadJSONCFile ( fullPath ) ;
348353
349354 if ( ! existingConfig ) {
350355 existingConfig = { } ;
@@ -426,6 +431,9 @@ function resolveMcpServerConfigJsonPath(
426431 case "amp" : {
427432 return [ "amp.mcpServers" , "trigger" ] ;
428433 }
434+ case "zed" : {
435+ return [ "context_servers" , "trigger" ] ;
436+ }
429437 case "claude-code" : {
430438 if ( scope . scope === "local" ) {
431439 const projectPath = process . cwd ( ) ;
@@ -519,6 +527,13 @@ function resolveMcpServerConfig(
519527 args,
520528 } ;
521529 }
530+ case "zed" : {
531+ return {
532+ source : "custom" ,
533+ command : "npx" ,
534+ args,
535+ } ;
536+ }
522537 }
523538}
524539
0 commit comments