Skip to content

Commit ca37338

Browse files
committed
CODEX mcp fix
1 parent 6ec1c07 commit ca37338

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/vs/workbench/contrib/roopik/electron-main/mcp/installer/mcpInstaller.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,17 @@ export class McpInstaller extends Disposable {
169169
} else if (agent === 'codex') {
170170
// Codex extension - check extension binary
171171
const extPath = this._platformAdapter?.getExternalExtensionPath(CODEX_EXTENSION_ID);
172-
installed = !!getCodexBinaryPath(extPath);
172+
installed = !!getCodexBinaryPath(extPath) || installed;
173173
registrationMethod = 'cli-command';
174174
} else if (agent === 'codex-cli') {
175175
// Codex CLI - check global command
176176
installed = await isCommandAvailable('codex');
177177
registrationMethod = 'cli-command';
178178
}
179179

180-
if (installed) {
180+
// For CLI-based agents, we can't reliably check registration from config files
181+
// because they manage their own storage locations
182+
if (installed && registrationMethod !== 'cli-command') {
181183
const config = readJsonConfig<{ mcpServers?: Record<string, unknown> }>(configPath);
182184
registered = isRoopikRegistered(config);
183185
}

src/vs/workbench/contrib/roopik/electron-main/mcp/installer/mcpInstallerUtils.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,14 @@ export function getAgentConfigPath(agent: AiAgent): string {
158158
return path.join(home, '.gemini', 'settings.json');
159159

160160
case 'codex':
161-
// Codex extension uses CLI commands, no config file
162-
return path.join(home, '.codex', 'mcp.json');
161+
// Codex extension (uses binary from VS Code extension folder)
162+
// Both extension and CLI share the same config: ~/.codex/config.toml
163+
return path.join(home, '.codex', 'config.toml');
163164

164165
case 'codex-cli':
165-
// Codex CLI uses CLI commands, no config file
166-
return path.join(home, '.codex', 'mcp.json');
166+
// Codex global CLI (uses `codex` command in PATH)
167+
// Both extension and CLI share the same config: ~/.codex/config.toml
168+
return path.join(home, '.codex', 'config.toml');
167169

168170
default:
169171
throw new Error(`Unknown agent: ${agent}`);

0 commit comments

Comments
 (0)