@cachly-dev/mcp-server 0.5.16 โ†’ 0.5.18

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.
package/README.md CHANGED
@@ -1,126 +1,176 @@
1
- # Your AI Assistant Has Amnesia. cachly Fixes That.
2
-
3
- > **cachly MCP Server** โ€” Give GitHub Copilot, Claude Code, Cursor, and Windsurf a persistent brain that remembers every lesson, every decision, every bug you've ever fixed.
4
-
5
- [![npm](https://img.shields.io/npm/v/@cachly-dev/mcp-server?color=red&logo=npm)](https://www.npmjs.com/package/@cachly-dev/mcp-server)
6
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](../../LICENSE)
7
- [![GDPR: EU-only](https://img.shields.io/badge/GDPR-EU%20only-green)](https://cachly.dev/legal)
1
+ # ๐Ÿง  cachly AI Brain โ€” MCP Server
2
+
3
+ > **Persistent memory for Claude Code, Cursor, GitHub Copilot & Windsurf.**
4
+ > Your AI remembers every lesson, every fix, every architecture decision โ€” forever.
5
+
6
+ <p align="center">
7
+ <a href="https://github.com/cachly-dev/mcp-server/stargazers">
8
+ <img src="https://img.shields.io/github/stars/cachly-dev/mcp-server?style=social" alt="GitHub Stars" />
9
+ </a>
10
+ &nbsp;
11
+ <a href="https://www.npmjs.com/package/@cachly-dev/mcp-server">
12
+ <img src="https://img.shields.io/npm/v/@cachly-dev/mcp-server?color=red&logo=npm" alt="npm version" />
13
+ </a>
14
+ &nbsp;
15
+ <a href="https://www.npmjs.com/package/@cachly-dev/mcp-server">
16
+ <img src="https://img.shields.io/npm/dw/@cachly-dev/mcp-server?color=blue&label=weekly%20installs" alt="npm downloads" />
17
+ </a>
18
+ &nbsp;
19
+ <a href="https://cachly.dev">
20
+ <img src="https://img.shields.io/badge/Free%20tier-โ‚ฌ0%2Fmo-brightgreen" alt="Free tier" />
21
+ </a>
22
+ &nbsp;
23
+ <a href="https://cachly.dev/legal">
24
+ <img src="https://img.shields.io/badge/GDPR-EU%20only-green" alt="GDPR: EU only" />
25
+ </a>
26
+ &nbsp;
27
+ <img src="https://img.shields.io/badge/License-Apache--2.0-yellow" alt="License: Apache-2.0" />
28
+ </p>
8
29
 
9
30
  ---
10
31
 
11
- ## The Pain
32
+ ## The Problem
12
33
 
13
- Every morning, you open your AI coding assistant. It doesn't remember yesterday. You explain your architecture. You explain the deployment process. You explain the bug you fixed last week. You paste the same context files over and over.
34
+ Every morning, you open your AI coding assistant. It doesn't remember yesterday.
35
+ You explain your architecture. You explain the deployment process. You explain the bug you fixed last week.
14
36
 
15
- **The average developer wastes 45 minutes per day on context re-establishment.** That's โ‚ฌ15,000+ in lost productivity per engineer per year.
16
-
17
- ---
37
+ **The average developer wastes 45 minutes/day re-establishing context.** That's โ‚ฌ15,000+ in lost productivity per engineer per year.
18
38
 
19
39
  ## The Fix โ€” One Command
20
40
 
21
41
  ```bash
22
- CACHLY_JWT=your-jwt npx @cachly-dev/mcp-server setup
42
+ npx @cachly-dev/mcp-server@latest setup
23
43
  ```
24
44
 
25
- The wizard:
26
- 1. Authenticates with your cachly account
27
- 2. Lets you pick which instance to use as your AI Brain
45
+ The interactive wizard:
46
+ 1. Signs you in (free, no credit card required)
47
+ 2. Picks or creates your AI Brain instance
28
48
  3. **Auto-detects** Cursor, Windsurf, VS Code, Claude Code, Continue.dev
29
49
  4. Writes the correct MCP config for every detected editor
30
- 5. Creates `CLAUDE.md` / `.github/copilot-instructions.md` with the memory rules
50
+ 5. Creates `CLAUDE.md` with memory rules pre-filled
51
+
52
+ **Result:** Your AI remembers everything. Always.
53
+
54
+ ---
55
+
56
+ ## Quick Start (Manual)
57
+
58
+ **Step 1 โ€” Get your free credentials** at [cachly.dev](https://cachly.dev) (25 MB free, forever, no credit card).
59
+
60
+ **Step 2 โ€” Add to your editor's MCP config:**
31
61
 
32
- **Result:** Your AI assistant remembers everything. Always.
62
+ <details>
63
+ <summary><b>Claude Code</b> (<code>~/.claude/mcp.json</code> or <code>.mcp.json</code>)</summary>
64
+
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "cachly": {
69
+ "type": "stdio",
70
+ "command": "npx",
71
+ "args": ["-y", "@cachly-dev/mcp-server"],
72
+ "env": {
73
+ "CACHLY_JWT": "your-jwt-token",
74
+ "CACHLY_INSTANCE_ID": "your-instance-id"
75
+ }
76
+ }
77
+ }
78
+ }
79
+ ```
80
+ </details>
81
+
82
+ <details>
83
+ <summary><b>Cursor / Windsurf / VS Code</b> (<code>.cursor/mcp.json</code> / <code>.mcp.json</code>)</summary>
84
+
85
+ ```json
86
+ {
87
+ "servers": {
88
+ "cachly": {
89
+ "type": "stdio",
90
+ "command": "npx",
91
+ "args": ["-y", "@cachly-dev/mcp-server"],
92
+ "env": {
93
+ "CACHLY_JWT": "your-jwt-token",
94
+ "CACHLY_INSTANCE_ID": "your-instance-id"
95
+ }
96
+ }
97
+ }
98
+ }
99
+ ```
100
+ </details>
101
+
102
+ **Step 3 โ€” Add to `CLAUDE.md` / `.github/copilot-instructions.md`:**
103
+
104
+ ```markdown
105
+ ## AI Brain Rules (cachly)
106
+ - Call session_start BEFORE reading any files or making changes
107
+ - Call learn_from_attempts AFTER every fix, deploy, or discovery
108
+ - Call session_end when closing the window
109
+ ```
33
110
 
34
111
  ---
35
112
 
36
- ## With vs. Without cachly Brain
113
+ ## With vs. Without cachly
37
114
 
38
115
  | Situation | Without cachly | With cachly |
39
116
  |-----------|----------------|-------------|
40
117
  | Session start | "What's your architecture?" | "Ready. 23 lessons, last session: deployed API." |
41
118
  | Known bug hits again | Re-researches from scratch | "You fixed this on March 12, here's the exact command" |
42
119
  | After holiday / team handoff | Context dead | Fully briefed in < 10 seconds |
43
- | Repeated LLM patterns | Pays for each re-discovery | Recalls from cache, ~1,200 tokens saved per hit |
44
- | Architecture decisions | Lost in chat history | Permanently stored, searchable |
45
- | New team member | Weeks to onboard | Session start gives full context instantly |
120
+ | Repeated LLM patterns | Pays for each re-discovery | Cached by meaning, ~1,200 tokens saved per hit |
121
+ | New team member | Weeks to onboard | `session_start` gives full context instantly |
46
122
 
47
123
  ---
48
124
 
49
- ## How It Works
125
+ ## 38 MCP Tools
50
126
 
51
- The MCP server gives your AI 30+ tools backed by your cachly Valkey instance:
127
+ ### ๐Ÿง  Session & Memory (most used)
52
128
 
53
- ### ๐Ÿง  Session & Memory
54
129
  | Tool | What it does |
55
130
  |------|-------------|
56
- | **`session_start`** | Full briefing: last session, lessons, open failures, brain health. Call at the start of every session. |
57
- | **`session_end`** | Save summary, files changed, duration. Auto-extracts lessons. |
58
- | **`learn_from_attempts`** | Store structured lessons after any fix or deploy. Deduplicates by topic. |
59
- | **`recall_best_solution`** | Retrieve the best known solution for a topic (increments recall count). |
60
- | **`remember_context`** | Cache architecture findings, decisions, file summaries. |
61
- | **`smart_recall`** | BM25+ search across all brain data โ€” no embedding needed. |
131
+ | **`session_start`** | Full briefing: last session summary, open failures, recent lessons, brain health |
132
+ | **`session_end`** | Save what you built, auto-extract lessons from summary |
133
+ | **`learn_from_attempts`** | Store structured lessons after any fix, deploy, or discovery |
134
+ | **`recall_best_solution`** | Best known solution for a topic โ€” with success/failure history |
135
+ | **`remember_context`** | Cache architecture findings, decisions, file summaries |
136
+ | **`smart_recall`** | BM25+ full-text search across all brain data |
137
+ | **`session_handoff`** | Hand off remaining tasks to next window, with context |
62
138
 
63
139
  ### โš™๏ธ Instance Management
140
+
64
141
  | Tool | What it does |
65
142
  |------|-------------|
66
143
  | `list_instances` | List all your cache instances |
67
144
  | `create_instance` | Spin up a new instance (free or paid) |
68
- | `get_connection_string` | Get the `redis://` URL |
145
+ | `get_connection_string` | Get the `redis://` URL for your app |
69
146
  | `delete_instance` | Remove an instance |
147
+ | `get_real_time_stats` | Memory, hit rate, ops/sec |
70
148
 
71
149
  ### ๐Ÿ—„๏ธ Cache Operations
150
+
72
151
  | Tool | What it does |
73
152
  |------|-------------|
74
- | `cache_get` / `cache_set` / `cache_delete` | Live cache operations |
75
- | `cache_mget` / `cache_mset` | Bulk pipeline operations |
76
- | `cache_lock_acquire` / `cache_lock_release` | Distributed locks |
77
- | `cache_stream_set` / `cache_stream_get` | LLM token streaming cache |
78
- | `cache_stats` | Memory, hit rate, ops/sec |
153
+ | `cache_get` / `cache_set` / `cache_delete` | Standard cache operations |
154
+ | `cache_mget` / `cache_mset` | Bulk pipeline (single round-trip) |
155
+ | `cache_lock_acquire` / `cache_lock_release` | Distributed Redlock-lite |
156
+ | `cache_stream_set` / `cache_stream_get` | LLM token stream caching |
157
+
158
+ ### ๐Ÿ” Semantic Cache
79
159
 
80
- ### ๐Ÿ” Semantic & AI
81
160
  | Tool | What it does |
82
161
  |------|-------------|
83
- | `semantic_search` | Find cached entries by meaning (requires embedding provider) |
84
- | `cache_warmup` | Pre-warm the cache with prompt/response pairs |
85
- | `detect_namespace` | Classify a prompt into semantic namespace |
162
+ | `semantic_search` | Find cached entries by meaning (pgvector HNSW, EU-hosted) |
163
+ | `semantic_warmup` | Pre-warm cache with prompt/response pairs |
164
+ | `detect_namespace` | Auto-classify prompt into code/qa/summary/translation/creative |
165
+
166
+ ### ๐Ÿ‘ฅ Team Brain
86
167
 
87
- ### ๐Ÿ‘ฅ Team Brain (v0.5.8+)
88
168
  | Tool | What it does |
89
169
  |------|-------------|
90
- | `team_synthesize` | Groups lesson history by author/outcome โ€” proposes canonical merged lesson when 3+ devs stored the same fix differently |
91
- | `list_orgs` | List your organizations and their plans |
92
- | `create_org` | Create a new team org (name + plan) |
170
+ | `team_learn` / `team_recall` | Share lessons across the team |
171
+ | `global_learn` / `global_recall` | Cross-project universal lessons |
172
+ | `list_orgs` / `create_org` | Manage team organizations |
93
173
  | `invite_member` | Invite a developer to your org by email |
94
- | `get_org_plan` | Check org plan, seat usage, billing status |
95
-
96
- > **How Team Brain works:** Every developer in your org uses the same `CACHLY_INSTANCE_ID`. Every `learn_from_attempts` call is visible to the whole team. `session_start` surfaces relevant lessons from any teammate before every session.
97
-
98
- ---
99
-
100
- ## Manual Setup (without wizard)
101
-
102
- Add to `~/.vscode/mcp.json`, `.cursor/mcp.json`, or `.mcp.json`:
103
-
104
- ```json
105
- {
106
- "servers": {
107
- "cachly": {
108
- "type": "stdio",
109
- "command": "npx",
110
- "args": ["-y", "@cachly-dev/mcp-server"],
111
- "env": { "CACHLY_JWT": "your-jwt-token" }
112
- }
113
- }
114
- }
115
- ```
116
-
117
- Add to `CLAUDE.md` / `.github/copilot-instructions.md`:
118
- ```markdown
119
- ## AI Brain Rules (cachly)
120
- - Call session_start BEFORE reading any files or making changes
121
- - Call learn_from_attempts AFTER every fix, deploy, or discovery
122
- - Call session_end when closing the window
123
- ```
124
174
 
125
175
  ---
126
176
 
@@ -128,19 +178,32 @@ Add to `CLAUDE.md` / `.github/copilot-instructions.md`:
128
178
 
129
179
  | Tier | RAM | Price | Best for |
130
180
  |------|-----|-------|----------|
131
- | **Free** | 25 MB | โ‚ฌ0/mo | Dev & side projects |
181
+ | **Free** | 25 MB | **โ‚ฌ0/mo forever** | Dev & side projects |
132
182
  | **Dev** | 200 MB | โ‚ฌ19/mo | Individual developers |
133
183
  | **Pro** | 900 MB | โ‚ฌ49/mo | Teams |
134
- | **Speed** | 900 MB Dragonfly + Semantic Cache | โ‚ฌ79/mo | AI-heavy workloads |
184
+ | **Speed** | 900 MB + Dragonfly + Semantic Cache | โ‚ฌ79/mo | AI-heavy workloads |
135
185
  | **Business** | 7 GB | โ‚ฌ199/mo | Scale-ups |
136
186
 
137
- All plans: **German servers ยท GDPR-compliant ยท No US data transfer ยท 99.9% SLA**
187
+ โœ… All plans: **German servers ยท GDPR-compliant ยท 99.9% SLA ยท No credit card for Free tier**
188
+
189
+ ---
190
+
191
+ ## Environment Variables
192
+
193
+ | Variable | Default | Description |
194
+ |----------|---------|-------------|
195
+ | `CACHLY_JWT` | โ€” | **Required.** Your API token from [cachly.dev](https://cachly.dev) |
196
+ | `CACHLY_INSTANCE_ID` | โ€” | Default instance UUID (optional if you pass per-call) |
197
+ | `CACHLY_API_URL` | `https://api.cachly.dev` | Override for self-hosted |
198
+ | `CACHLY_NO_TELEMETRY` | unset | Set to `1` to disable anonymous usage pings |
199
+ | `CACHLY_NO_UPDATE_CHECK` | unset | Set to `1` to disable the version-check on startup |
138
200
 
139
201
  ---
140
202
 
141
203
  ## Links
142
204
 
143
- - [cachly.dev](https://cachly.dev) โ€” Dashboard & free signup
144
- - [AI Brain docs](https://cachly.dev/docs/ai-memory) โ€” Full documentation
145
- - [npm](https://www.npmjs.com/package/@cachly-dev/mcp-server) โ€” Package
146
- - [GitHub](https://github.com/cachly-dev/mcp-server)
205
+ - ๐ŸŒ [cachly.dev](https://cachly.dev) โ€” Dashboard & free signup
206
+ - ๐Ÿ“– [AI Brain docs](https://cachly.dev/docs/ai-memory) โ€” Full documentation
207
+ - ๐Ÿ’ฌ [GitHub Issues](https://github.com/cachly-dev/mcp-server/issues) โ€” Bug reports & feature requests
208
+ - โญ [Star on GitHub](https://github.com/cachly-dev/mcp-server) โ€” If cachly saves you time, a star means a lot!
209
+ - ๐Ÿ“ฆ [npm](https://www.npmjs.com/package/@cachly-dev/mcp-server)
package/dist/index.js CHANGED
@@ -44,6 +44,7 @@ import { Redis } from 'ioredis';
44
44
  const API_URL = process.env.CACHLY_API_URL ?? 'https://api.cachly.dev';
45
45
  const JWT = process.env.CACHLY_JWT ?? '';
46
46
  const EMBED_MODEL = process.env.CACHLY_EMBED_MODEL ?? '';
47
+ const CURRENT_VERSION = '0.5.17';
47
48
  /**
48
49
  * โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
49
50
  * โ”‚ EMBEDDING PROVIDER โ€” pluggable, client-side first โ”‚
@@ -1702,9 +1703,34 @@ function buildConnectionString(inst) {
1702
1703
  const pw = inst.password ? `:${inst.password}@` : '@';
1703
1704
  return `${scheme}://${pw}${inst.host}:${inst.port}`;
1704
1705
  }
1706
+ // Fires once per process when no JWT is set (anonymous, opt-out via CACHLY_NO_TELEMETRY=1)
1707
+ let _telemetryPingSent = false;
1708
+ async function sendAnonymousTelemetry(toolName) {
1709
+ if (_telemetryPingSent)
1710
+ return;
1711
+ if (process.env.CACHLY_NO_TELEMETRY === '1')
1712
+ return;
1713
+ _telemetryPingSent = true;
1714
+ // Detect editor from common env vars injected by IDE extensions
1715
+ const editor = process.env.CURSOR_TRACE_ID ? 'cursor'
1716
+ : process.env.WINDSURF_SESSION_ID ? 'windsurf'
1717
+ : process.env.GITHUB_COPILOT_WORKSPACE ? 'copilot'
1718
+ : process.env.CLAUDE_CODE_ENTRYPOINT ? 'claude'
1719
+ : 'unknown';
1720
+ try {
1721
+ await fetch(`${API_URL}/api/v1/telemetry/mcp`, {
1722
+ method: 'POST',
1723
+ headers: { 'Content-Type': 'application/json' },
1724
+ body: JSON.stringify({ event: 'first_call_no_jwt', version: CURRENT_VERSION, editor, tool: toolName }),
1725
+ signal: AbortSignal.timeout(3000),
1726
+ });
1727
+ }
1728
+ catch { /* fire-and-forget, never block the user */ }
1729
+ }
1705
1730
  async function handleTool(name, args) {
1706
1731
  // Guard: if no JWT, return actionable onboarding message instead of HTTP 401
1707
1732
  if (!JWT) {
1733
+ void sendAnonymousTelemetry(name);
1708
1734
  return [
1709
1735
  '๐Ÿง  **cachly AI Brain โ€” Setup required**',
1710
1736
  '',
@@ -4218,7 +4244,7 @@ async function handleBulkLockStream(name, args) {
4218
4244
  }
4219
4245
  }
4220
4246
  // โ”€โ”€ Server setup โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4221
- const server = new Server({ name: 'cachly-mcp', version: '0.4.0' }, { capabilities: { tools: {} } });
4247
+ const server = new Server({ name: 'cachly-mcp', version: CURRENT_VERSION }, { capabilities: { tools: {} } });
4222
4248
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
4223
4249
  // โ”€โ”€ Auto-session management โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4224
4250
  // Transparently starts a Brain session on the first tool call of a process
@@ -4530,7 +4556,26 @@ if (process.argv[2] === 'setup') {
4530
4556
  ? detected
4531
4557
  : editorsRaw.split(/[,\s]+/).map(s => s.toLowerCase()).filter(s => EDITOR_FILES[s]);
4532
4558
  console.log('');
4533
- // โ”€โ”€ Step 4: Write editor configs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4559
+ // โ”€โ”€ Step 4: Email opt-in โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4560
+ console.log('Step 4: Stay in the loop (optional)');
4561
+ const email = await ask(' Email for release notes & tips? [Enter to skip]: ');
4562
+ if (email && email.includes('@')) {
4563
+ try {
4564
+ await fetch(`${API_URL}/api/newsletter/subscribe`, {
4565
+ method: 'POST', headers: { 'Content-Type': 'application/json' },
4566
+ body: JSON.stringify({ email: email.trim().toLowerCase(), source: 'mcp-setup' }),
4567
+ signal: AbortSignal.timeout(5000),
4568
+ });
4569
+ console.log('โœ… Subscribed โ€” you\'ll only hear from us when it matters.\n');
4570
+ }
4571
+ catch {
4572
+ console.log('โš ๏ธ Could not subscribe (no internet?). Continuing...\n');
4573
+ }
4574
+ }
4575
+ else {
4576
+ console.log(' Skipped.\n');
4577
+ }
4578
+ // โ”€โ”€ Step 5: Write editor configs โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4534
4579
  for (const editor of editorsToSetup) {
4535
4580
  const configFile = EDITOR_FILES[editor] ?? '.mcp.json';
4536
4581
  const configPath = resolve(cwd, configFile);
@@ -4538,7 +4583,7 @@ if (process.argv[2] === 'setup') {
4538
4583
  await writeFile(configPath, buildMcpConfig(token, instance.id, editor), 'utf-8');
4539
4584
  console.log(`โœ… Written: ${configFile}`);
4540
4585
  }
4541
- // โ”€โ”€ Step 5: CLAUDE.md (always โ€” idempotent) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4586
+ // โ”€โ”€ Step 6: CLAUDE.md (always โ€” idempotent) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4542
4587
  const mdResult = await writeClaudeMd(cwd, instance.id);
4543
4588
  const mdLabel = mdResult === 'updated' ? 'โœ… Updated' : mdResult === 'appended' ? 'โœ… Appended to' : 'โœ… Written';
4544
4589
  console.log(`${mdLabel}: CLAUDE.md`);
@@ -4568,6 +4613,25 @@ if (!JWT) {
4568
4613
  'โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n' +
4569
4614
  '\n');
4570
4615
  }
4616
+ // โ”€โ”€ Update nudge (non-blocking, fire-and-forget) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
4617
+ // Check npm registry once per process start; if outdated, log to stderr so
4618
+ // the editor's MCP log shows an actionable one-liner. Skipped if opted out.
4619
+ if (!process.env.CACHLY_NO_UPDATE_CHECK) {
4620
+ (async () => {
4621
+ try {
4622
+ const res = await fetch(`https://registry.npmjs.org/@cachly-dev/mcp-server/latest`, { signal: AbortSignal.timeout(4000) });
4623
+ if (res.ok) {
4624
+ const data = await res.json();
4625
+ const latest = data?.version ?? '';
4626
+ if (latest && latest !== CURRENT_VERSION) {
4627
+ process.stderr.write(`\nโšก cachly update available: ${CURRENT_VERSION} โ†’ ${latest}\n` +
4628
+ ` Run: npx @cachly-dev/mcp-server@latest setup\n\n`);
4629
+ }
4630
+ }
4631
+ }
4632
+ catch { /* ignore โ€“ network unavailable or timeout */ }
4633
+ })();
4634
+ }
4571
4635
  const transport = new StdioServerTransport();
4572
4636
  await server.connect(transport);
4573
4637
  //# sourceMappingURL=index.js.map