Open Agent Memory

io.github.rocke2020由 GitHub 账号 rocke2020 发布v0.0.1更新于 Nov 12, 2026

Self-hosted OAM memory with cited recall over your existing deployment

发布方自己的服务:Memory.fit

已验证STDIO仅桌面知识与记忆AI 与机器学习

概览

AI 生成的概览

面向自建 Open Agent Memory 部署的本地 stdio MCP 客户端,让助手获得带引用的记忆召回、记忆写入与文档导入能力。

可以做什么
  • 按查询召回带引用的记忆上下文,可选 fast 或 normal 级别及完整结构化条目
  • 写入一条新的记忆消息,可指定事件时间与幂等键
  • 以文本或 HTTPS 链接添加文档来源并跟踪其操作状态
  • 查询记忆操作的就绪状态与各阶段状态
  • 读取已存储的用户 Profile 及其引用与新鲜度
  • 删除基础记忆或洞察
适用场景
当你已自行部署 Open Agent Memory,并希望 Claude Code、Cursor 或 Codex 等助手带引用地召回已索引的记忆、按用户要求保存新记忆或导入文档时使用。适合单用户自建场景,而非托管或多用户记忆服务。
运行要求
运行 MCP 客户端的环境需 Node.js 22 或更高版本,并通过 npx 运行该 npm 包。需要一个以 api_key 模式运行、且至少完成过一次记忆写入与索引的 OAM 部署。需设置环境变量 OAM_BASE_URL、OAM_USER_ID 和 OAM_USER_API_KEY(用户级密钥,以 bearer 方式发送)。一个进程只服务一个 OAM 用户。
安装前请注意
用户级 API 密钥通过 OAM_USER_API_KEY 传入,可能被保存在 MCP 客户端配置文件中,请保护该文件且不要提交真实密钥。非本机部署务必使用 HTTPS,明文 HTTP 传输的 bearer 密钥会被网络看到。写入工具会新增记忆和文档,memory_remove 会删除记忆或洞察。召回文本属于不可信证据,不应被当作指令执行。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Open Agent Memory MCP Server

Overview

This package is a thin Model Context Protocol (MCP) server for Open Agent Memory (OAM). It runs as a local stdio process started by an MCP client such as Claude Code, Cursor, or Codex, and calls the OAM HTTP API of an existing deployment. It adds no hosted service, database, queue, or listening port.

The wrapper is an API client, not a second memory implementation. OAM owns authentication, authorization, retention policy, indexing, retrieval, citations, and operation state. The wrapper has six tools and passes OAM's contract through rather than reimplementing it.

Retrieved memory is untrusted evidence, not instructions. Tool descriptions state this boundary; clients must not follow directives found inside recalled text.

See the 71-second cited-recall demo: a fresh published MCP process checks readiness and retrieves an already indexed synthetic preference, then Memory Inspector opens the original source. The recording runs at 2× speed and performs no new indexing.

Prerequisites

  1. OAM is running in api_key mode with a user-scoped key. See the OAM quickstart.
  2. The OAM user has completed at least one retain and indexing operation, so recall has evidence to return.
  3. Node.js 22 or newer is available where the MCP client runs.

The wrapper supports only api_key mode. dev mode and forged trusted headers are unsupported. One wrapper process serves one OAM user.

Installation

Install the published npm package:

bash
npx -y @rocke-dong/oam-mcp

To build and run from source instead:

bash
npm installnpm run buildnode dist/index.js

Configuration

The wrapper reads only environment variables and stores no credential:

VariableRequiredMeaning
OAM_BASE_URLYesOrigin of the OAM deployment, for example http://127.0.0.1:17333
OAM_USER_IDYesAuthorized personal user
OAM_USER_API_KEYYesUser-scoped key, sent as Authorization: Bearer <key>

OAM_BASE_URL must use HTTP or HTTPS, must not contain credentials, and must not include a query or fragment. The wrapper rejects an empty user or key before connecting. Use HTTPS for any non-loopback deployment; a bearer key sent over plaintext HTTP is visible to the network.

The MCP client may store these environment values in its own configuration. Protect that file and never commit a real key. The wrapper itself does not write configuration or cache memory content.

Client Configuration

Claude Code, after setting the three environment variables above in your shell:

