Skip to content

Summary

Open-source, self-hosted MCP memory server that gives AI agents persistent memory across sessions, consolidating episodes into facts, relationships and patterns on Postgres with pgvector.

Features

  • Persistent agent memory across sessions and MCP clients
  • Nine-stage consolidation into facts, relationships and patterns
  • Postgres + pgvector semantic recall
  • One-command Docker Compose deployment
  • Fully local option with Ollama
  • Hosted Stash Cloud alternative with OAuth

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it.
  3. Restart the agent — the "Stash" tools will be available.
{
  "mcpServers": {
    "stash": {
      "type": "sse",
      "url": "http://localhost:8080/sse"
    }
  }
}

Description

Stash is a long-term memory server for MCP agents. Instead of starting every conversation from zero, an agent connected to Stash can remember observations and recall them later by meaning, across sessions and across different AI tools that share the same server.

The self-hosted server in this repository runs with one docker compose up: Postgres with pgvector, migrations and the MCP server come up together and expose an SSE endpoint at http://localhost:8080/sse for Claude Desktop, Cursor, Windsurf, Cline, OpenCode and other clients. Agents call tools such as init, remember and recall. In the background a nine-stage consolidation pipeline turns raw episodes into facts, relationships, causal links and patterns, and tracks contradictions, goals, failure patterns and hypotheses, processing only new data on each pass. It needs an OpenAI-compatible API for embeddings and a reasoning model; a documented Ollama setup keeps everything local and offline.

The same author runs Stash Cloud at usestash.io, a separate hosted product (no shared code) reached at https://usestash.io/mcp with OAuth sign-in, which adds structured folders, pinned project rules, version history and shared team memory on a free personal tier. The open-source server is Apache-2.0; it suits developers who want agent memory on infrastructure they control.

Related MCP Servers

See all Stash alternatives

MCP: Dense-Mem

by markhuangai

Self-hosted agent memory server on Postgres/pgvector that tracks evidence, flags contradictions, and never silently rewrites facts.

MCP: MCP Memory Service

by Heinrich Krupp (doobidoo)

New

Self-hosted, open-source persistent memory for AI agents over MCP and REST: semantic plus keyword search with local ONNX embeddings, a shared knowledge graph, consolidation, and SQLite, Cloudflare or Milvus backends.

MCP: ClickHouse Loom

by ClickHouse

New

ClickHouse's open-source, self-hosted MCP server for shared long-term agent memory, cited document search and a code index that coding agents query for definitions, callers and change impact.

New

Local-first memory and audit trail for AI trading agents: sync your fills, recall losing trades first before the next order, and keep a hash-chained log of every decision.

Browse all MCP servers →