@echomem/mcp
v1.5.1
Published
EchoMem MCP bridge for cross-agent memory, local history import, and recall
Readme
EchoMem Cloud-First MCP Server
This package implements a stateless, cloud-first Model Context Protocol (MCP) server for EchoMem. It allows local IDE agents (like Cursor, Windsurf, Claude Desktop, and VS Code) to interact with the user's secure EchoMem personal backend without risk of file-locking or sandbox conflict with the running Chrome Extension's local database.
Architecture
This MCP Server bridges local tools and your EchoMem Cloud API entirely via authenticated REST fetch() calls.
search_memories: Calls the deep-search candidate phase, resolves the retrieved memory rows, and returns those memories only by defaultsave_conversation: Connects toPOST /api/extension/memories/ingestget_memories_by_time_range: Connects toPOST /api/extension/memories/time-rangesearch_memories_by_keywords: Connects toPOST /api/extension/memories/keywordssearch_others_memories: Connects to MemoryFeed public search without trusting a model-supplied identity; the hosted API resolves the caller from the EchoMem credential and the tool returns that authenticated viewer explicitlydelete_memory: Previews one personal memory and returns a confirmation token; only deletes after a second confirmed call
No direct access to the IndexedDB or local files is required.
Encryption — the local bridge is the encrypted surface
For zero-knowledge accounts, the key never leaves your machine. The bridge holds the key locally (exactly like the Chrome extension) and:
- reads: the server returns ciphertext; the bridge decrypts locally so the model only ever sees plaintext. The server never holds your key.
- writes: the key is handed to your own backend transiently in the
X-Encryption-Keyheader so memories are encrypted at rest (the server processes plaintext for the request only — never stores the key). - trusted-device lifecycle: after a verified login/unlock, the MCP key remains available until
the user runs
echomem-mcp lock, logs out, or removes the local credentials. If the key is absent, tools tell the user to runechomem-mcp unlockin their own terminal. The passphrase prompt is visible while typed characters stay hidden, and the current agent session can retry immediately after unlock — ciphertext is never handed to the model.
Unencrypted accounts are unaffected. search_memories returns retrieved memories by default so
your MCP client does the final answer generation; pass includeAnswer: true only if you need the
legacy EchoMem-synthesized recall answer.
Quick start
The standalone package installs and manages its own durable per-user MCP runtime. It configures detected Codex and Claude hosts, connects this device, imports selected local coding history, and keeps compatible runtime updates ready for the next agent session.
Prerequisite: Node.js 18 or newer. Run the command in the same environment as the agent you want to configure. Native Windows and WSL have separate home directories and client configs, so a WSL install does not configure native Windows apps.
macOS, Linux, or WSL:
npx -y @echomem/mcp@latest initWindows PowerShell:
npx.cmd -y @echomem/mcp@latest initThe one-off npx command is the recommended install path; it stages a durable per-user runtime
and does not require a global npm install. On Windows, use a new PowerShell window after installing
Node if npx.cmd is not found. Use init for first-time setup and local-history selection; use
connect later for account status, Doctor, repair, and uninstall.
| Command | What it does |
|---|---|
| npx -y @echomem/mcp@latest connect | Open Connect Echo for account readiness, per-host setup, Doctor, repair, and uninstall (use npx.cmd in Windows PowerShell) |
| npx -y @echomem/mcp@latest init | One-command setup for installed agents, login, and selected local-history import (use npx.cmd in Windows PowerShell) |
| npm i -g @echomem/mcp@latest, then echomem-mcp init | Optional global install for a persistent CLI command |
| npm i -g @echomem/mcp@latest && echomem-mcp setup | Install the CLI globally and configure just the detected editor |
| npx -y @echomem/mcp@latest setup | One-off setup without keeping a global CLI command |
| echomem-mcp setup [--client cursor\|windsurf\|claude-desktop\|claude-code\|codex] | Write client config + log in |
| echomem-mcp setup --skip-login [--client cursor\|windsurf\|claude-desktop\|claude-code\|codex] | Write client config without opening the browser or changing credentials |
| npx -y @echomem/mcp@latest update --all | Bootstrap or repair the durable per-user runtime and repoint detected client configs, with no browser login |
| npx -y @echomem/mcp@latest update --client codex | Update one client only |
| echomem-mcp login | Approve device in browser (or use --token / --passphrase) |
| echomem-mcp unlock | Privately unlock the vault on this trusted device |
| echomem-mcp lock | Remove the local vault key while keeping the device login |
| echomem-mcp status | Show token / key / detected clients, configured bridge versions, and update guidance |
| echomem-mcp doctor [--no-network] | Diagnose configured client bridge versions |
| echomem-mcp control / manage | Compatibility aliases for the returning-user Connect Echo page |
| echomem-mcp reconnect | Clean-reinstall EchoMem's managed runtime, clear inactive runtime cache, and repair detected host entries |
| echomem-mcp uninstall --confirm | Remove EchoMem MCP host entries/runtime while preserving login, vault credentials, and cloud memories |
| echomem-mcp logout | Remove stored credentials |
Windows Connect Echo (no desktop app required)
If you installed the optional global CLI, run this from PowerShell:
echomem-mcp connectFor the recommended one-off install, launch the same local control page with:
npx.cmd -y @echomem/mcp@latest connectThe page binds only to 127.0.0.1 and uses a per-launch nonce. It validates account/vault state,
shows each detected MCP host independently, and provides Connect, Repair, Disconnect, Doctor, and
clean Reconnect actions. Uninstall MCP stays under Advanced controls and removes only EchoMem-owned
host entries, hooks, guidance, skills, and managed runtime files; it does not remove the local
EchoMem credential store or any cloud memory. Restart each agent after configuration changes.
The bridge reports its package version in MCP server instructions and in tool descriptions. It also
checks npm for a newer published bridge using a cached, non-blocking check. Standalone installations
stage compatible updates in the background under ~/.echomem/mcp-runtime and atomically activate
them for the next MCP session; the current handshake never waits for npm. Agents can call
echomem_update_status to inspect progress. ECHO_DISABLE_AUTO_UPDATE=1 disables automatic
installation, and npx -y @echomem/mcp@latest update --all remains the bootstrap and repair command.
Agents can still call echo_context_health for an on-demand local context-health report. It reads
the local Codex/Claude logs and does not require a separate process or desktop overlay.
Local conversation lifecycle hooks
For hook-capable clients, MCP setup installs SessionStart and Stop hooks. Claude Code also
gets a PreToolUse hook for EchoMem tools:
SessionStart— source-session binding. The hook receives the host-ownedsession_idandtranscript_path, verifies that they identify the same local JSONL, and idempotently binds the canonicalcodex:<id>orclaude-code:<id>context throughPOST /api/extension/source-sessions/bind. It also records a signed local session entry for the Claude Code tool hook. No "latest session" lookup is used.bind_source_sessionremains a compatibility fallback.PreToolUse— per-call identity in Claude Code. Immediately before an EchoMem MCP call, the hook attaches a short-lived signed proof of the host session. The shared Claude Desktop bridge verifies that proof and keeps the identity scoped to that one request. A call without proof cannot inherit another Desktop conversation's identity. The hook never approves a tool or asks the user to share with a team. The proof prevents accidental cross-session mixing; code with access to the same local EchoMem credential can also mint one, so backend account and workspace authorization remain the security boundary.Stop— private-save checkpoint. Before a completed turn exits, the hook reads only that turn's local transcript slice. If the turn appears durable and did not already callsave_conversation, it blocks completion once and asks the Agent to create a concise private checkpoint. It never authors or uploads a checkpoint itself. Re-entry is guarded bystop_hook_active, so the second Stop is allowed after the Agent has checked or saved.
The hook entries are merged idempotently into ~/.codex/hooks.json and
~/.claude/settings.json; unrelated user hooks and settings are preserved. Hooks fail open when
their local input is missing so they cannot prevent a conversation from starting or finishing.
When setup runs from Echo Desktop or the standalone runtime, hook commands point at a path that
follows runtime updates: Desktop's current folder, or ~/.echomem/mcp-runtime/hud-launcher.mjs,
which runs whichever standalone version is active. Each MCP server those runtimes start also
repoints EchoMem hooks that older installers pinned to a version folder or the npx cache, and any
that name a missing file. A working Codex hook is left for the next setup run, since Codex asks
users to re-trust changed hooks. A checkout, global install, or npx copy never repoints hooks.
Cloud Cowork through remote-devices
Cloud Cowork inference cannot use the local hook or transcript-verification path. The shared local
MCP process also must not retain one cloud conversation as global bridge state. Cloud Cowork agents
therefore pass their runtime-issued session_... identifier as cloudCoworkSessionId on each
EchoMem tool call. EchoMem binds that request to the canonical cowork:session_... context with
cloud_cowork_tool_argument evidence and local_mcp origin, then links or saves against that
context without changing shared bridge state.
This identity is intentionally reported as provisional: the authenticated user owns the
context and ticket link, but EchoMem cannot independently corroborate the cloud identifier from a
local transcript. Verified local Cowork remains cowork:local_... with trusted local evidence.
Never convert one form into the other or silently present a provisional cloud link as verified.
remote-devices is a relay into the installed local MCP process; it is not EchoMem's hosted
Streamable HTTP MCP endpoint. Transport origin and session-identity evidence are independent.
Manual / headless (SSH, containers, CI)
No browser? Provide secrets directly — this is the documented headless path:
echomem-mcp login --token ec_xxx # unencrypted account
echomem-mcp login --token ec_xxx --passphrase '<vault>' # encrypted: derives + verifies the key
# or pre-provision via env: ECHO_API_TOKEN, ECHO_ENCRYPTION_KEY (base64)The browser flow depends on the EchoMem "connect device" web page posting
{ token, key? }to the bridge's localhost callback. Until that page ships, use the manual flags above (same result).
Setup & Configuration (manual config)
Prerequisites
A valid EchoMem API key (ec_…). For encrypted accounts, your vault passphrase.
Building
cd packages/mcp-server
npm install
npm run build
npm test # crypto compat + encrypted-local integration testsAdd to your IDE (Cursor or Windsurf)
Prefer
npx -y @echomem/mcp@latest initabove (npx.cmdin Windows PowerShell) — it writes these files for you and keeps secrets out of the client config. The manual steps below are the fallback.
For Cursor
In Cursor, go to Settings -> Features -> MCP Servers. Add a new MCP Server:
- Type:
command - Name:
echomem - Command:
npx - Args:
-y @echomem/mcp@latest
Under the Environment Variables section of the server configuration, add:
ECHO_API_TOKEN:ec_...(Required unless provisioned vialogin: your EchoMem API key)ECHO_API_BASE_URL:https://echo-mem-chrome.vercel.app(Optional: Defaults to production URL)MEMORY_FEED_API_URL:https://memory-feed.vercel.app(Optional: Defaults to production MemoryFeed URL)
For Windsurf
- Open your global Windsurf MCP configuration file:
- Mac/Linux:
~/.codeium/windsurf/mcp_config.json - Windows:
%USERPROFILE%\.codeium\windsurf\mcp_config.json
- Mac/Linux:
- Add the
echomemserver beneath your existing configurations:
{
"mcpServers": {
"echomem": {
"command": "npx",
"args": ["-y", "@echomem/mcp@latest"],
"env": {
"ECHO_API_TOKEN": "ec_YOUR_API_KEY_HERE",
"ECHO_API_BASE_URL": "https://echo-mem-chrome.vercel.app"
}
}
}
}- Restart Windsurf.
Add to Claude Desktop
claude.ai integrations must be configured via the Claude Desktop app.
- Open your Claude Desktop setting file:
- Mac:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Mac:
- Update your
mcpServersobject to include EchoMem, addingECHO_API_TOKENto theenvobject:
{
"mcpServers": {
"echomem": {
"command": "node",
"args": ["/absolute/path/to/EchoMem-Chrome/packages/mcp-server/dist/index.js"],
"env": {
"ECHO_API_TOKEN": "your_generated_ec_key..."
}
}
}
}- Restart Claude Desktop.
Using via CLI (testing)
ECHO_API_TOKEN="your_token" ECHO_API_BASE_URL="http://localhost:3000" npm run startAvailable Tools
search_memories: Retrieve ranked personal memories for a query. Defaults to memory-only output and skips EchoMem answer generation; setincludeAnswer: truefor the legacy synthesized recall.save_conversation: Ingest and structure a conversation directly into your EchoMem timeline.During an open local turn this registers one check for when the reply ends. The agent shows a brief queued/checking status; registration is not a saved-memory claim. After the backend finishes, the next successful EchoMem tool result in the same conversation carries a compact receipt with real memory links, or a no-new-memory/failure status. Reading a receipt never submits another save. Pending receipts are persisted under
chat-save-receiptsin the Echo config directory, scoped to the credential, backend, and verified source session. They survive bridge restart and are consumed at tool delivery. Switching accounts cannot expose another account's receipts; switching back allows that account to receive its pending receipts. A visible Desktop notch does not suppress the chat receipt. A new turn's queued status never cancels a confirmed receipt from an earlier turn in the same result.The bridge cannot edit an already-sent assistant reply: immediate post-turn activity is shown by Desktop, while the chat receipt requires a subsequent EchoMem tool call. Tool delivery is not an acknowledgement that the host rendered the final message: a disconnect during delivery or an assistant omitting a returned receipt still requires host-level acknowledgement to guarantee display. If disk writes fail, the bridge retains an in-memory fallback. Pending turn-end requests retain their existing disk recovery path.
get_memories_by_time_range: Retrieve memories between explicit start/end timestamps.search_memories_by_keywords: Retrieve memories by matching thekeysfield.search_others_memories: Search other users' public memories through MemoryFeed public search.delete_memory: Delete a single personal memory through a two-step confirmation flow. First call withmemoryIdonly to preview the target and receiveconfirmationToken; after the user explicitly confirms, call again withconfirmed: trueand that exact token. This deletes the memory row only and preserves rawsource_of_truthconversation records.echomem_update_status: Check the installed bridge against the latest published npm version. Works without login, uses cached background checks in normal operation, and reports automatic installation state plus a fallback repair command.echo_context_health: Return the local Codex/Claude context-health score as markdown. Works without login and uploads no transcript content.
Contract reference:
docs/PUBLIC_API_CONTRACT_V1.mddocs/MCP_COMPAT_MATRIX.md
