/ 目录 / 演练场 / Stash
● 社区 alash3al ⚡ 即开即用

Stash

作者 alash3al · alash3al/stash

轻量级 Go 记忆服务——events(时序事件)和 facts(持久知识)两种存储模式,以 MCP 方式暴露。

Stash 为 agent 提供两种存储模式:events(按时间排序的事件)和 facts(键值持久知识)。轻量单二进制,树莓派上都能跑。

为什么要用

核心特性

实时演示

实际使用效果

就绪

安装

选择你的客户端

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "stash-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-p",
        "9000:9000",
        "ghcr.io/alash3al/stash:latest"
      ]
    }
  }
}

打开 Claude Desktop → Settings → Developer → Edit Config。保存后重启应用。

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "stash-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-p",
        "9000:9000",
        "ghcr.io/alash3al/stash:latest"
      ]
    }
  }
}

Cursor 使用与 Claude Desktop 相同的 mcpServers 格式。项目级配置优先于全局。

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "stash-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-p",
        "9000:9000",
        "ghcr.io/alash3al/stash:latest"
      ]
    }
  }
}

点击 Cline 侧栏中的 MCP Servers 图标,然后选 "Edit Configuration"。

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "stash-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-p",
        "9000:9000",
        "ghcr.io/alash3al/stash:latest"
      ]
    }
  }
}

格式与 Claude Desktop 相同。重启 Windsurf 生效。

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "stash-mcp",
      "command": "docker",
      "args": [
        "run",
        "-p",
        "9000:9000",
        "ghcr.io/alash3al/stash:latest"
      ]
    }
  ]
}

Continue 使用服务器对象数组,而非映射。

~/.config/zed/settings.json
{
  "context_servers": {
    "stash-mcp": {
      "command": {
        "path": "docker",
        "args": [
          "run",
          "-p",
          "9000:9000",
          "ghcr.io/alash3al/stash:latest"
        ]
      }
    }
  }
}

加入 context_servers。Zed 保存后热重载。

claude mcp add stash-mcp -- docker run -p 9000:9000 ghcr.io/alash3al/stash:latest

一行命令搞定。用 claude mcp list 验证,claude mcp remove 卸载。

使用场景

实战用法: Stash

跨会话保持 agent 记忆

👤 开发者 ⏱ ~15 min intermediate

何时使用: 你希望 Claude 记住偏好和近期上下文。

步骤
  1. 运行 stash
    docker run alash3al/stash✓ 已复制
    → 服务启动
  2. 接入 MCP
    Add stash as MCP in Claude config.✓ 已复制
    → tool 可见
  3. 使用
    remember "user prefers TypeScript over JS"; recall later.✓ 已复制
    → 记忆成功召回

结果: 无需付费记忆 SaaS,也能实现跨会话连续性。

组合

与其他 MCP 搭配,撬动十倍杠杆

stash-mcp + filesystem

定期将记忆转储到磁盘以做备份

Combine stash-mcp with filesystem: Periodically dump memory to disk for backup✓ 已复制

工具

此 MCP 暴露的能力

工具输入参数何时调用成本
remember_episode (见文档) 追加一条时间线事件 1 次调用
remember_fact (见文档) 存储一条持久 fact 1 次调用
search (见文档) 在两种存储中搜索 1 次调用

成本与限制

运行它的成本

API 配额
本地资源
每次调用 Token 数
极小
费用
免费开源
提示
定期对数据目录做快照

安全

权限、密钥、影响范围

凭据存储: 磁盘上的数据库文件
数据出站: 默认无出口

故障排查

常见错误与修复

缺少 embedding 端点

设置 EMBEDDING_URL,或以纯关键词模式运行

替代方案

Stash 对比其他方案

替代方案何时用它替代权衡
memsearch你需要 Milvus 支持的规模部署更复杂

更多

资源

📖 阅读 GitHub 上的官方 README

🐙 查看未解决的 issue

🔍 浏览全部 400+ MCP 服务器和 Skills