@filhocf

MCP Memory Service

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

Current version
v0.2.0
code-pluginCommunitysource-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

Source and release

Source repository

filhocf/openclaw-mcp-memory

Open repo

Source commit

b8f96b406137a884026581333c3721254b9d72ae

View commit

Install command

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

Metadata

  • Package: @filhocf/openclaw-mcp-memory
  • Created: 2026/05/25
  • Updated: 2026/06/05
  • Executes code: No
  • Source tag: v0.2.0

Compatibility

  • Built with OpenClaw: 2026.5.20
  • Plugin API range: >=2026.3.24-beta.2
  • Tags: latest
  • Files: 82