66import subprocess
77from pathlib import Path
88
9+ from ..kernel .runtime import get_cccc_mcp_stdio_command
910from ..util .conv import coerce_bool
1011from ..util .fs import read_json
1112
@@ -106,10 +107,11 @@ def ensure_mcp_installed(runtime: str, cwd: Path, *, auto_mcp_runtimes: tuple[st
106107 return True
107108 if is_mcp_installed (runtime ):
108109 return True
110+ cccc_cmd = get_cccc_mcp_stdio_command ()
109111 try :
110112 if runtime == "claude" :
111113 result = subprocess .run (
112- ["claude" , "mcp" , "add" , "-s" , "user" , "cccc" , "--" , "cccc" , "mcp" ],
114+ ["claude" , "mcp" , "add" , "-s" , "user" , "cccc" , "--" , * cccc_cmd ],
113115 capture_output = True ,
114116 text = True ,
115117 cwd = str (cwd ),
@@ -119,7 +121,7 @@ def ensure_mcp_installed(runtime: str, cwd: Path, *, auto_mcp_runtimes: tuple[st
119121
120122 if runtime == "codex" :
121123 result = subprocess .run (
122- ["codex" , "mcp" , "add" , "cccc" , "--" , "cccc" , "mcp" ],
124+ ["codex" , "mcp" , "add" , "cccc" , "--" , * cccc_cmd ],
123125 capture_output = True ,
124126 text = True ,
125127 cwd = str (cwd ),
@@ -129,7 +131,7 @@ def ensure_mcp_installed(runtime: str, cwd: Path, *, auto_mcp_runtimes: tuple[st
129131
130132 if runtime == "droid" :
131133 result = subprocess .run (
132- ["droid" , "mcp" , "add" , "--type" , "stdio" , "cccc" , "cccc" , "mcp" ],
134+ ["droid" , "mcp" , "add" , "--type" , "stdio" , "cccc" , * cccc_cmd ],
133135 capture_output = True ,
134136 text = True ,
135137 cwd = str (cwd ),
@@ -139,7 +141,7 @@ def ensure_mcp_installed(runtime: str, cwd: Path, *, auto_mcp_runtimes: tuple[st
139141
140142 if runtime == "amp" :
141143 result = subprocess .run (
142- ["amp" , "mcp" , "add" , "cccc" , "cccc" , "mcp" ],
144+ ["amp" , "mcp" , "add" , "cccc" , * cccc_cmd ],
143145 capture_output = True ,
144146 text = True ,
145147 cwd = str (cwd ),
@@ -149,7 +151,7 @@ def ensure_mcp_installed(runtime: str, cwd: Path, *, auto_mcp_runtimes: tuple[st
149151
150152 if runtime == "auggie" :
151153 result = subprocess .run (
152- ["auggie" , "mcp" , "add" , "cccc" , "--" , "cccc" , "mcp" ],
154+ ["auggie" , "mcp" , "add" , "cccc" , "--" , * cccc_cmd ],
153155 capture_output = True ,
154156 text = True ,
155157 cwd = str (cwd ),
@@ -159,7 +161,7 @@ def ensure_mcp_installed(runtime: str, cwd: Path, *, auto_mcp_runtimes: tuple[st
159161
160162 if runtime == "neovate" :
161163 result = subprocess .run (
162- ["neovate" , "mcp" , "add" , "-g" , "cccc" , "cccc" , "mcp" ],
164+ ["neovate" , "mcp" , "add" , "-g" , "cccc" , * cccc_cmd ],
163165 capture_output = True ,
164166 text = True ,
165167 cwd = str (cwd ),
@@ -169,7 +171,7 @@ def ensure_mcp_installed(runtime: str, cwd: Path, *, auto_mcp_runtimes: tuple[st
169171
170172 if runtime == "gemini" :
171173 result = subprocess .run (
172- ["gemini" , "mcp" , "add" , "-s" , "user" , "cccc" , "cccc" , "mcp" ],
174+ ["gemini" , "mcp" , "add" , "-s" , "user" , "cccc" , * cccc_cmd ],
173175 capture_output = True ,
174176 text = True ,
175177 cwd = str (cwd ),
@@ -179,7 +181,7 @@ def ensure_mcp_installed(runtime: str, cwd: Path, *, auto_mcp_runtimes: tuple[st
179181
180182 if runtime == "kimi" :
181183 result = subprocess .run (
182- ["kimi" , "mcp" , "add" , "cccc" , "--command" , "cccc" , "mcp" ],
184+ ["kimi" , "mcp" , "add" , "cccc" , "--command" , * cccc_cmd ],
183185 capture_output = True ,
184186 text = True ,
185187 cwd = str (cwd ),
0 commit comments