@@ -26,9 +26,11 @@ static class McpServerInstaller
2626
2727 // Agents whose MCP config location or shape diverges from the common
2828 // `.{agent}/mcp.json` + `mcpServers` convention. Anything not listed here -
29- // including the default `agents` name and any unknown agent - uses the
30- // convention (see `Convention`), so adding support for a conformant agent
31- // requires no change at all, and a divergent one is a single entry here.
29+ // including the default `agents` name, Cursor, and any unknown agent - uses
30+ // the convention (see `Convention`), so adding support for a conformant agent
31+ // requires no change at all, and a divergent one is a single entry here. Agents
32+ // whose config is a format we can't safely edit (TOML/YAML) are listed via
33+ // `Unsupported` so the user gets a copy-paste snippet instead of an ignored file.
3234 static readonly IReadOnlyDictionary < string , AgentTarget > KnownAgents =
3335 new Dictionary < string , AgentTarget >
3436 {
@@ -40,20 +42,22 @@ static class McpServerInstaller
4042 : Path . Combine ( Environment . CurrentDirectory , ".mcp.json" ) ,
4143 "mcpServers" ) ,
4244
43- // Windsurf keeps a single user-global config under `~/.codeium`.
45+ // Windsurf only reads a single user-global config under `~/.codeium`; it has
46+ // no project-level MCP file, so a project install would be silently ignored.
4447 [ "windsurf" ] = new (
4548 global => global
4649 ? Path . Combine ( UserProfile , ".codeium" , "windsurf" , "mcp_config.json" )
47- : Path . Combine ( Environment . CurrentDirectory , ".windsurf" , "mcp.json" ) ,
50+ : throw new NotSupportedException (
51+ "Windsurf only supports a user-global MCP config; re-run with `--global` (seqcli mcp install --global --agent windsurf)." ) ,
4852 "mcpServers" ) ,
4953
5054 // VS Code nests servers under a `servers` key. Project config lives in
51- // `.vscode/mcp.json`; the user-global equivalent lives inside `settings.json`,
52- // which is a different merge target and isn't supported here yet.
55+ // `.vscode/mcp.json`; the user-global equivalent is a `mcp.json` in the
56+ // VS Code user directory (`%APPDATA%\Code\User` on Windows, `~/Library/
57+ // Application Support/Code/User` on macOS, `$XDG_CONFIG_HOME/Code/User` otherwise).
5358 [ "vscode" ] = new (
5459 global => global
55- ? throw new NotSupportedException (
56- "VS Code stores user-level MCP servers in settings.json; install into a project with `seqcli mcp install --agent vscode` instead." )
60+ ? Path . Combine ( VsCodeUserDir , "mcp.json" )
5761 : Path . Combine ( Environment . CurrentDirectory , ".vscode" , "mcp.json" ) ,
5862 "servers" ) ,
5963
@@ -65,6 +69,51 @@ static class McpServerInstaller
6569 ".qwen" ,
6670 "settings.json" ) ,
6771 "mcpServers" ) ,
72+
73+ // Gemini CLI mirrors Qwen Code: `mcpServers` inside `settings.json` under `.gemini`.
74+ [ "gemini" ] = new (
75+ global => Path . Combine (
76+ global ? UserProfile : Environment . CurrentDirectory ,
77+ ".gemini" ,
78+ "settings.json" ) ,
79+ "mcpServers" ) ,
80+
81+ // Zed embeds servers in its `settings.json` under a `context_servers` key
82+ // (project `.zed/settings.json`; user-global `$XDG_CONFIG_HOME/zed/settings.json`).
83+ [ "zed" ] = new (
84+ global => global
85+ ? Path . Combine ( XdgConfigHome , "zed" , "settings.json" )
86+ : Path . Combine ( Environment . CurrentDirectory , ".zed" , "settings.json" ) ,
87+ "context_servers" ) ,
88+
89+ // Amazon Q Developer CLI uses a standalone `mcp.json`: `.amazonq` per-project,
90+ // but `~/.aws/amazonq` for the user-global file.
91+ [ "amazonq" ] = new (
92+ global => global
93+ ? Path . Combine ( UserProfile , ".aws" , "amazonq" , "mcp.json" )
94+ : Path . Combine ( Environment . CurrentDirectory , ".amazonq" , "mcp.json" ) ,
95+ "mcpServers" ) ,
96+
97+ // Roo Code reads a project `.roo/mcp.json`; its user-global store lives in
98+ // VS Code extension storage, whose path is publisher/platform-specific.
99+ [ "roo" ] = new (
100+ global => global
101+ ? throw new NotSupportedException (
102+ "Roo Code stores user-global MCP servers in VS Code extension storage; install into a project instead (seqcli mcp install --agent roo)." )
103+ : Path . Combine ( Environment . CurrentDirectory , ".roo" , "mcp.json" ) ,
104+ "mcpServers" ) ,
105+
106+ // Codex, Goose, and Continue store MCP config in TOML/YAML that seqcli can't
107+ // safely edit, so we print the exact config to add by hand rather than writing
108+ // a JSON file the agent would ignore.
109+ [ "codex" ] = Unsupported (
110+ "Codex reads MCP servers from ~/.codex/config.toml (TOML), which seqcli can't edit automatically. Add this block:\n \n [mcp_servers.seq]\n command = \" seqcli\" \n args = [\" mcp\" , \" run\" ]" ) ,
111+
112+ [ "goose" ] = Unsupported (
113+ "Goose reads MCP servers from ~/.config/goose/config.yaml (YAML) under `extensions`, which seqcli can't edit automatically. Add:\n \n extensions:\n seq:\n type: stdio\n cmd: seqcli\n args: [mcp, run]\n enabled: true" ) ,
114+
115+ [ "continue" ] = Unsupported (
116+ "Continue reads MCP servers from YAML, which seqcli can't edit automatically. Create .continue/mcpServers/seq.yaml with:\n \n name: Seq\n version: 0.0.1\n schema: v1\n mcpServers:\n - name: seq\n command: seqcli\n args:\n - mcp\n - run" ) ,
68117 } ;
69118
70119 public static void Install ( string ? agent , bool global , string ? profileName = null )
@@ -104,6 +153,11 @@ public static void Install(string? agent, bool global, string? profileName = nul
104153 Log . Information ( "Installed Seq MCP server for {Agent} to {Path}" , agent , path ) ;
105154 }
106155
156+ // For agents whose config format we can't write, resolving any path throws with a
157+ // copy-paste snippet; the command runner turns this into a clean exit-1 message.
158+ static AgentTarget Unsupported ( string message ) =>
159+ new ( _ => throw new NotSupportedException ( message ) , "mcpServers" ) ;
160+
107161 static AgentTarget Convention ( string agent ) =>
108162 new (
109163 global => Path . Combine (
@@ -114,5 +168,18 @@ static AgentTarget Convention(string agent) =>
114168
115169 static string UserProfile => Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ;
116170
171+ static string XdgConfigHome =>
172+ Environment . GetEnvironmentVariable ( "XDG_CONFIG_HOME" ) is { Length : > 0 } configHome
173+ ? configHome
174+ : Path . Combine ( UserProfile , ".config" ) ;
175+
176+ // VS Code keeps per-user data in an OS-specific directory.
177+ static string VsCodeUserDir =>
178+ OperatingSystem . IsWindows ( )
179+ ? Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "Code" , "User" )
180+ : OperatingSystem . IsMacOS ( )
181+ ? Path . Combine ( UserProfile , "Library" , "Application Support" , "Code" , "User" )
182+ : Path . Combine ( XdgConfigHome , "Code" , "User" ) ;
183+
117184 sealed record AgentTarget ( Func < bool , string > ResolvePath , string ServerMapKey ) ;
118185}
0 commit comments