Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Checkpoint: File edits

rUvc4824b790663
diff --git a/v3/@claude-flow/codex/src/initializer.ts b/v3/@claude-flow/codex/src/initializer.ts
index fac14fd9dd..11bb43e29b 100644
--- a/v3/@claude-flow/codex/src/initializer.ts
+++ b/v3/@claude-flow/codex/src/initializer.ts
@@ -313,6 +313,55 @@ export class CodexInitializer {
return fs.pathExists(skillPath);
}
+ /**
+ * Register claude-flow as MCP server with Codex
+ */
+ private async registerMCPServer(): Promise<{ registered: boolean; warning?: string }> {
+ try {
+ const { execSync } = await import('child_process');
+
+ // Check if codex CLI is available
+ try {
+ execSync('which codex', { stdio: 'pipe' });
+ } catch {
+ return {
+ registered: false,
+ warning: 'Codex CLI not found. Run: codex mcp add claude-flow -- npx claude-flow mcp start',
+ };
+ }
+
+ // Check if already registered
+ try {
+ const list = execSync('codex mcp list 2>&1', { encoding: 'utf-8' });
+ if (list.includes('claude-flow')) {
+ return { registered: true }; // Already registered
+ }
+ } catch {
+ // Ignore list errors
+ }
+
+ // Register the MCP server
+ try {
+ execSync('codex mcp add claude-flow -- npx claude-flow mcp start', {
+ stdio: 'pipe',
+ timeout: 10000,
+ });
+ return { registered: true };
+ } catch (err) {
+ const errorMessage = err instanceof Error ? err.message : String(err);
+ return {
+ registered: false,
+ warning: `Failed to register MCP server: ${errorMessage}. Run manually: codex mcp add claude-flow -- npx claude-flow mcp start`,
+ };
+ }
+ } catch {
+ return {
+ registered: false,
+ warning: 'Could not register MCP server. Run manually: codex mcp add claude-flow -- npx claude-flow mcp start',
+ };
+ }
+ }
+
/**
* Generate AGENTS.md content
*/