Summary
codebase-memory-mcp install writes the MCP server config to the wrong JSON key path for OpenClaw, so OpenClaw never loads the server. The config lands at the top-level mcpServers key, but OpenClaw's config schema expects it nested under mcp.servers.
Environment
- codebase-memory-mcp: installed via
install (standard build, stdio transport)
- OpenClaw: 2026.6.10 (config schema
McpConfigSchema expects mcp.servers)
- OS: Linux
Root cause
In src/cli/cli.c:
install_editor_agent_configs (around line 3233) routes OpenClaw through install_generic_agent_config(..., cbm_install_editor_mcp).
cbm_install_editor_mcp (line 789) writes the server entry under the top-level mcpServers key (lines 815-818):
/* Get or create mcpServers object */
yyjson_mut_val *servers = yyjson_mut_obj_get(root, "mcpServers");
...
yyjson_mut_obj_add_val(mdoc, root, "mcpServers", servers);
This mcpServers (camelCase, top-level) shape is correct for Cursor / Windsurf / Gemini / VS Code / Zed / KiloCode, which is why cbm_install_editor_mcp is shared across them. But OpenClaw's schema reads mcp.servers (dotted/nested), not top-level mcpServers. So the written entry is silently ignored.
Observed behavior
After running install with OpenClaw detected:
- Install reports:
OpenClaw: mcp: ~/.openclaw/openclaw.json
- But
~/.openclaw/openclaw.json only gains a top-level mcpServers object.
openclaw mcp list does NOT list codebase-memory-mcp.
openclaw mcp probe reports 0 tools from the server.
- The MCP server is effectively not installed for OpenClaw.
Expected behavior
For OpenClaw, the install should write the nested form:
{
"mcp": {
"servers": {
"codebase-memory-mcp": {
"enabled": true,
"command": "<binary_path>",
"args": []
}
}
}
}
OpenClaw's mcp.servers entries use command + args (stdio) or url + transport (http), with an optional enabled flag — not the flat mcpServers map.
Suggested fix
Give OpenClaw its own install path (similar to how Codex/Aider get section-based configs) instead of reusing cbm_install_editor_mcp. Either:
- Add a dedicated
cbm_install_openclaw_mcp that writes the nested mcp.servers shape, and route OpenClaw to it in install_editor_agent_configs; or
- Make
cbm_install_editor_mcp schema-aware per agent (pass the target key path as a parameter).
The uninstall path (uninstall_agent_mcp_instr for OpenClaw, around line 3711) likely has the mirror issue and should be checked together.
Workaround
Manually inject the nested entry (e.g. with jq) and restart the OpenClaw gateway:
jq '.mcp.servers["codebase-memory-mcp"] = {
"enabled": true,
"command": "<binary_path>",
"args": []
}' ~/.openclaw/openclaw.json > /tmp/oc.json.new && mv /tmp/oc.json.new ~/.openclaw/openclaw.json
After restart, openclaw mcp probe correctly reports codebase-memory-mcp: 14 tools.
Additional context
- OpenClaw and the editor agents (Cursor et al.) genuinely use different config schemas, so sharing
cbm_install_editor_mcp across all of them is the underlying mismatch.
- The same top-level
mcpServers write is fine for the other editors; only OpenClaw is affected.
Summary
codebase-memory-mcp installwrites the MCP server config to the wrong JSON key path for OpenClaw, so OpenClaw never loads the server. The config lands at the top-levelmcpServerskey, but OpenClaw's config schema expects it nested undermcp.servers.Environment
install(standard build, stdio transport)McpConfigSchemaexpectsmcp.servers)Root cause
In
src/cli/cli.c:install_editor_agent_configs(around line 3233) routes OpenClaw throughinstall_generic_agent_config(..., cbm_install_editor_mcp).cbm_install_editor_mcp(line 789) writes the server entry under the top-levelmcpServerskey (lines 815-818):This
mcpServers(camelCase, top-level) shape is correct for Cursor / Windsurf / Gemini / VS Code / Zed / KiloCode, which is whycbm_install_editor_mcpis shared across them. But OpenClaw's schema readsmcp.servers(dotted/nested), not top-levelmcpServers. So the written entry is silently ignored.Observed behavior
After running
installwith OpenClaw detected:OpenClaw: mcp: ~/.openclaw/openclaw.json~/.openclaw/openclaw.jsononly gains a top-levelmcpServersobject.openclaw mcp listdoes NOT listcodebase-memory-mcp.openclaw mcp probereports 0 tools from the server.Expected behavior
For OpenClaw, the install should write the nested form:
{ "mcp": { "servers": { "codebase-memory-mcp": { "enabled": true, "command": "<binary_path>", "args": [] } } } }OpenClaw's
mcp.serversentries usecommand+args(stdio) orurl+transport(http), with an optionalenabledflag — not the flatmcpServersmap.Suggested fix
Give OpenClaw its own install path (similar to how Codex/Aider get section-based configs) instead of reusing
cbm_install_editor_mcp. Either:cbm_install_openclaw_mcpthat writes the nestedmcp.serversshape, and route OpenClaw to it ininstall_editor_agent_configs; orcbm_install_editor_mcpschema-aware per agent (pass the target key path as a parameter).The uninstall path (
uninstall_agent_mcp_instrfor OpenClaw, around line 3711) likely has the mirror issue and should be checked together.Workaround
Manually inject the nested entry (e.g. with
jq) and restart the OpenClaw gateway:After restart,
openclaw mcp probecorrectly reportscodebase-memory-mcp: 14 tools.Additional context
cbm_install_editor_mcpacross all of them is the underlying mismatch.mcpServerswrite is fine for the other editors; only OpenClaw is affected.