@filhocf

MCP Memory Service

Native OpenClaw plugin for mcp-memory-service: thin HTTP client to persistent memory with hybrid search

当前版本
v0.2.0
code-plugin社区source-linked

@filhocf/openclaw-mcp-memory

CI

Native OpenClaw plugin that connects to mcp-memory-service for persistent memory. Acts as a thin HTTP client — zero native dependencies, no local SQLite or embeddings. All storage and search are handled server-side via JSON-RPC 2.0.

Architecture

┌─────────────┐       ┌──────────────────────┐       ┌─────────────────────┐
│   OpenClaw  │──────▶│  Plugin (thin client) │──────▶│  mcp-memory-service │
│   Gateway   │◀──────│  JSON-RPC over HTTP   │◀──────│  (port 3202)        │
└─────────────┘       └──────────────────────┘       └─────────────────────┘

Install

openclaw plugins install clawhub:@filhocf/openclaw-mcp-memory

Prerequisites

  • mcp-memory-service running on http://127.0.0.1:3202/mcp
  • Node.js 22+

Configuration

In your openclaw.json:

{
  "plugins": {
    "@filhocf/openclaw-mcp-memory": {
      "serviceUrl": "http://127.0.0.1:3202/mcp",
      "autoRecall": true,
      "autoCapture": true,
      "maxResults": 5,
      "threshold": 0.7,
      "captureMatcher": "*"
    }
  }
}
OptionDefaultDescription
serviceUrlhttp://127.0.0.1:3202/mcpmcp-memory-service endpoint
autoRecalltrueInject relevant memories before LLM reply
autoCapturetrueStore tool results as memories automatically
maxResults5Max memories returned per search
threshold0.7Minimum similarity score (0–1)
captureMatcher*Glob pattern for tools to capture

How It Works

  1. Auto-recall (before_prompt_build): Before each LLM reply, searches memories relevant to the user prompt and injects them as context.
  2. Auto-capture (after_tool_call): After any tool execution (matching captureMatcher), stores meaningful results as new memories.
  3. Session-end harvest (session_end): Logs memory service stats on session close.

Fallback

When mcp-memory-service is offline:

  • Write operations are queued to ~/.openclaw/workspace/MEMORY-FALLBACK.md (JSON-lines)
  • On next startup, if the service is available, queued items are drained and sent
  • Read operations return empty results gracefully

Development

npm install
npx vitest run          # run tests
npx vitest run --coverage  # with coverage
npx tsc --noEmit        # type-check
npx eslint src/         # lint

License

MIT

源码与版本

源码仓库

filhocf/openclaw-mcp-memory

打开仓库

源码提交

b8f96b406137a884026581333c3721254b9d72ae

查看提交

安装命令

openclaw plugins install clawhub:@filhocf/openclaw-mcp-memory

元数据

  • 包名: @filhocf/openclaw-mcp-memory
  • 创建时间: 2026/05/25
  • 更新时间: 2026/06/05
  • 执行代码:
  • 源码标签: v0.2.0

兼容性

  • 构建于 OpenClaw: 2026.5.20
  • 插件 API 范围: >=2026.3.24-beta.2
  • 标签: latest
  • 文件数: 82