@@ -24,53 +24,91 @@ static class McpServerInstaller
2424{
2525 const string ServerName = "seq" ;
2626
27- // Agents whose MCP config location or shape diverges from the common
28- // `.{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.
3227 static readonly IReadOnlyDictionary < string , AgentTarget > KnownAgents =
3328 new Dictionary < string , AgentTarget >
3429 {
35- // Claude Code reads project servers from a root `.mcp.json`, and
36- // user-global servers from `~/.claude.json`.
3730 [ "claude" ] = new (
3831 global => global
3932 ? Path . Combine ( UserProfile , ".claude.json" )
4033 : Path . Combine ( Environment . CurrentDirectory , ".mcp.json" ) ,
4134 "mcpServers" ) ,
4235
43- // Windsurf keeps a single user-global config under `~/.codeium`.
4436 [ "windsurf" ] = new (
4537 global => global
4638 ? Path . Combine ( UserProfile , ".codeium" , "windsurf" , "mcp_config.json" )
47- : Path . Combine ( Environment . CurrentDirectory , ".windsurf" , "mcp.json" ) ,
39+ : throw new NotSupportedException (
40+ "Windsurf only supports a user-global MCP config; re-run with `--global`." ) ,
4841 "mcpServers" ) ,
4942
50- // 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.
5343 [ "vscode" ] = new (
5444 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." )
45+ ? Path . Combine ( VsCodeUserDir , "mcp.json" )
5746 : Path . Combine ( Environment . CurrentDirectory , ".vscode" , "mcp.json" ) ,
5847 "servers" ) ,
48+
49+ [ "copilot" ] = new (
50+ global => global
51+ ? Path . Combine ( UserProfile , ".copilot" , "mcp-config.json" )
52+ : throw new NotSupportedException (
53+ "GitHub Copilot only supports a user-global MCP config; re-run with `--global`." ) ,
54+ "mcpServers" ) ,
5955
60- // Qwen Code reads MCP servers from the `mcpServers` key of its `settings.json`,
61- // both user-global (`~/.qwen`) and per-project (`.qwen`) - not a standalone `mcp.json`.
6256 [ "qwen" ] = new (
6357 global => Path . Combine (
6458 global ? UserProfile : Environment . CurrentDirectory ,
6559 ".qwen" ,
6660 "settings.json" ) ,
6761 "mcpServers" ) ,
62+
63+ [ "gemini" ] = new (
64+ global => Path . Combine (
65+ global ? UserProfile : Environment . CurrentDirectory ,
66+ ".gemini" ,
67+ "settings.json" ) ,
68+ "mcpServers" ) ,
69+
70+ [ "zed" ] = new (
71+ global => global
72+ ? Path . Combine ( XdgConfigHome , "zed" , "settings.json" )
73+ : Path . Combine ( Environment . CurrentDirectory , ".zed" , "settings.json" ) ,
74+ "context_servers" ) ,
75+
76+ [ "amazonq" ] = new (
77+ global => global
78+ ? Path . Combine ( UserProfile , ".aws" , "amazonq" , "mcp.json" )
79+ : Path . Combine ( Environment . CurrentDirectory , ".amazonq" , "mcp.json" ) ,
80+ "mcpServers" ) ,
81+
82+ [ "roo" ] = new (
83+ global => global
84+ ? throw new NotSupportedException (
85+ "Roo Code stores user-global MCP servers in VS Code extension storage; install into a project instead." )
86+ : Path . Combine ( Environment . CurrentDirectory , ".roo" , "mcp.json" ) ,
87+ "mcpServers" ) ,
88+
89+ [ "codex" ] = Unsupported (
90+ "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\" ]" ) ,
91+
92+ [ "goose" ] = Unsupported (
93+ "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" ) ,
94+
95+ [ "continue" ] = Unsupported (
96+ "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" ) ,
97+ } ;
98+
99+ static readonly IReadOnlyDictionary < string , string > AgentAliases =
100+ new Dictionary < string , string >
101+ {
102+ [ "github" ] = "copilot"
68103 } ;
69104
70105 public static void Install ( string ? agent , bool global , string ? profileName = null )
71106 {
72107 agent ??= "agents" ;
73108
109+ if ( AgentAliases . TryGetValue ( agent , out var alias ) )
110+ agent = alias ;
111+
74112 var target = KnownAgents . TryGetValue ( agent , out var known ) ? known : Convention ( agent ) ;
75113 var path = target . ResolvePath ( global ) ;
76114
@@ -98,12 +136,19 @@ public static void Install(string? agent, bool global, string? profileName = nul
98136 [ "args" ] = args ,
99137 } ;
100138
139+ Console . Write ( "Installing MCP server to `{0}`..." , path ) ;
140+
101141 Directory . CreateDirectory ( Path . GetDirectoryName ( path ) ! ) ;
102142 File . WriteAllText ( path , root . ToString ( Newtonsoft . Json . Formatting . Indented ) ) ;
103143
144+ Console . WriteLine ( " Done." ) ;
145+
104146 Log . Information ( "Installed Seq MCP server for {Agent} to {Path}" , agent , path ) ;
105147 }
106148
149+ static AgentTarget Unsupported ( string message ) =>
150+ new ( _ => throw new NotSupportedException ( message ) , "mcpServers" ) ;
151+
107152 static AgentTarget Convention ( string agent ) =>
108153 new (
109154 global => Path . Combine (
@@ -114,5 +159,18 @@ static AgentTarget Convention(string agent) =>
114159
115160 static string UserProfile => Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ;
116161
162+ static string XdgConfigHome =>
163+ Environment . GetEnvironmentVariable ( "XDG_CONFIG_HOME" ) is { Length : > 0 } configHome
164+ ? configHome
165+ : Path . Combine ( UserProfile , ".config" ) ;
166+
167+ // VS Code keeps per-user data in an OS-specific directory.
168+ static string VsCodeUserDir =>
169+ OperatingSystem . IsWindows ( )
170+ ? Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . ApplicationData ) , "Code" , "User" )
171+ : OperatingSystem . IsMacOS ( )
172+ ? Path . Combine ( UserProfile , "Library" , "Application Support" , "Code" , "User" )
173+ : Path . Combine ( XdgConfigHome , "Code" , "User" ) ;
174+
117175 sealed record AgentTarget ( Func < bool , string > ResolvePath , string ServerMapKey ) ;
118176}
0 commit comments