@plur-ai/mcp 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +42 -29
  2. package/dist/index.js +71 -2
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,36 +1,39 @@
1
1
  # @plur-ai/mcp
2
2
 
3
- MCP server for PLUR — exposes persistent AI memory as Model Context Protocol tools.
3
+ MCP server for PLUR — gives any AI agent persistent memory via the Model Context Protocol.
4
+
5
+ ```bash
6
+ npx @plur-ai/mcp
7
+ ```
8
+
9
+ Or install globally:
4
10
 
5
11
  ```bash
6
12
  npm install -g @plur-ai/mcp
7
13
  ```
8
14
 
9
- The `plur-mcp` binary is now in your PATH. Point any MCP client at it and your agent has memory.
15
+ ## Setup
10
16
 
11
- ## Configuration
17
+ ### Claude Code
12
18
 
13
- ### Claude Code (`.mcp.json`)
19
+ Add to `.claude/mcp.json`:
14
20
 
15
21
  ```json
16
22
  {
17
23
  "mcpServers": {
18
- "plur": {
19
- "command": "plur-mcp"
20
- }
24
+ "plur": { "command": "npx", "args": ["-y", "@plur-ai/mcp"] }
21
25
  }
22
26
  }
23
27
  ```
24
28
 
25
- ### Cursor (`.cursor/mcp.json`)
29
+ ### Cursor
30
+
31
+ Add to `.cursor/mcp.json`:
26
32
 
27
33
  ```json
28
34
  {
29
35
  "mcpServers": {
30
- "plur": {
31
- "command": "plur-mcp",
32
- "args": []
33
- }
36
+ "plur": { "command": "npx", "args": ["-y", "@plur-ai/mcp"] }
34
37
  }
35
38
  }
36
39
  ```
@@ -41,7 +44,8 @@ The `plur-mcp` binary is now in your PATH. Point any MCP client at it and your a
41
44
  {
42
45
  "mcpServers": {
43
46
  "plur": {
44
- "command": "plur-mcp",
47
+ "command": "npx",
48
+ "args": ["-y", "@plur-ai/mcp"],
45
49
  "env": { "PLUR_PATH": "/path/to/storage" }
46
50
  }
47
51
  }
@@ -52,27 +56,36 @@ The `plur-mcp` binary is now in your PATH. Point any MCP client at it and your a
52
56
 
53
57
  | Tool | Description |
54
58
  |------|-------------|
55
- | `plur.learn` | Create an engramrecord a reusable learning, preference, or correction |
56
- | `plur.recall` | Query engrams by keyword/phrase — retrieve relevant learned knowledge |
57
- | `plur.inject` | Get scored context for a task directives and considerations within token budget |
58
- | `plur.feedback` | Rate an engram's usefulness trains injection relevance over time |
59
- | `plur.forget` | Retire an engram — marks it inactive without deleting history |
60
- | `plur.capture` | Append an episode to the timeline — records what happened in a session |
61
- | `plur.timeline` | Query past episodes filter by time, agent, channel, or search |
62
- | `plur.ingest` | Extract engram candidates from content using pattern matching |
63
- | `plur.packs.install` | Install an engram pack from a directory path |
64
- | `plur.packs.list` | List all installed engram packs |
65
- | `plur.status` | System health engram count, episode count, pack count, storage root |
59
+ | `plur.learn` | Store a memorycorrection, preference, convention, or decision |
60
+ | `plur.recall` | Keyword search (BM25, instant) |
61
+ | `plur.recall.hybrid` | **Best default** BM25 + embeddings merged via RRF. No API calls. |
62
+ | `plur.inject` | Select engrams for current task within token budget |
63
+ | `plur.feedback` | Rate an engram — trains injection relevance over time |
64
+ | `plur.forget` | Retire a memory (history preserved) |
65
+ | `plur.capture` | Record a session event to the episodic timeline |
66
+ | `plur.timeline` | Query past episodes by time, agent, or search |
67
+ | `plur.ingest` | Extract engram candidates from text |
68
+ | `plur.sync` | Git-based sync across machines |
69
+ | `plur.sync.status` | Check sync state (initialized, remote, dirty, ahead/behind) |
70
+ | `plur.packs.install` | Install an engram pack |
71
+ | `plur.packs.list` | List installed packs |
72
+ | `plur.status` | System health — engram count, episodes, packs, storage root |
73
+
74
+ ## How agents use it
75
+
76
+ **Session start:** Call `plur.inject` with the task description to load relevant memory.
77
+
78
+ **When corrected:** Call `plur.learn` to store the correction.
66
79
 
67
- ## How to Use (as the AI agent)
80
+ **Session end:** Call `plur.capture` to record what happened.
68
81
 
69
- At session start: call `plur.inject` with your task description to load relevant memory into context.
82
+ **Rate results:** Call `plur.feedback` on injected engrams to improve future quality.
70
83
 
71
- When the user corrects you: call `plur.learn` to record it.
84
+ **Cross-device:** Call `plur.sync` with a git remote URL to sync memory across machines.
72
85
 
73
- At session end: call `plur.capture` to record what happened.
86
+ ## Update notifications
74
87
 
75
- Rate injected engrams with `plur.feedback` to improve future injection quality.
88
+ The server checks npm on startup and logs a warning if a newer version is available. No overhead during operation — the check runs once, asynchronously.
76
89
 
77
90
  ## License
78
91
 
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
5
5
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
6
6
  import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
7
- import { Plur } from "@plur-ai/core";
7
+ import { Plur, checkForUpdate } from "@plur-ai/core";
8
8
 
9
9
  // src/tools.ts
10
10
  function getToolDefinitions() {
@@ -71,6 +71,41 @@ function getToolDefinitions() {
71
71
  };
72
72
  }
73
73
  },
