Keephaven Mcp

io.github.dafarusd由 GitHub 账号 dafarusd 发布v0.1.0更新于 Oct 29, 2026

Agent memory on your own Keephaven home server: files, append-only journal, search.

已验证STDIO仅桌面文件与存储知识与记忆

概览

AI 生成的概览

为 AI 助手提供持久记忆:文件与只追加日志存放在用户自己的 Keephaven 家庭服务器上,支持搜索、读取、写入和删除。

可以做什么
  • 查看助手在记忆空间中的身份、是否可写以及配额使用情况
  • 列出、读取、创建、覆盖和删除记忆文件,可用 etag 校验避免覆盖较新的副本
  • 向只追加日志写入条目,并按从旧到新的顺序读取最近条目
  • 在记忆文件和日志中进行不区分大小写的搜索,返回匹配行及其文件与行号
适用场景
适合希望助手跨会话、跨上下文窗口保留长期事实、偏好和项目笔记,同时把这些数据放在自家服务器而非厂商服务器上的场景。适用于 Claude Desktop、Claude Code、Cursor 等运行本地服务器的 MCP 客户端。
运行要求
通过 npx 从 GitHub 安装并以本地 stdio 进程运行,首次启动需要构建,要求 Node 20 或更高版本。需要设置 KEEPHAVEN_URL 指向盒子的记忆 API,以及 KEEPHAVEN_TOKEN(在 Settings > Agents 中创建的代理令牌)。运行助手的机器必须能访问该盒子:同一家庭网络、盒子自带 Wi-Fi 或开启远程访问后的 Tailscale 网络。
安装前请注意
令牌在家庭网络上以明文 HTTP 传输,仅在 Tailscale 下加密。助手可以创建、覆盖和删除其文件夹中的文件,日志条目一旦写入便无法编辑或删除。所有者可以查看存储内容、撤销访问或删除文件夹,服务器说明也建议不要在此存放密码或密钥。两台真实盒子之间的备份行为尚未测试。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Keephaven Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

keephaven-mcp

Your agent's memory, on a box in your house. An MCP server that gives an AI agent a long-term memory stored on a Keephaven, not on a vendor's server.

Works with MCP clients that run local servers, like Claude Desktop, Claude Code and Cursor.

What the agent gets

ToolWhat it does
memory_writeSave a file, like people/dafarus.md or projects/keephaven.md. Optional etag check so two sessions don't overwrite each other.
memory_readRead a file back, with its etag.
memory_listList files, optionally under a folder.
memory_searchCase-insensitive search across files and journal.
memory_deleteDelete a file.
journal_appendAdd an entry to an append-only journal. The agent can add to it, never edit or delete it.
journal_readRead recent journal entries, oldest first.
memory_statusName, read-only or not, quota used.

What the owner keeps

  • Each agent gets its own folder and can't see any other agent's.
  • You add an agent in Keephaven's Settings > Agents and get a token, shown once. The box stores only a fingerprint of it.
  • Revoke cuts the agent off at once. Its files stay until you delete them.
  • Set a size limit per agent, or make one read-only.
  • If your Keephaven backs up to a second box, the agent's folder is part of that backup, and the backup box refuses every delete. That part isn't tested between two real boxes yet.

Set it up

  1. On the Keephaven: Settings > Agents > Add an agent. Copy the two values it shows.
  2. Add the server to your MCP client. For Claude Desktop, in claude_desktop_config.json:
json
{  "mcpServers": {    "keephaven": {      "command": "npx",      "args": ["-y", "github:dafarusd/keephaven-mcp"],      "env": {        "KEEPHAVEN_URL": "http://keephaven-xxxx.local:8790",        "KEEPHAVEN_TOKEN": "khm_..."      }    }  }}

For Claude Code:

claude mcp add keephaven -e KEEPHAVEN_URL=http://keephaven-xxxx.local:8790 -e KEEPHAVEN_TOKEN=khm_... -- npx -y github:dafarusd/keephaven-mcp

It installs straight from GitHub, so the first start takes a minute while it builds. Needs Node 20 or newer.

The machine running the agent has to reach the box: same home network, the Keephaven's own Wi-Fi, or your Tailscale tailnet when Remote access is on.

Try it with no box

The box runs one Python file with no dependencies. Run that same file anywhere with Python 3:

python3 agent-memory.py serve --data ./mem --bind 127.0.0.1 --dev-token khm_try-it-locally

Then point the MCP server at http://127.0.0.1:8790 with that token. The file is modules/agent-memory.py in the Keephaven repo.

Status, honestly

  • The memory service is built and tested: 22 API tests, and a two-VM NixOS test where the service runs as its own locked-down user and a second machine uses it over the network.
  • This MCP server has 7 end-to-end tests: the official MCP client, this server over stdio, and the real memory service.
  • It ships in Keephaven Agent Memory, released 2026-10-25 for a Pi 5 and for a USB SSD on a Windows PC: https://keephaven.co/agent-memory. The Pi edition passed its release checks on one Pi 5, the SSD edition on a real drive on a Windows PC. Backup ran from a real Pi 5 (pre-release build) to a PC build in a VM over Tailscale — not yet between two real boxes. Keephaven Home has it too from 2026.10.30, switched off — turn it on in Settings > Agent memory. Photos boxes don't have it.
  • Tokens travel in plain HTTP on your home network, like the rest of the box's local pages. Over Tailscale they're encrypted.

Agent skill

skill/keephaven/ is an agent skill (a SKILL.md plus a read-only check.py): how to use a Keephaven as memory, and how to boot one in a VM and report what works. check.py was run against the Photos SSD image booted in QEMU: setup page, then ready, Photos up, Immich 3.0.3.

Built by @Dafarusd. MIT License.

来源:README.md,提交 8d6f316

工具

8

memory_status

Memory status

Who you are on this Keephaven, whether you can write, and how much of your quota is used.

无需输入参数。

memory_list

List memory files

List the files in your memory, optionally under a folder prefix like 'people' or 'projects/keephaven'.

输入参数prefix

memory_read

Read a memory file

Read one file from your memory. Returns its text and an etag; pass the etag to memory_write to avoid overwriting a newer copy.

输入参数path必填

memory_write

Write a memory file

Create or replace one file in your memory (UTF-8 text, up to 10 MB). Paths are plain segments of letters, digits, _ . - separated by '/'. journal/ is not writable here: use journal_append.

输入参数path必填content必填if_match

memory_delete

Delete a memory file

Delete one file from your memory on the box. Journal files can't be deleted. A paired backup box keeps what it already received.

输入参数path必填

journal_append

Add to your journal

Append one entry to your append-only journal: what you did, decided, or learned. Nothing in the journal can be edited or deleted afterwards, so it's the record your future sessions can trust.

输入参数datatagstext必填

journal_read

Read your journal

Read your most recent journal entries, oldest first. Use at the start of a session to pick up where you left off.

输入参数limitsince

版本历史

1
  1. v0.1.0最新Oct 26, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分