npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bsbofmusic/memos-memu-local-memory-tools-for-agent

v1.4.0

Published

MCP server — one-shot install + query for memos (PostgreSQL) and memuK (SQLite) local memory. Designed for OpenClaw agents.

Downloads

1,805

Readme

memos-memu-local-memory-tools-for-agent

MCP Server for OpenClaw agents — two-layer local memory: memos (PostgreSQL, raw conversation history) + memuK (SQLite, topic summaries).

Compliance

This package is built to the mcp-creator specification:

  • ✅ One-shot enable (install + query)
  • ✅ Bootstrap self-check on startup
  • ✅ Self-heal (memos_memuk_ensure)
  • ✅ Doctor with nextSteps (memos_memuk_doctor)
  • ✅ Capability self-discovery (memos_memuk_list_commands)
  • ✅ Version + update reporting (memos_memuk_version)
  • ✅ Process lock (prevents concurrent ensure)
  • ✅ Graceful degradation (structured errors when system is down)
  • ✅ Atomic update strategy support (alwaysLatest)
  • ✅ Structured logs on every operation

Quick Start

# One-liner (npx — for first install only)
npx @bsbofmusic/memos-memu-local-memory-tools-for-agent

# Production: PM2 resident process (recommended — no cold start)
pm2 start /path/to/memos-memu-local-memory-tools-for-agent/src/index.js --name memos-memu-mcp

# OpenClaw mcporter config (local node, not npx):
{
  "mcpServers": {
    "memos-memu-local-memory-tools-for-agent": {
      "command": "node",
      "args": ["src/index.js"],
      "cwd": "/path/to/memos-memu-local-memory-tools-for-agent",
      "type": "stdio"
    }
  }
}

Tools (9 total)

System tools (mcp-creator spec)

| Tool | Description | |------|-------------| | memos_memuk_version | Version, latest available, update status, runtime health | | memos_memuk_doctor | Full diagnostic with PASS/FAIL/WARN per component + nextSteps | | memos_memuk_ensure | Idempotent self-heal: repairs all components, optional upgrade | | memos_memuk_list_commands | List all tools with descriptions and usage examples |

Core tools

| Tool | Description | |------|-------------| | install_memory_system | One-shot install: PostgreSQL, memuK, SKILL, cron, credentials | | verify_memory_system | Quick smoke-test of all 7 components | | memos_query | Query memos PostgreSQL for raw conversation history | | memuk_search | Search memuK SQLite for topic summaries | | memos_memuk_query | Query both sources simultaneously (newest first) |

Environment Variables

| Variable | Default | Description | |----------|---------|-------------| | OPENCLAW_STATE_DIR | ~/.openclaw | Root of OpenClaw state | | MEMOS_DB_PASSWORD | memos_local_20260312 | PostgreSQL password | | OPENAI_API_KEY | — | Required for embedding (if used) | | ALWAYS_LATEST | 1 | Auto-upgrade before each ensure call | | UPDATE_STRATEGY | simple | atomic or simple | | LOG_LEVEL | info | debug, info, warn, error |

Auto-Update Strategy

  • Default (ALWAYS_LATEST=1): each ensure call checks npm for new version, upgrades if available.
  • Atomic mode (UPDATE_STRATEGY=atomic): uses runtime_active/ + runtime_staging/ directories with smoke test before switching.
  • Off (ALWAYS_LATEST=0): no auto-upgrade.

Data Directory

| Component | Path | |-----------|------| | memos PostgreSQL | Docker container memos-postgres | | memuK SQLite | ~/.openclaw/memu.db | | Credentials | ~/.openclaw/secrets/memusync.env (mode 0600) | | Sync checkpoint | ~/.openclaw/.memu_incremental_checkpoint | | SKILL.md | ~/.openclaw/workspace/skills/memory-triple-recall/SKILL.md |

Failure Modes & nextSteps

| Error | Cause | nextSteps | |-------|-------|-----------| | memos-postgres container not running | Docker stopped | docker start memos-postgres | | DB not found ~/.openclaw/memu.db | memuK not initialized | memos_memuk_ensure({}) | | credentials file missing | env not created | install_memory_system({}) | | bootstrap checks failed | multiple | memos_memuk_doctor({}) first | | ensure already running | concurrent call | Wait or kill stuck process |

Verified Setup (per mcp-creator §6)

| Test | Status | |------|--------| | One-shot install | ✅ | | Subagent cold-start recall | ✅ | | PM2 resident process stability | ✅ | | Graceful degradation | ✅ | | Process lock | ✅ |

Architecture

┌─────────────────────────────────────────────┐
│  OpenClaw agent                             │
│  ↓ calls mcporter                           │
│  mcporter → MCP stdio → Node.js server      │
│    ├─ bootstrapEnsure() on startup           │
│    ├─ process lock                           │
│    └─ 9 tools dispatch                      │
│         ├─ memos_query (PostgreSQL)          │
│         ├─ memuk_search (SQLite)            │
│         ├─ memos_memuk_query (parallel)     │
│         ├─ memos_memuk_doctor (diagnostic)  │
│         ├─ memos_memuk_ensure (self-heal)   │
│         ├─ memos_memuk_version (version)    │
│         ├─ memos_memuk_list_commands        │
│         ├─ install_memory_system            │
│         └─ verify_memory_system             │
└─────────────────────────────────────────────┘

License

MIT. Wraps memos (Apache-2.0) and uses @modelcontextprotocol/sdk (MIT).