74
+ {
75
+ name: "plur.recall.hybrid",
76
+ description: "Hybrid search \u2014 BM25 + local embeddings merged via Reciprocal Rank Fusion. No API calls, fully local. Best default for most use cases.",
77
+ inputSchema: {
78
+ type: "object",
79
+ properties: {
80
+ query: { type: "string", description: "Search query to find relevant engrams" },
81
+ scope: { type: "string", description: "Filter by scope (also includes global)" },
82
+ domain: { type: "string", description: "Filter by domain prefix" },
83
+ limit: { type: "number", description: "Max results to return (default 20)" },
84
+ min_strength: { type: "number", description: "Minimum retrieval strength (0-1)" }
85
+ },
86
+ required: ["query"]
87
+ },
88
+ handler: async (args, plur) => {
89
+ const results = await plur.recallHybrid(args.query, {
90
+ scope: args.scope,
91
+ domain: args.domain,
92
+ limit: args.limit,
93
+ min_strength: args.min_strength
94
+ });
95
+ return {
96
+ results: results.map((e) => ({
97
+ id: e.id,
98
+ statement: e.statement,
99
+ type: e.type,
100
+ scope: e.scope,
101
+ domain: e.domain,
102
+ retrieval_strength: e.activation.retrieval_strength
103
+ })),
104
+ count: results.length,
105
+ mode: "hybrid"
106
+ };
107
+ }
108
+ },
74
109
  {
75
110
  name: "plur.inject",
76
111
  description: "Get a scored context injection for a task \u2014 returns directives and considerations within token budget",
@@ -264,6 +299,34 @@ function getToolDefinitions() {
264
299
  };
265
300
  }
266
301
  },
302
+ {
303
+ name: "plur.sync",
304
+ description: "Sync engrams via git \u2014 initializes repo on first call, commits and pushes/pulls on subsequent calls. Provide a remote URL on first call to enable cross-device sync.",
305
+ inputSchema: {
306
+ type: "object",
307
+ properties: {
308
+ remote: {
309
+ type: "string",
310
+ description: "Git remote URL (e.g. git@github.com:user/plur-engrams.git). Only needed on first call to set up remote."
311
+ }
312
+ }
313
+ },
314
+ handler: async (args, plur) => {
315
+ const result = plur.sync(args.remote);
316
+ return result;
317
+ }
318
+ },
319
+ {
320
+ name: "plur.sync.status",
321
+ description: "Check git sync status \u2014 whether repo is initialized, has remote, is dirty, ahead/behind counts",
322
+ inputSchema: {
323
+ type: "object",
324
+ properties: {}
325
+ },
326
+ handler: async (_args, plur) => {
327
+ return plur.syncStatus();
328
+ }
329
+ },
267
330
  {
268
331
  name: "plur.status",
269
332
  description: "Return system health \u2014 engram count, episode count, pack count, storage root",
@@ -285,11 +348,17 @@ function getToolDefinitions() {
285
348
  }
286
349
 
287
350
  // src/server.ts
351
+ var VERSION = "0.2.1";
288
352
  async function createServer(plur) {
289
353
  const instance = plur ?? new Plur();
290
354
  const tools = getToolDefinitions();
355
+ checkForUpdate("@plur-ai/mcp", VERSION, (r) => {
356
+ if (r.updateAvailable) {
357
+ console.error(`[plur] Update available: ${r.current} \u2192 ${r.latest}. Run: npx @plur-ai/mcp@latest`);
358
+ }
359
+ });
291
360
  const server = new Server(
292
- { name: "plur-mcp", version: "0.1.0" },
361
+ { name: "plur-mcp", version: VERSION },
293
362
  { capabilities: { tools: {} } }
294
363
  );
295
364
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plur-ai/mcp",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "plur-mcp": "dist/index.js"
@@ -12,7 +12,7 @@
12
12
  "dependencies": {
13
13
  "@modelcontextprotocol/sdk": "^1.12.0",
14
14
  "zod": "^3.23.0",
15
- "@plur-ai/core": "0.1.1"
15
+ "@plur-ai/core": "0.2.1"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/node": "^25.5.0"