This page explains whatDocumentation Index
Fetch the complete documentation index at: https://docs.memwal.ai/llms.txt
Use this file to discover all available pages before exploring further.
@mysten-incubation/memwal-mcp actually does on the client machine.
Runtime modes
The package has two main runtime modes.Auth-required mode
This mode runs when:- the package was launched by an MCP host such as Cursor, Claude Desktop, Claude Code, Codex, or Antigravity
~/.memwal/credentials.jsondoes not exist yet
- responds to
initialize - advertises the normal MemWal memory tools
- also advertises
memwal_login - returns an actionable error for the memory tools until sign-in completes
Bridged mode
This mode runs after credentials exist. The package:- loads the saved delegate key + account metadata from
~/.memwal/credentials.json - opens an authenticated SSE bridge to the relayer
- forwards stdio MCP traffic from the local client to the relayer
- intercepts
memwal_loginandmemwal_logoutlocally instead of forwarding them upstream
First-run flow
Credential file
The package stores credentials here:- delegate private key
- delegate public key
- delegate address
- wallet address
- MemWal account ID
- package ID
- relayer URL
- label
- creation timestamp
0600) on supported systems.
Local-only tools
These tools are handled locally by the package:memwal_loginmemwal_logout
Why login returns a URL instead of waiting
memwal_login is intentionally designed to return a click-able URL quickly instead of blocking until wallet approval finishes.
That design avoids a few common MCP-host failure modes:
- tool-call timeouts while the user approves in wallet
- browser tabs opening in the background
- agents paraphrasing a timeout error and dropping the actual login URL
Remote memory tools
These tools go through the relayer:memwal_remembermemwal_recallmemwal_analyzememwal_restore
- embeddings
- SEAL encryption and decryption
- Walrus storage
- relayer-side indexing and retrieval
stdio package vs Streamable HTTP
stdio package
Use the package when your MCP host expects a local command:memwal_login.
In bridged mode, the package also:
- opens an authenticated SSE session to the relayer
- forwards stdio MCP requests upstream
- splices
memwal_loginandmemwal_logoutintotools/list - transparently reconnects if the SSE session drops
Streamable HTTP
Use HTTP transport when the MCP host can connect directly to a remote MCP URL and attach headers. The typical endpoint is:Authorization: Bearer <delegatePrivateKey>x-memwal-account-id: <accountId>
Safety decisions in the runtime
Some runtime behavior is opinionated on purpose:- 401 does not auto-delete credentials: a relayer
401is surfaced loudly, but the local credentials file is left untouched so transient proxy, WAF, or local-network issues do not wipe the user’s saved delegate key --relayeroverride is transient-only: if a saved credentials file points at one relayer and the current process passes another--relayer, the override applies only to that process and does not silently rewrite the saved file- Login callback is loopback-only: the browser callback listener binds to
127.0.0.1, checks the requestOrigin, validates theHost, and compares a one-timestatetoken before writing credentials
Environment presets
The package supports presets that set both relayer and dashboard URLs together:--prod--dev--staging--local
--dev should route the user to the dev dashboard and save dev relayer credentials, not silently fall back to prod.
What logout does and does not do
memwal_logout or --logout:
- deletes
~/.memwal/credentials.json - removes local access from this machine
- revoke the on-chain delegate key
- remove the delegate from the MemWal dashboard
Why docs say “retry the tool call”
memwal_login returns a click-able URL quickly and lets the browser flow finish in the background.
That avoids MCP tool-call timeouts when:
- the user takes time to approve in wallet
- the browser tab is not focused immediately
- the wallet requires extra review or hardware confirmation