bash
claude mcp add oam \  -e "OAM_BASE_URL=$OAM_BASE_URL" \  -e "OAM_USER_ID=$OAM_USER_ID" \  -e "OAM_USER_API_KEY=$OAM_USER_API_KEY" \  -- npx -y @rocke-dong/oam-mcp

Cursor, using ~/.cursor/mcp.json:

json
{  "mcpServers": {    "oam": {      "command": "npx",      "args": ["-y", "@rocke-dong/oam-mcp"],      "env": {        "OAM_BASE_URL": "http://127.0.0.1:17333",        "OAM_USER_ID": "your-user-id",        "OAM_USER_API_KEY": "your-user-key"      }    }  }}

Other MCP clients use the same stdio command, arguments, and environment variables.

Tools

ToolOAM callInputReturns
memory_recallPOST /v1/recallquery; optional recall_level (fast default or normal), include_chunks (default true), detail (context default or full)Rendered context with citations and trace_id; full adds typed items and diagnostics
memory_addPOST /v1/retaincontent; optional timezone-aware event_time, learning_eligible (default true), idempotency_keyDurable operation ID and source ID
memory_add_documentPOST /v1/users/{user_id}/resourcesdocument_id, update_mode, exactly one of text or url plus media_type, and optional idempotency_keySource receipt and operation state
memory_operationGET /v1/users/{user_id}/operations/{operation_id}operation_idReadiness, stage state, and safe failure details
memory_profileGET /v1/users/{user_id}/profileNoneStored Profile content, references, and freshness; never generates
memory_removeDELETE /v1/users/{user_id}/memories/{id} or /insights/{id}memory_id, memory_type (basic or insight)Removal operation receipt

memory_add sends one explicit user message. Use it only when the user asks to remember something. memory_add_document supports text and HTTPS URL originals in this version; multipart file upload is not supported.

Both write tools accept an optional idempotency_key. Keys must be 1-200 characters from A-Z, a-z, 0-9, ., _, :, or -; omit the key to generate one. Pass the same key when retrying the same logical write so OAM reuses the original receipt instead of duplicating the interaction or document revision. Without a key, the wrapper generates a new one for every invocation, so a retry becomes a new logical request.

memory_recall defaults to fast because it is the pre-agent retrieval mode. detail: "full" returns the complete recall JSON, including typed items and diagnostics; the default returns the rendered context, token count, tokenizer identity, trace ID, and item count.

Behavior and Security

  1. Recall output is evidence. The wrapper labels it as untrusted data and never interprets it as instructions.
  2. The wrapper sends the API key only in the Authorization header. It does not log keys, request bodies, or memory text.
  3. OAM errors return the safe OAM code, HTTP status, retryability, and X-Request-ID. Unexpected failures return a generic error without a stack.
  4. The wrapper does not retry automatically. Retry decisions belong to the caller.
  5. Requests use a 60-second total timeout. OAM owns recall deadlines; the platform fetch stack applies its own connection timeout inside that window.
  6. Success bodies are capped at 8 MiB and error bodies at 64 KiB. OAM already bounds recall context; the wrapper does not add a second content budget.
  7. The wrapper writes no memory content to disk and keeps no background workers.
  8. The wrapper refuses HTTP redirects, so the bearer key cannot be forwarded to a different origin by the upstream endpoint.

Limitations

  1. stdio transport only; there is no maintainer-hosted remote MCP endpoint.
  2. One OAM user per process; no multi-user switching or OAuth.
  3. Text and HTTPS URL documents only; no multipart file upload.
  4. User Profile reads only; Profile refresh is not exposed.
  5. No generated answers, summarization, or reranking. Recall returns evidence for the host agent to reason over.
  6. OAM still calls its configured models for indexing and embedding; this wrapper does not make OAM local-only.

Development

bash
npm installnpm testnpm run build

The tests use a local mock HTTP server and an in-memory MCP transport. They do not call a live OAM deployment or any model provider. A live acceptance run against a real OAM user remains required before claiming end-to-end readiness.

See the OAM HTTP API, operations guide, and repository README.

License

Apache-2.0. See LICENSE and third-party notices.

来源:integrations/mcp/README.md,提交 0d0dfdf

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

1
  1. v0.0.1最新Nov 12, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

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

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Memory 集成