Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

Fix release binary naming and Codex CLI MCP registration

Martin Vogel3589a1bd1d84
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 55df97ea4..23ff59514 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -62,11 +62,11 @@ jobs:
run: |
CGO_ENABLED=1 go build \
-ldflags "-X main.version=${{ inputs.version }}" \
- -o codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }} \
+ -o codebase-memory-mcp \
./cmd/codebase-memory-mcp/
- name: Create archive
- run: tar -czf codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}
+ run: tar -czf codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz codebase-memory-mcp
- uses: actions/upload-artifact@v4
with:
@@ -101,12 +101,12 @@ jobs:
run: |
CGO_ENABLED=1 CC=gcc go build \
-ldflags "-X main.version=${{ inputs.version }}" \
- -o codebase-memory-mcp-windows-amd64.exe \
+ -o codebase-memory-mcp.exe \
./cmd/codebase-memory-mcp/
- name: Create archive
shell: pwsh
- run: Compress-Archive -Path codebase-memory-mcp-windows-amd64.exe -DestinationPath codebase-memory-mcp-windows-amd64.zip
+ run: Compress-Archive -Path codebase-memory-mcp.exe -DestinationPath codebase-memory-mcp-windows-amd64.zip
- uses: actions/upload-artifact@v4
with:
diff --git a/README.md b/README.md
index 5cad8615c..0eabdc028 100644
--- a/README.md
+++ b/README.md
@@ -72,12 +72,17 @@ Benchmarked on Apple M3 Pro, macOS Darwin 25.3.0:
## Quick Start
1. **Download** the binary for your platform from the [latest release](https://github.com/DeusData/codebase-memory-mcp/releases/latest)
-2. **Install**:
+2. **Extract and move** to a directory on your PATH:
+ ```bash
+ tar xzf codebase-memory-mcp-*.tar.gz
+ mv codebase-memory-mcp ~/.local/bin/ # or /usr/local/bin/
+ ```
+3. **Install**:
```bash
codebase-memory-mcp install
```
-3. **Restart** Claude Code / Codex CLI
-4. Say **"Index this project"** — done.
+4. **Restart** Claude Code / Codex CLI
+5. Say **"Index this project"** — done.
The `install` command auto-detects Claude Code and Codex CLI, registers the MCP server, installs 4 task-specific skills, and ensures the binary is on your PATH. Use `--dry-run` to preview without making changes.
diff --git a/cmd/codebase-memory-mcp/install.go b/cmd/codebase-memory-mcp/install.go
index 7a485b6dd..6aa7851f8 100644
--- a/cmd/codebase-memory-mcp/install.go
+++ b/cmd/codebase-memory-mcp/install.go
@@ -87,7 +87,7 @@ func runUninstall(args []string) int {
// Codex CLI MCP deregistration + instructions
if codexPath := findCLI("codex"); codexPath != "" {
fmt.Printf("[Codex CLI] detected (%s)\n", codexPath)
- deregisterMCP(codexPath, "codex", cfg)
+ removeCodexMCP(cfg)
removeCodexInstructions(cfg)
}
@@ -254,23 +254,26 @@ func registerClaudeCodeMCP(binaryPath, claudePath string, cfg installConfig) {
}
// installCodex installs MCP registration and instructions for Codex CLI.
-func installCodex(binaryPath, codexPath string, cfg installConfig) {
+func installCodex(binaryPath, _ string, cfg installConfig) {
home, err := os.UserHomeDir()
if err != nil {
fmt.Printf(" ⚠ Cannot determine home directory: %v\n", err)
return
}
- // Register MCP server
+ // Register MCP server via config.toml
+ configFile := filepath.Join(home, ".codex", "config.toml")
+ mcpSection := fmt.Sprintf("\n[mcp_servers.codebase-memory-mcp]\ncommand = %q\n", binaryPath)
+
if cfg.dryRun {
- fmt.Printf(" [dry-run] Would run: %s mcp remove codebase-memory-mcp\n", codexPath)
- fmt.Printf(" [dry-run] Would run: %s mcp add codebase-memory-mcp -- %s\n", codexPath, binaryPath)
+ fmt.Printf(" [dry-run] Would add MCP server to: %s\n", configFile)
} else {
- _ = execCLI(codexPath, "mcp", "remove", "codebase-memory-mcp")
- if err := execCLI(codexPath, "mcp", "add", "codebase-memory-mcp", "--", binaryPath); err != nil {
+ if err := os.MkdirAll(filepath.Dir(configFile), 0o750); err != nil {
+ fmt.Printf(" ⚠ mkdir %s: %v\n", filepath.Dir(configFile), err)
+ } else if err := upsertCodexMCP(configFile, mcpSection, binaryPath); err != nil {
fmt.Printf(" ⚠ MCP registration failed: %v\n", err)
} else {
- fmt.Println(" ✓ MCP server registered")
+ fmt.Printf(" ✓ MCP server registered: %s\n", configFile)
}
}
@@ -293,6 +296,34 @@ func installCodex(binaryPath, codexPath string, cfg installConfig) {
}
}
+// upsertCodexMCP adds or updates the codebase-memory-mcp section in config.toml.
+func upsertCodexMCP(configFile, mcpSection, binaryPath string) error {
+ content, err := os.ReadFile(configFile)
+ if err != nil && !os.IsNotExist(err) {
+ return err
+ }
+
+ text := string(content)
+
+ // If section already exists, replace the command line
+ const sectionHeader = "[mcp_servers.codebase-memory-mcp]"
+ if idx := strings.Index(text, sectionHeader); idx >= 0 {
+ // Find the end of this section (next [ or EOF)
+ rest := text[idx+len(sectionHeader):]
+ endIdx := strings.Index(rest, "\n[")
+ if endIdx < 0 {
+ endIdx = len(rest)
+ }
+ newSection := fmt.Sprintf("%s\ncommand = %q\n", sectionHeader, binaryPath)
+ text = text[:idx] + newSection + rest[endIdx:]
+ } else {
+ // Append new section
+ text += mcpSection
+ }
+
+ return os.WriteFile(configFile, []byte(text), 0o600)
+}
+
// removeClaudeSkills removes all 4 skill directories.
func removeClaudeSkills(cfg installConfig) {
home, err := os.UserHomeDir()
@@ -331,6 +362,46 @@ func deregisterMCP(cliPath, cliName string, cfg installConfig) {
}
}
+// removeCodexMCP removes the codebase-memory-mcp section from Codex config.toml.
+func removeCodexMCP(cfg installConfig) {
+ home, err := os.UserHomeDir()
+ if err != nil {
+ return
+ }
+ configFile := filepath.Join(home, ".codex", "config.toml")
+ content, err := os.ReadFile(configFile)
+ if err != nil {
+ return
+ }
+
+ text := string(content)
+ const sectionHeader = "[mcp_servers.codebase-memory-mcp]"
+ idx := strings.Index(text, sectionHeader)
+ if idx < 0 {
+ return
+ }
+
+ if cfg.dryRun {
+ fmt.Printf(" [dry-run] Would remove MCP section from: %s\n", configFile)
+ return
+ }
+
+ // Find end of section (next [ or EOF)
+ rest := text[idx+len(sectionHeader):]
+ endIdx := strings.Index(rest, "\n[")
+ if endIdx < 0 {
+ text = strings.TrimRight(text[:idx], "\n")
+ } else {
+ text = text[:idx] + rest[endIdx+1:]
+ }
+
+ if err := os.WriteFile(configFile, []byte(text), 0o600); err != nil {
+ fmt.Printf(" ⚠ update %s: %v\n", configFile, err)
+ } else {
+ fmt.Printf(" ✓ Removed MCP section from: %s\n", configFile)
+ }
+}
+
// removeCodexInstructions removes the Codex instructions file.
func removeCodexInstructions(cfg installConfig) {
home, err := os.UserHomeDir()