mcp-memory-gateway
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-memory-gatewayRecall recent conversations about the primary peer"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-memory-gateway
A FastAPI + FastMCP shared-memory gateway in front of Honcho v3 — a single shared brain that multiple AI agents read from and write to. It exposes a small, curated, bearer-authenticated surface so every agent can recall context and log changes against one learning memory and stay in sync.
What it does
Endpoints / MCP tools (all bearer-authenticated):
recall(query)— dialectic / similarity recall over the shared representation in Honchoremember(text, agent, tags)— store a durable observationlog_change(summary, agent, area, …)— append a change to the shared, git-versioned ledgerprofile_card()— a compact profile/context card for session primingrecent_changes(n)— the latest entries from the change ledger
The MCP server is mounted at /mcp; equivalent JSON routes are exposed for headless callers (shell scripts, other agent runtimes).
Related MCP server: memex
Design notes
One curated front door over Honcho. The underlying Honcho v3 instance stays untouched and private; this gateway is the only thing agents talk to, which keeps the surface small and auditable.
Two write paths, one source of truth. A change is written to Honcho and appended to a git-versioned Markdown ledger (
EXTERNAL-CHANGES.md), so logging stays reliable even if the memory backend is slow — and the ledger is human-readable history.Auth that is SSE-safe. The
/mcpmount is guarded by a raw-ASGI bearer middleware (notBaseHTTPMiddleware) so it authenticates without buffering the Server-Sent-Events stream.Structured, leak-free logging. Every request emits one compact JSON log line with a request id; payload text and the bearer token are never logged (there are tests that assert this).
Layout
app/— the serviceapp.py— FastAPI + FastMCP app, the 5 tools/routes, and bearer authhoncho_client.py— thin client for a local Honcho v3 instanceledger.py— git-versioned change-ledger writermemory_mirror.py— mirrors recent changes into a delimited block of a memory filestructured_logging.py— JSON request/audit logging with a request-id context var
bin/memory— a smallmemoryCLI for headless callers (recall | card | recent | log)tests/— pytest suite (test_app.py,test_honcho_client.py,test_ledger.py).github/workflows/ci.yml— the CI pipelinerequirements.txt,conftest.py— deps and test config.env.example— the environment variables the service reads
Running it
python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # then set MEMORY_GATEWAY_TOKEN
export MEMORY_GATEWAY_TOKEN=...
uvicorn app.app:app --host 127.0.0.1 --port 8910Run the tests:
pip install -r requirements.txt
python -m pytest -qConfiguration
All configuration is via environment variables (see .env.example).
The gateway centers on a single configurable primary peer — the Honcho peer
whose profile card and recall it focuses on (set PRIMARY_PEER, default user).
Point it at whichever identity your agents share context about.
Variable | Purpose | Default |
| Bearer token required on every authed route and on | (required) |
| Base URL of the local Honcho v3 instance |
|
| Honcho workspace id |
|
| Optional bearer for Honcho | (unset) |
| The Honcho peer the gateway centers on (profile card + recall) |
|
| Honcho session holding observations about the primary peer |
|
| Plain-text memory file recent changes are mirrored into |
|
| Directory holding the |
|
What's excluded & why (secrets never enter the repo)
Secrets, virtualenvs, and local runtime data are kept out of the repo by .gitignore and never committed:
.env/*.env(except.env.example) — the bearer token lives only in an environment file (mode0600) on the host and is never committed.venv/,__pycache__/,*.pyc— environment / build artifacts*.log,*.db— runtime logs and local data*.bak*— local backup files
This is a clean, self-contained extract of a larger private deployment: the business-specific modules and the production host details are intentionally not part of this public repo. What remains is the reusable core — the MCP/HTTP gateway, the Honcho client, the ledger, and their tests.
CI
CI runs on every push and pull request and performs:
Secret scan — gitleaks over the full git history
Lint + compile —
ruff checkandcompileallTests —
pytest
License
MIT — see LICENSE.
Related MCP Connectors
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
Persistent memory for AI agents — log and recall conversation context over MCP.
One memory, every AI. A shared, user-owned markdown memory your AI clients read and write over MCP.
shared AI-context layer for teams — persistent memory your agents search and update over MCP
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceGoverned shared memory platform for AI agents and agent fleets. Provides persistent memory, cross-agent knowledge sharing, permissions, audit trails, and multi-tenant isolation through a Model Context Protocol (MCP) server.4 npm501Apache 2.0
- AlicenseNot gradedqualityCmaintenanceCentralized agentic memory and MCP gateway for LLMs, enabling persistent memory recall, validation, and integration with upstream MCP servers.1Apache 2.0
- FlicenseNot gradedqualityCmaintenanceA local-first, privacy-preserving centralized memory hub for AI agents — MCP-compatible, zero cloud egress.3-
- AlicenseAqualityCmaintenanceSelf-hosted MCP memory server that gives a multi-agent fleet one shared, git-backed memory for search, read, and write.81MIT