memory-sharing-mcp

Every agent CLI remembers. None of them remember the same thing.

memory-sharing-mcp gives Claude Code, Pi, OpenCode, Codex and any other MCP client one shared memory store, behind one authenticated service. What you teach one agent, the next one already knows.

go install github.com/pixie-sh/memory-sharing-mcp/cmd/memory-sharing-mcp@latest

Go 1.26+, macOS or Linux. Prebuilt binaries are on the releases page. MIT licensed.

The problem

A team on four harnesses keeps four separate memories.

Nobody on a team uses a single agent any more. One person plans in Claude Code, reviews in Codex and runs long jobs in Pi. Each harness keeps its own notes, in its own format, in its own directory.

One memory per harness

Claude Codeits own memory
Piits own memory
OpenCodeits own memory
Codexits own memory

The deploy gotcha you explained on Monday lives in one of these. Switch tools and you explain it again.

One store, one owner

Claude Code Pi OpenCode Codex
http serve ↓ one call at a time memory store

Every agent calls the same five tools. Only the gateway opens the database.

You repeat yourself

Preferences, decisions and project gotchas get taught once per tool, and drift apart as each copy ages.

Context stops at the tool boundary

A decision confirmed in one CLI is invisible to the agent you open next, so it re-asks or guesses.

Sharing the file directly is unsafe

Pointing several agents at the same database gives you concurrent writers, mismatched runtimes and no record of who wrote what.

How it works

One process owns the store. Agents only talk to it.

Agents connect over Streamable HTTP MCP or through a small stdio adapter, mcp serve. Scripts use the REST API. The gateway validates, authorizes and queues every call before it reaches the store.

One owner

http serve takes an exclusive lock on the store. A second owner refuses to start.

One call at a time

Operations reach the provider strictly in order. Recall updates the store too, so even reads are serialized.

No replayed writes

If a write's outcome is unknown, the call is reported as indeterminate and never retried automatically.

Every write has an author

Each agent can have its own API key. New memories record the key that wrote them as agent_id, and an optional --caller nickname labels each call in the service log, even when agents share a key.

Roles per key

Read-only, read-write and maintenance. Delete and consolidation stay off until you enable them.

Swappable store

Stores plug in as providers. Mnemosyne works today; results follow mem0's memory format whichever store is behind it.

From the service log, 2026-11-10

Three agents, three writes, two seconds.

Claude Code, OpenCode and Pi each saved a test memory at the same moment. All three remember calls returned ok, and a recall from any of the three then listed all three entries.

Saved atSourceID
16:23:10claude-codemnemosyne:0f4b1f2c581f0d44
16:23:11ocrobinmnemosyne:e1304704a8c8d0ba
16:23:12pimnemosyne:873f19227ff2b13f
Connect

Set up once per machine, then one entry per agent.

From a checkout, make setup walks through the store, the key and the service. make gen-config then gives each agent its own key and config, named in the log by --caller. By hand, each agent needs one stdio server entry:

Claude Code, Pi and OpenCode are in daily use. The Codex entry follows its documented format and is not yet verified.

The five tools every agent gets

Toolread-onlyread-writemaintenance
memory_recallyesyesyes
memory_statsyesyesyes
memory_remembernoyesyes
memory_forgetnonowith allow_forget
memory_sleepnonowith allow_sleep
Status

What works today, and what does not yet.