Skip to main content

OpenCode

Add Walrus Memory to OpenCode so the agent can save and recall durable facts. OpenCode uses the MCP server (the memory tools); the automatic-memory plugin hooks are available on Claude Code, Codex, Cursor, and Antigravity.

  • Node.js 20+
  • A Walrus Memory account. The first memory tool call opens a browser sign-in (memwal_login).

Installation​

Add the server to ~/.config/opencode/opencode.json as a local (stdio) MCP server:

Source: mcp/opencode.md
{
"mcp": {
"memwal": {
"type": "local",
"command": ["npx", "-y", "@mysten-incubation/memwal-mcp"],
"enabled": true
}
}
}

To pin a default namespace, add "environment": { "MEMWAL_NAMESPACE": "<name>" } to the server entry. Restart OpenCode, then ask the agent to run memwal_login on first use.

Available tools​

ToolDescription
memwal_rememberSave a durable fact (preference, decision, constraint, identity).
memwal_remember_bulkSave several distinct facts in one call.
memwal_recallSemantic search across stored memories for relevant context.
memwal_analyzeExtract and save multiple facts from a passage of text.
memwal_restoreRebuild the search index from Walrus (recovery).
memwal_healthFast connectivity check.
memwal_login / memwal_logoutConnect or disconnect this client.

The tool descriptions tell the agent to save and recall proactively. See Reference for full parameters.

Verify​

Ask the agent what MCP tools it has available. You should see the memwal_* tools. State a durable fact and confirm the agent saves it with memwal_remember.

Troubleshooting​

  • Tools missing: restart OpenCode after editing opencode.json.
  • Not signed in: ask the agent to run memwal_login, approve in the browser, then retry.
  • memwal_recall returns nothing although you saved before: run memwal_restore <namespace> to rebuild the index from Walrus.