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 分