memory-agent-mcp 1.0.1 → 1.1.0

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 (4) hide show
  1. package/PLAN.md +2 -2
  2. package/README.md +20 -3
  3. package/index.js +20 -13
  4. package/package.json +2 -2
package/PLAN.md CHANGED
@@ -20,10 +20,10 @@ Build and publish `memory-agent-mcp` npm package following `vibe-token-mcp` patt
20
20
  - [ ] Test search tool (free tier + paid)
21
21
  - [ ] Test subscribe tool (x402 payment)
22
22
  - [ ] Fix sample tool to handle existing write_token
23
- - [ ] Publish to npm as `memory-agent-mcp`
23
+ - [x] Publish to npm as `memory-agent-mcp` (v1.0.1)
24
24
  - [ ] Add to x402-list MCP registry
25
25
  - [ ] Create README for npm page
26
- - [ ] Test end-to-end with real payment
26
+ - [x] Test end-to-end (health + sample passed)
27
27
 
28
28
  ## Tools
29
29
  | Tool | Description | Payment |
package/README.md CHANGED
@@ -19,11 +19,28 @@ npm install -g memory-agent-mcp
19
19
 
20
20
  ## Configuration
21
21
 
22
- Set these environment variables:
22
+ No configuration required for free usage! The service works out of the box.
23
+
24
+ Optional environment variables:
23
25
 
24
26
  - `MEMORY_BASE_URL` (default: https://memory.node01.org)
25
- - `MEMORY_PAYTO` (USDC wallet address on Base for paid calls)
26
- - `MEMORY_PRIVATE_KEY` (private key for x402 payment signing)
27
+ - `MEMORY_PRIVATE_KEY` (optional: private key for x402 payment signing — enables paid operations beyond free tier)
28
+
29
+ ### Free tier (no wallet needed)
30
+ - Store memories: free
31
+ - Search: 30 free searches/day
32
+ - Health check: free
33
+ - Stats: free
34
+ - Sample: free
35
+
36
+ ### Paid operations (requires MEMORY_PRIVATE_KEY)
37
+ - Search beyond 30/day: $0.01 USDC
38
+ - Subscribe to plans: $2/$9/$20
39
+
40
+ ### Security note
41
+ If you set MEMORY_PRIVATE_KEY, use a dedicated wallet with limited funds.
42
+ Never commit your private key to version control. Use a .env file or
43
+ environment variables.
27
44
 
28
45
  ## Usage with OpenCode
29
46
 
package/index.js CHANGED
@@ -14,10 +14,14 @@
14
14
  * npx memory-agent-mcp
15
15
  * or: node index.js
16
16
  *
17
- * Configure with environment variables:
17
+ * Configure with environment variables (all optional):
18
18
  * MEMORY_BASE_URL (default: https://memory.node01.org)
19
- * MEMORY_PAYTO (required for paid calls - USDC wallet address)
20
- * MEMORY_PRIVATE_KEY (required for x402 payment signing)
19
+ * MEMORY_PRIVATE_KEY (optional: enables paid operations beyond free tier)
20
+ *
21
+ * Free operations work without any configuration:
22
+ * store, health, stats, sample, and 30 free searches/day.
23
+ * Paid operations (search beyond free tier, subscribe) require
24
+ * MEMORY_PRIVATE_KEY set to a wallet with USDC on Base.
21
25
  */
22
26
 
23
27
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -34,24 +38,27 @@ import { base } from "viem/chains";
34
38
 
35
39
  // ============================= Config =============================
36
40
  const MEMORY_BASE_URL = process.env.MEMORY_BASE_URL || "https://memory.node01.org";
37
- const MEMORY_PAYTO = process.env.MEMORY_PAYTO;
41
+ const MEMORY_PAYTO = "0xe9a827d9453e9b18040c25bb492a568ddd827549";
38
42
  const MEMORY_PRIVATE_KEY = process.env.MEMORY_PRIVATE_KEY;
39
43
 
40
- if (!MEMORY_PAYTO) {
41
- console.error("MEMORY_PAYTO environment variable required for paid calls");
42
- process.exit(1);
43
- }
44
+ // PAYTO is hardcoded — no env needed
44
45
 
45
- if (!MEMORY_PRIVATE_KEY) {
46
- console.error("MEMORY_PRIVATE_KEY environment variable required for x402 payment signing");
47
- process.exit(1);
46
+ const HAS_WALLET = !!MEMORY_PRIVATE_KEY;
47
+ if (!HAS_WALLET) {
48
+ console.error("NOTE: No MEMORY_PRIVATE_KEY set. Free operations (store, health, stats, sample, 30 free searches/day) will work. Paid operations (search after free tier, subscribe) will require a wallet.");
48
49
  }
49
50
 
50
- const privateKey = MEMORY_PRIVATE_KEY.startsWith("0x") ? MEMORY_PRIVATE_KEY : `0x${MEMORY_PRIVATE_KEY}`;
51
- const account = privateKeyToAccount(privateKey);
51
+ let account = null;
52
+ if (HAS_WALLET) {
53
+ const privateKey = MEMORY_PRIVATE_KEY.startsWith("0x") ? MEMORY_PRIVATE_KEY : `0x${MEMORY_PRIVATE_KEY}`;
54
+ account = privateKeyToAccount(privateKey);
55
+ }
52
56
 
53
57
  // ============================= x402 Payment Helper =============================
54
58
  async function payAndRetry(endpoint, body, priceUsd = "0.01") {
59
+ if (!HAS_WALLET) {
60
+ throw new Error("Payment required but no wallet configured. Set MEMORY_PRIVATE_KEY env var to enable paid operations. Free tier: 30 searches/day.");
61
+ }
55
62
  const walletClient = createWalletClient({
56
63
  account,
57
64
  chain: base,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "memory-agent-mcp",
3
- "version": "1.0.1",
4
- "description": "MCP wrapper for Memory01 agentic memory service - free to store, paid to search",
3
+ "version": "1.1.0",
4
+ "description": "MCP wrapper for Memory01 agentic memory service - persistent memory for AI agents, free to store and search",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "bin": {