Repository navigation
Conversation
`memmachine agent install {claude-code,codex} --server <url> --tenant
<name>` points an agent at a MemMachine server's memory tools, and
`memmachine agent disable` takes it back out. Both agents speak MCP over
streamable HTTP with static headers, so one endpoint (`<server>/v1/mcp`)
and one header (`X-MemMachine-Tenant`) serve both, and the tools live on
the server.
Claude Code's user scope belongs to the `claude` executable, so the
installer runs `claude mcp add --transport http --scope user` through it,
preceded by `claude mcp remove` because `add` refuses a name it already
holds; without that executable on PATH the error names the command to run
by hand. Project scope writes `.mcp.json` in the current directory.
Codex gets `[mcp_servers.memmachine]` and its `http_headers` table in
`$CODEX_HOME/config.toml`, or in `<cwd>/.codex/config.toml` for project
scope.
A file this installer writes is parsed before it is edited, backed up to
`<file>.bak`, and left alone when it already holds the entry, so a second
install changes nothing. The Codex tables are replaced or appended as
text and every other line is carried over, and the result is parsed back
before it is written, so a config the installer cannot edit safely (an
inline table, a dotted key) is refused rather than duplicated. Reading
TOML needs Python 3.11's tomllib, so on 3.10 the Codex commands say that
instead of guessing.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YBbQgZiCqeoLu83EkbEFHE
The tests cover what the installer promises: the exact `claude mcp add` and `claude mcp remove` commands (with the remove that makes a second install leave one entry), the `.mcp.json` shape, Codex's two tables in `$CODEX_HOME`, in `~/.codex` and in a project's `.codex`, a second install that writes nothing, disable that leaves other servers and other tables in place, `--dry-run` that prints a diff and writes nothing, and the `<file>.bak` copy of what a write replaced. A Codex config with comments, other tables and a multi-line string that holds table headers as text comes back byte for byte after an install and a disable, which is what the text-level edit has to hold. Installs run through `cli.main`, so they also hold that the agent commands need no server URL for the REST client. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YBbQgZiCqeoLu83EkbEFHE
The page says what an agent gets (the two MCP tools and the endpoint that serves them), how to read the markers a result carries and which of them `memory_expand` takes, how a tenant name is chosen, and the install and disable steps for Claude Code and Codex in both scopes, with the command and the file each one writes. It also states what the installer keeps: one entry however often it runs, a `<file>.bak` beside every file it writes, and a `--dry-run` that writes nothing. Capture through the agents' Stop hooks is named as what comes next, and ambient recall as designed and off, so a reader knows the tools are the whole recall surface today. The page joins the Open Source group in the navigation. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YBbQgZiCqeoLu83EkbEFHE
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YBbQgZiCqeoLu83EkbEFHE
One verb for the operation from EventMemory up: query. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YBbQgZiCqeoLu83EkbEFHE
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01YBbQgZiCqeoLu83EkbEFHE
edwinyyyu
left a comment
There was a problem hiding this comment.
Docs gaps (line comments), plus one on the installer: agent install --dry-run for the Claude user scope checks PATH for claude before the dry-run branch, so a dry run fails on a machine without claude, and its output shows only the add command, not the remove that precedes it.
|
|
||
| ## Choosing a tenant name | ||
|
|
||
| A tenant is one human user: every session of every agent that user runs |
There was a problem hiding this comment.
The page never says the tenant must exist on the server before the tools work: #1691's resolve_tenant raises TenantNotFoundError -> ToolError, creation is PUT /v1/tenants/{tenant} (#1690), and the installer makes no HTTP request. A reader who follows this section gets tool errors until someone creates the tenant.
| as one. Its two ends are the handles a further expansion continues | ||
| from. | ||
|
|
||
| A direction that comes back empty means the session ran out that way. |
There was a problem hiding this comment.
#1691 does not answer an empty side with nothing; it returns a sentence ("Nothing earlier: the session starts here." / "Nothing later: ...").
Slice 3 of
design/coding_agent_integration.md(#1579): the client-side glue that points Claude Code and Codex at a MemMachine server's memory tools. Directly onmain; it depends on no server change to land, but it is only useful once the server serves/v1/mcp(the v1 API and MCP PRs that follow), so it merges after #1691.What it does
memmachine agent install {claude-code,codex} --server <url> --tenant <name> [--scope user|project] [--dry-run]andmemmachine agent disable {claude-code,codex} [--scope ...], inmemmachine_client.coding_agent. The MCP entry is<server>/v1/mcpover streamable HTTP with the headerX-MemMachine-Tenant: <tenant>, one tenant per human user.claude mcp remove --scope user memmachinethenclaude mcp add --transport http --scope user memmachine <url> --header "X-MemMachine-Tenant: <tenant>"through theclaudeonPATH(the add refuses a name it already holds, so a reinstall removes first); without one, prints the exact command and exits non-zero. Project scope writes.mcp.jsonin the current directory, merging with what is there.[mcp_servers.memmachine](url) and[mcp_servers.memmachine.http_headers]into$CODEX_HOME/config.toml(default~/.codex/config.toml) or<cwd>/.codex/config.toml, by text, replacing exactly those two tables where they stand or appending them, with every other byte of the file preserved; the result is parsed back before it is written, and an entry in a form the editor does not own (inline table, dotted key) is refused rather than duplicated.<file>.bakfirst; an unchanged file is not rewritten;--dry-runprints the command or a unified diff.docs/open_source/coding_agents.mdx, in the navigation.Verified
Flag names and file shapes against the current Claude Code MCP documentation and the Codex configuration reference, and empirically against
claude2.1.274 (isolatedHOMEandCLAUDE_CONFIG_DIR) andcodex-cli0.149.1 (CODEX_HOMEon a temp dir): the add command produces the documented entry, a second add fails without the preceding remove,codex mcp get memmachinereportsstreamable_httpwith the header, and disable leavescodex mcp listempty. 22 tests cover both agents, both scopes, reinstall, disable, dry run, preservation of unrelated content, the backup, and the missingclaude.Two calls to review
tomllibdoes not exist. The Codex commands refuse on 3.10 with a clear message rather than adding atomlidependency; the alternative istomli>=2; python_version < "3.11"in the client's dependencies.claudeitself, which keeps its own backups, so the installer makes no.bakthere.🤖 Generated with Claude Code
https://claude.ai/code/session_01YBbQgZiCqeoLu83EkbEFHE
Stack: coding agents
Slices of
design/coding_agent_integration.md(#1579), in dependency order. 1 sits on the event-memory port stack (#1684 → #1686 → #1685 → #1687 → #1688). 2 depends on 1 in code. 3 shares no code with the server, so its branch is on main, but it depends on 2 functionally: it writes a configuration for the endpoint 2 serves, and merges after it. 4 registers the block kinds capture writes, on 2. 5 is the capture client on 3, and depends on 4 functionally.memory_queryandmemory_expandserved at/v1/mcpmemmachine agent installfor Claude Code and Codex, and the docs pageStophooks, in the client