Skip to content

MCP adapter

The MCP adapter (@plur-ai/mcp) is the most common way to use PLUR. It exposes the engine as a Model Context Protocol server — any MCP-aware agent can call its tools. For Claude Code specifically it also installs lifecycle hooks for fully automatic memory.

Terminal window
npx @plur-ai/mcp init

init does three things:

  1. Creates ~/.plur/ for engram storage.
  2. Adds PLUR to your ~/.mcp.json (or .claude/mcp.json if you’re project-scoped).
  3. Installs Claude Code hooks in ~/.claude/settings.json for automatic injection on session start and learning capture on UserPromptSubmit.

The hook system means you don’t have to ask Claude Code to use PLUR — it just does. Restart Claude Code and it’s wired.

The MCP server exposes 18 tools. The most-used ones:

ToolWhat it does
plur_session_startStart a session, inject relevant engrams for the task.
plur_session_endEnd a session, capture summary and new learnings.
plur_learnSave a correction, preference, or pattern.
plur_recall_hybridDefault search: BM25 + embeddings + RRF. Local, free.
plur_recallBM25 only — instant, no embeddings.
plur_inject / plur_inject_hybridLoad relevant memories for the current task.
plur_feedbackRate an engram (positive / negative). Trains recall.
plur_forgetRetire an engram. History preserved.
plur_statusHealth check.
plur_syncSync across machines via git.
plur_packs_install / _list / _uninstallManage Knowledge Packs.
plur_stores_add / _listConnect to a remote store (Enterprise).

Full list and signatures: MCP tools reference.

When you run npx @plur-ai/mcp init against Claude Code, PLUR installs these hooks:

HookWhat PLUR does
SessionStartCalls plur_session_start with the session task, injects top-N engrams into the system prompt.
UserPromptSubmitScans for correction patterns (“no, actually…”, “from now on…”). Auto-stages an engram candidate.
Stop (session end)Calls plur_session_end to write the episode and commit candidate engrams.

You can see what got injected:

Terminal window
plur timeline --channel session --limit 1

To disable a hook, edit ~/.claude/settings.json and remove the line. To re-enable later, re-run plur init.

PLUR is a single global store at ~/.plur/. There is one engram database per machine. Per-project isolation is done with scope, not separate stores.

To set the current scope for a project:

Terminal window
cd ~/projects/my-app
npx @plur-ai/cli init --domain myapp --scope project:my-app

This writes .plur.yaml. Hooks read it on session start; engrams learned in this project get tagged with scope: project:my-app. Recall in this project always includes global engrams, but excludes project:other-app.

See Multi-project setup for the full pattern.

The MCP adapter can also point at a remote PLUR store running PLUR Enterprise. Local memory keeps working; team scopes show up alongside personal ones.

Terminal window
plur stores add \
--name acme \
--url https://plur.acme.com \
--token sk_acme_...

After this, engrams under group:acme/* are read from and written to the Enterprise server with permission enforcement. Personal engrams (global, project:*) stay local. See Migrating local → Enterprise.

  • Agent says it has no plur_* tools — MCP config didn’t load. Restart the editor and check ~/.mcp.json.
  • Hooks not firing in Claude Code — re-run plur init and confirm ~/.claude/settings.json has the SessionStart/UserPromptSubmit entries.
  • bge-m3 embedder model not downloading — first run downloads ~500 MB; on a slow link give it five minutes. plur doctor reports embedder status.
  • MCP timeout on first call — increase the client’s MCP timeout to 30 s for the first session (model load).

Next: OpenClaw plugin →