@cachly-dev/mcp-server 0.10.26 → 0.10.40

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 (76) hide show
  1. package/.env.test.example +23 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +50 -0
  3. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +25 -0
  5. package/.github/workflows/publish.yml +72 -0
  6. package/CHANGELOG.md +252 -0
  7. package/LAUNCH_TEXTS.md +182 -0
  8. package/LICENSE +202 -0
  9. package/README.md +142 -112
  10. package/dist/__tests__/auth.test.d.ts +1 -0
  11. package/dist/__tests__/auth.test.js +107 -0
  12. package/dist/__tests__/auth.test.js.map +1 -0
  13. package/dist/__tests__/e2e/api-auth.test.d.ts +7 -0
  14. package/dist/__tests__/e2e/api-auth.test.js +162 -0
  15. package/dist/__tests__/e2e/api-auth.test.js.map +1 -0
  16. package/dist/__tests__/e2e/api-health.test.d.ts +7 -0
  17. package/dist/__tests__/e2e/api-health.test.js +95 -0
  18. package/dist/__tests__/e2e/api-health.test.js.map +1 -0
  19. package/dist/__tests__/e2e/cli.test.d.ts +10 -0
  20. package/dist/__tests__/e2e/cli.test.js +204 -0
  21. package/dist/__tests__/e2e/cli.test.js.map +1 -0
  22. package/dist/__tests__/e2e/config.d.ts +35 -0
  23. package/dist/__tests__/e2e/config.js +53 -0
  24. package/dist/__tests__/e2e/config.js.map +1 -0
  25. package/dist/__tests__/e2e/funnel.test.d.ts +13 -0
  26. package/dist/__tests__/e2e/funnel.test.js +90 -0
  27. package/dist/__tests__/e2e/funnel.test.js.map +1 -0
  28. package/dist/__tests__/e2e/mcp-tools.test.d.ts +7 -0
  29. package/dist/__tests__/e2e/mcp-tools.test.js +129 -0
  30. package/dist/__tests__/e2e/mcp-tools.test.js.map +1 -0
  31. package/dist/__tests__/e2e/provisioning.test.d.ts +15 -0
  32. package/dist/__tests__/e2e/provisioning.test.js +123 -0
  33. package/dist/__tests__/e2e/provisioning.test.js.map +1 -0
  34. package/dist/handlers/brain.js +119 -82
  35. package/dist/handlers/brain.js.map +1 -1
  36. package/dist/handlers/fedbrain.js +93 -44
  37. package/dist/handlers/fedbrain.js.map +1 -1
  38. package/dist/handlers/roadmap.js +8 -2
  39. package/dist/handlers/roadmap.js.map +1 -1
  40. package/dist/handlers/syndicate.js +15 -7
  41. package/dist/handlers/syndicate.js.map +1 -1
  42. package/dist/handlers/team.js +62 -50
  43. package/dist/handlers/team.js.map +1 -1
  44. package/dist/index.js +1264 -234
  45. package/dist/index.js.map +1 -1
  46. package/dist/tools.d.ts +3 -54
  47. package/dist/tools.js +8 -62
  48. package/dist/tools.js.map +1 -1
  49. package/eslint.config.js +16 -0
  50. package/glama.json +36 -0
  51. package/llms.txt +155 -0
  52. package/package.json +38 -14
  53. package/scripts/e2e-run.sh +160 -0
  54. package/scripts/postinstall.js +12 -12
  55. package/server.json +3 -9
  56. package/smithery.yaml +15 -8
  57. package/src/__tests__/auth.test.ts +147 -0
  58. package/src/__tests__/e2e/api-auth.test.ts +182 -0
  59. package/src/__tests__/e2e/api-health.test.ts +103 -0
  60. package/src/__tests__/e2e/cli.test.ts +228 -0
  61. package/src/__tests__/e2e/config.ts +53 -0
  62. package/src/__tests__/e2e/funnel.test.ts +99 -0
  63. package/src/__tests__/e2e/mcp-tools.test.ts +191 -0
  64. package/src/__tests__/e2e/provisioning.test.ts +128 -0
  65. package/src/handlers/brain.ts +118 -78
  66. package/src/handlers/fedbrain.ts +88 -38
  67. package/src/handlers/roadmap.ts +7 -2
  68. package/src/handlers/syndicate.ts +13 -7
  69. package/src/handlers/team.ts +57 -33
  70. package/src/index.ts +1312 -257
  71. package/src/tools.ts +8 -66
  72. package/vitest.config.ts +12 -0
  73. package/dist/__tests__/brain-predict-failures.test.d.ts +0 -17
  74. package/dist/__tests__/brain-predict-failures.test.js +0 -339
  75. package/dist/__tests__/brain-predict-failures.test.js.map +0 -1
  76. package/src/__tests__/brain-predict-failures.test.ts +0 -430
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,58 +1,93 @@
1
1
  # 🧠 cachly AI Brain — MCP Server
2
2
 
3
- > **Your AI forgot that 3-hour fix. Again.**
4
- > cachly gives every AI coding assistant — Claude Code, Cursor, GitHub Copilot, Windsurf, Cline & Zed — **permanent memory across all sessions, all projects, all editors.**
5
-
6
- <p align="center">
7
- <a href="https://cachly.dev?utm_source=npm&utm_medium=readme&utm_campaign=mcp-server">
8
- <img src="https://img.shields.io/badge/▶_Free_Brain_in_30s-cachly.dev-7c3aed?style=for-the-badge" alt="Free Brain" />
9
- </a>
10
- &nbsp;&nbsp;
11
- <a href="https://marketplace.visualstudio.com/items?itemName=cachly-dev.cachly-brain">
12
- <img src="https://img.shields.io/badge/VS_Code_Extension-Install_Free-0078d7?style=for-the-badge&logo=visual-studio-code" alt="VS Code Extension" />
13
- </a>
14
- </p>
3
+ > **You're a senior developer. Your AI should act like one.**
4
+ > Stop re-teaching your AI every morning. cachly gives it a permanent brain — pre-briefed every session, learns from every commit, never makes the same mistake twice.
15
5
 
16
6
  <p align="center">
17
7
  <a href="https://www.npmjs.com/package/@cachly-dev/mcp-server">
18
- <img src="https://img.shields.io/npm/v/@cachly-dev/mcp-server?color=red&logo=npm" alt="npm version" />
8
+ <img src="https://img.shields.io/npm/v/@cachly-dev/mcp-server?color=violet&logo=npm" alt="npm version" />
19
9
  </a>
20
10
  &nbsp;
21
11
  <a href="https://www.npmjs.com/package/@cachly-dev/mcp-server">
22
- <img src="https://img.shields.io/npm/dw/@cachly-dev/mcp-server?color=blue&label=weekly%20installs" alt="weekly installs" />
12
+ <img src="https://img.shields.io/npm/dw/@cachly-dev/mcp-server?color=blue&label=weekly%20installs" alt="npm downloads" />
23
13
  </a>
24
14
  &nbsp;
25
- <a href="https://www.npmjs.com/package/@cachly-dev/mcp-server">
26
- <img src="https://img.shields.io/npm/dt/@cachly-dev/mcp-server?color=blueviolet&label=total%20installs" alt="total installs" />
27
- </a>
28
- &nbsp;
29
- <a href="https://cachly.dev?utm_source=npm&utm_medium=readme&utm_campaign=mcp-server">
30
- <img src="https://img.shields.io/badge/Free%20tier-€0%2Fmo%20forever-brightgreen" alt="Free tier" />
15
+ <a href="https://cachly.dev">
16
+ <img src="https://img.shields.io/badge/Free%20tier-€0%2Fmo-brightgreen" alt="Free tier" />
31
17
  </a>
32
18
  &nbsp;
33
19
  <a href="https://cachly.dev/legal">
34
- <img src="https://img.shields.io/badge/GDPR-EU%20servers-green" alt="GDPR: EU only" />
20
+ <img src="https://img.shields.io/badge/GDPR-EU%20servers-green" alt="GDPR: EU servers" />
35
21
  </a>
36
22
  &nbsp;
23
+ <img src="https://img.shields.io/badge/89%20MCP%20tools-violet" alt="89 MCP tools" />
24
+ &nbsp;
37
25
  <img src="https://img.shields.io/badge/License-Apache--2.0-yellow" alt="License: Apache-2.0" />
26
+ &nbsp;
27
+ <a href="https://cachly.dev">
28
+ <img src="https://img.shields.io/badge/Brain%20badge-embed%20in%20README-7c3aed" alt="Brain badge" />
29
+ </a>
38
30
  </p>
39
31
 
40
32
  ---
41
33
 
34
+ ## Try it right now — no account needed
35
+
36
+ ```bash
37
+ npx @cachly-dev/mcp-server@latest demo
38
+ ```
39
+
40
+ Run this in any project directory. It reads your git history and shows exactly what your AI would know:
41
+
42
+ ```
43
+ ┌─────────────────────────────────────────────────────────────┐
44
+ │ 🧠 Brain Preview — What your AI would know │
45
+ ├─────────────────────────────────────────────────────────────┤
46
+ │ Commits analysed : 847 Date range: 2024-01-12 → 2026-05-14 │
47
+ │ Lessons extracted: 634 Contributors: 7 │
48
+ ├─────────────────────────────────────────────────────────────┤
49
+ │ Category breakdown: │
50
+ │ 🔧 fix ████████████████████ 312 │
51
+ │ ✨ feat ███████████████ 189 │
52
+ │ 🔒 security ██ 18 │
53
+ │ 🚀 deploy ██ 15 │
54
+ ├─────────────────────────────────────────────────────────────┤
55
+ │ 🔒 Security fixes your AI would know: │
56
+ │ • fix(auth): JWT expiry check before signature validation │
57
+ │ • security: sanitize webhook payload before JSON.parse │
58
+ ├─────────────────────────────────────────────────────────────┤
59
+ │ 🔧 Bug fixes your AI would remember: │
60
+ │ • fix: Redis pub/sub race condition under high concurrency │
61
+ │ • fix: k8s readinessProbe threshold too low for cold start │
62
+ │ • fix: Stripe idempotency_key missing on retry path │
63
+ │ • fix: tRPC context not forwarded to background jobs │
64
+ ├─────────────────────────────────────────────────────────────┤
65
+ │ 💡 With cachly, your AI arrives pre-briefed every session. │
66
+ │ No more re-explaining. No more repeated mistakes. │
67
+ └─────────────────────────────────────────────────────────────┘
68
+
69
+ Make this permanent (free, 1–5 minutes):
70
+ $ npx @cachly-dev/mcp-server@latest setup
71
+
72
+ Works with: Claude Code · Cursor · Windsurf · Copilot · Cline · Zed
73
+ Free forever · GDPR · German servers · No credit card
74
+ ```
75
+
76
+ ---
77
+
42
78
  ## The Problem
43
79
 
44
80
  Every morning, you open your AI coding assistant. It doesn't remember yesterday.
45
81
  You explain your architecture. You explain the deployment process. You explain the bug you fixed last week.
46
82
 
47
- **The average developer wastes 45 minutes/day re-establishing context.**
48
- That's ~$18,000/year per developer — before you even count the re-discovered bugs.
83
+ **The average developer wastes 45 minutes/day re-establishing context.**
49
84
 
50
85
  ---
51
86
 
52
87
  ## One Command. Fully Automatic.
53
88
 
54
89
  ```bash
55
- npx @cachly-dev/init
90
+ npx @cachly-dev/mcp-server@latest setup
56
91
  ```
57
92
 
58
93
  Run it once. It handles everything:
@@ -61,37 +96,15 @@ Run it once. It handles everything:
61
96
  2. **Detects your editors** — Claude Code, Cursor, Windsurf, VS Code, Copilot, Cline & Zed
62
97
  3. **Writes the MCP config** for every detected editor automatically
63
98
  4. **Creates `CLAUDE.md`** with Brain rules so your AI acts autonomously
64
- 5. **Installs a git hook** that learns from every commit automatically
99
+ 5. **Reads your git history** — extracts lessons from years of commits before your first session
100
+ 6. **Installs a git hook** — learns from every future commit automatically
65
101
 
66
102
  **Restart your editor.** From now on your AI arrives pre-briefed — every session.
67
103
 
68
- > **Also a VS Code user?** Install the **[cachly Brain extension](https://marketplace.visualstudio.com/items?itemName=cachly-dev.cachly-brain)** — see your AI's memory, lesson count, and tokens saved right in the status bar.
69
-
70
- ---
71
-
72
- ## 🆓 What You Get for Free
73
-
74
- No credit card. No expiry. No catch.
75
-
76
- | Feature | Free tier |
77
- |---------|-----------|
78
- | Brain storage | 25 MB |
79
- | MCP tools | All 89 |
80
- | Sessions | Unlimited |
81
- | Projects | Unlimited |
82
- | Team sharing | 1 shared Brain |
83
- | Git hook learning | ✅ |
84
- | Causal root cause analysis | ✅ |
85
- | Failure prediction | ✅ |
86
-
87
- **[→ Create your free Brain](https://cachly.dev?utm_source=npm&utm_medium=readme&utm_campaign=free-cta)**
88
-
89
104
  ---
90
105
 
91
106
  ## What happens after setup — everything is automatic
92
107
 
93
- You never type another command. The Brain runs entirely in the background:
94
-
95
108
  | Trigger | What the Brain does automatically |
96
109
  |---------|----------------------------------|
97
110
  | First tool call | Session starts, project gets indexed in background |
@@ -116,31 +129,67 @@ You never type another command. The Brain runs entirely in the background:
116
129
 
117
130
  ---
118
131
 
132
+ ## CLI Commands
133
+
134
+ ```bash
135
+ npx @cachly-dev/mcp-server@latest demo # Preview your Brain (no account needed)
136
+ npx @cachly-dev/mcp-server@latest setup # Wire up all your AI editors (1–5 minutes)
137
+ npx @cachly-dev/mcp-server@latest health # Check token, API, editors, git hook
138
+ npx @cachly-dev/mcp-server@latest digest # Weekly Brain summary — shareable
139
+ npx @cachly-dev/mcp-server@latest share # Generate a shareable stats card + tweet
140
+ npx @cachly-dev/mcp-server@latest badge # Get a live README badge for your Brain
141
+ npx @cachly-dev/mcp-server@latest invite # Invite a teammate to share your Brain
142
+ npx @cachly-dev/mcp-server@latest index . # Index a project's code into the Brain (CI-friendly)
143
+ npx @cachly-dev/mcp-server@latest learn-git # Auto-learn lessons from recent git commits (PR-merge ready)
144
+ ```
145
+
146
+ > **Tip — auto-learn on every merged PR:** run `learn-git` in CI via the
147
+ > [cachly-brain-setup GitHub Action](https://github.com/cachly-dev/cachly/tree/main/sdk/github-action)
148
+ > with `mode: learn`. Each merged PR teaches your Brain automatically — no manual calls.
149
+
150
+ ---
151
+
152
+ ## Brain Badge — show your lessons live
153
+
154
+ Add a live lesson-count badge to any README — updates every hour, no auth required:
155
+
156
+ ```bash
157
+ npx @cachly-dev/mcp-server@latest badge
158
+ ```
159
+
160
+ Outputs your personal Markdown snippet:
161
+
162
+ ```markdown
163
+ [![cachly Brain](https://api.cachly.dev/api/v1/badge/YOUR_INSTANCE_ID)](https://cachly.dev)
164
+ ```
165
+
166
+ Drop it in your repo's README and anyone visiting sees how many lessons your AI has accumulated. The badge endpoint is public, rate-limited, and only exposes the lesson count — no topic names, no content.
167
+
168
+ ---
169
+
119
170
  ## What makes cachly different
120
171
 
121
172
  | Feature | What it does |
122
173
  |---------|-------------|
123
174
  | **`causal_trace`** | Root Cause Analysis through memory: problem → chain → solution. **No other system does this.** |
175
+ | **`brain_from_git`** | Reads your entire git history and loads every lesson before your first session. Incremental on repeat runs. |
176
+ | **`brain_predict`** | Predicts failures before they happen based on past incident patterns |
124
177
  | **`memory_consolidate`** | Weekly garbage collector — detects contradictions, merges duplicates, expires stale lessons |
125
- | **`brain_predict`** | Predicts failures before they happen based on past patterns |
126
178
  | **Team Brain** | Shared lessons across your whole team with author attribution |
127
179
  | **Ambient Git** | git hook auto-extracts lessons from every commit. Zero extra calls. |
128
180
  | **Memory Crystals** | Distills all lessons into a compact snapshot for instant session briefing |
129
181
  | **11 languages** | BM25+ search in EN, DE, FR, ES, IT, PT, ZH, JA, KO, AR, HE — no config |
130
182
 
131
- **The `causal_trace` moment:**
183
+ **`causal_trace` in action:**
132
184
  ```
133
185
  causal_trace(problem="auth breaks after restart")
134
186
 
135
187
  → Root: k8s:namespace-terminating
136
- → Via: keycloak:jwks-race
188
+ → Via: keycloak:jwks-race
137
189
  → Fix: PollUntilContextTimeout 3min ← used this March 12, worked
138
190
  ```
139
191
  *30 minutes of git blame in one call.*
140
192
 
141
- **The `autopilot` command:**
142
- Run `autopilot` once and it generates a fully self-managing `CLAUDE.md` or `copilot-instructions.md` — tailored to your actual Brain content. Every AI (Claude, Cursor, Copilot, Windsurf, Gemini) gets the full ruleset for your project. No copy-paste, no manual writing. As the Brain learns more, re-run `autopilot` to upgrade the file.
143
-
144
193
  ---
145
194
 
146
195
  ## cachly vs. alternatives
@@ -171,10 +220,10 @@ Run `autopilot` once and it generates a fully self-managing `CLAUDE.md` or `copi
171
220
  | **`learn_from_attempts`** | Store structured lessons after any fix, deploy, or discovery |
172
221
  | **`recall_best_solution`** | Best known solution for a topic — with success/failure history |
173
222
  | **`remember_context`** | Cache architecture findings, decisions, file summaries |
174
- | **`recall_context`** | Get exact context by key (supports glob) |
175
223
  | **`smart_recall`** | BM25+ full-text search across all brain data — 11 languages |
176
224
  | **`causal_trace`** | Root cause analysis through memory |
177
225
  | **`brain_predict`** | Predict likely failures before they happen |
226
+ | **`brain_from_git`** | Bootstrap from git history — incremental, only new commits each run |
178
227
  | **`memory_consolidate`** | Deduplicate and expire stale lessons |
179
228
  | **`compact_recover`** | Full context recovery after hitting context window limit |
180
229
 
@@ -187,26 +236,22 @@ Run `autopilot` once and it generates a fully self-managing `CLAUDE.md` or `copi
187
236
  | `madc_deliberate` | 6 specialist AI agents vote to resolve contradictory lessons |
188
237
  | `memory_crystalize` | Distill all lessons into a Crystal for instant team context |
189
238
  | `brain_doctor` | Health check: lesson count, IQ boost %, open failures |
190
- | `autopilot` | Generate a self-managing `CLAUDE.md` / `copilot-instructions.md` from Brain content |
239
+ | `autopilot` | Generate a self-managing `CLAUDE.md` from Brain content |
191
240
  | `global_learn` / `global_recall` | Cross-project universal lessons |
192
- | `publish_lesson` / `import_public_brain` | Share/import community knowledge |
193
241
 
194
- ### 🌍 Knowledge Commons (Global)
242
+ ### 🌍 Knowledge Commons
195
243
 
196
244
  | Tool | What it does |
197
245
  |------|-------------|
198
246
  | `syndicate` | Contribute verified lesson to global Knowledge Commons |
199
- | `syndicate_search` | Search community solutions by tech stack |
200
- | `fedbrain_contribute` | Contribute with cryptographic provenance certificate |
201
247
  | `fedbrain_search` | Context-weighted global search |
202
248
 
203
- ### ⚙️ Cache & Infrastructure
249
+ ### ⚙️ Infrastructure
204
250
 
205
251
  | Tool | What it does |
206
252
  |------|-------------|
207
253
  | `list_instances` / `create_instance` / `delete_instance` | Manage Brain instances |
208
254
  | `cache_get` / `cache_set` / `cache_delete` | Standard cache operations |
209
- | `cache_mget` / `cache_mset` | Bulk pipeline (single round-trip) |
210
255
  | `semantic_search` | Find cached entries by meaning |
211
256
  | `index_project` | Index source files for semantic retrieval |
212
257
 
@@ -224,33 +269,27 @@ Run `autopilot` once and it generates a fully self-managing `CLAUDE.md` or `copi
224
269
  **Does my AI need to call `session_start` manually?**
225
270
  No. Sessions start and end automatically on the first tool call and when the editor closes.
226
271
 
227
- **What happens to memory if I switch projects?**
228
- Memory is scoped per Brain instance. You can have one instance per project, or one shared instance across projects.
272
+ **What is incremental `brain_from_git`?**
273
+ After the first run, only new commits since the last scan are processed. Repeated calls are instant.
229
274
 
230
275
  **Can my whole team share the same Brain?**
231
- Yes. `team_learn` / `team_recall` share lessons with author attribution. `memory_crystalize` gives any new team member instant full context.
276
+ Yes. Use `team_learn` / `team_recall` or run `npx @cachly-dev/mcp-server@latest invite teammate@example.com`.
232
277
 
233
278
  **What is a Memory Crystal?**
234
- A compressed snapshot of all lessons distilled into a compact briefing. Injected at every session start so the AI arrives pre-briefed even with a cold context window.
235
-
236
- **What is causal_trace and why is it unique?**
237
- Given any error or problem, `causal_trace` walks the Causal Knowledge Graph (CKG) to find: the root cause, intermediate causes, and the exact fix that worked — including the date and commands used. No other memory system builds or queries a causal graph.
279
+ A compressed snapshot of all lessons injected at every session start. The AI arrives pre-briefed even with a cold context window.
238
280
 
239
- **How does cachly learn from git commits?**
240
- The `setup` wizard installs a git post-commit hook. After each commit, the hook calls `cls_ingest` with the commit message and changed files. The Brain extracts lessons automatically — no `session_end` required.
241
-
242
- **What happens if I hit the context window limit mid-session?**
243
- Call `compact_recover`. It reconstructs full context from the Memory Crystal + recent sessions + WIP registry entries — typically restoring full context in one tool call.
281
+ **What is `causal_trace` and why is it unique?**
282
+ Given any error, `causal_trace` walks the Causal Knowledge Graph to find: root cause, intermediate causes, and the exact fix that worked — including the date and commands used. No other memory system builds or queries a causal graph.
244
283
 
245
284
  **Is my code sent to cachly servers?**
246
- No code content is stored. cachly stores: lesson text, commit messages, session summaries, and key-value context entries. All data is on German servers, GDPR-compliant.
285
+ No code content is stored. cachly stores: lesson text, commit messages, session summaries, key-value context entries. All data on German servers, GDPR-compliant.
247
286
 
248
- **Does cachly work without an internet connection?**
249
- No — cachly is a managed cloud service. The MCP server is a thin client; the Brain runs on cachly's infrastructure.
287
+ **What if I hit the context window limit mid-session?**
288
+ Call `compact_recover`. It reconstructs full context from Memory Crystal + recent sessions + WIP registry — typically one tool call.
250
289
 
251
290
  ---
252
291
 
253
- ## Manual Setup (alternative to the wizard)
292
+ ## Manual Setup
254
293
 
255
294
  <details>
256
295
  <summary><b>Claude Code</b> (<code>~/.claude/mcp.json</code> or <code>.mcp.json</code>)</summary>
@@ -269,7 +308,7 @@ On the first tool call your AI will prompt you to sign in — takes 10 seconds.
269
308
  </details>
270
309
 
271
310
  <details>
272
- <summary><b>Cursor / Windsurf / VS Code / Copilot / Cline</b> (<code>.cursor/mcp.json</code> / <code>.mcp.json</code>)</summary>
311
+ <summary><b>Cursor / Windsurf / VS Code / Copilot / Cline</b></summary>
273
312
 
274
313
  ```json
275
314
  {
@@ -284,6 +323,23 @@ On the first tool call your AI will prompt you to sign in — takes 10 seconds.
284
323
  ```
285
324
  </details>
286
325
 
326
+ <details>
327
+ <summary><b>Zed</b> (<code>.zed/settings.json</code>)</summary>
328
+
329
+ ```json
330
+ {
331
+ "context_servers": {
332
+ "cachly": {
333
+ "command": {
334
+ "path": "npx",
335
+ "args": ["-y", "@cachly-dev/mcp-server@latest"]
336
+ }
337
+ }
338
+ }
339
+ }
340
+ ```
341
+ </details>
342
+
287
343
  ---
288
344
 
289
345
  ## Pricing
@@ -302,12 +358,10 @@ On the first tool call your AI will prompt you to sign in — takes 10 seconds.
302
358
 
303
359
  ## Environment Variables
304
360
 
305
- Set automatically by the setup wizard — only needed for manual configuration.
306
-
307
361
  | Variable | Default | Description |
308
362
  |----------|---------|-------------|
309
- | `CACHLY_JWT` | — | API token (set by wizard, or get from cachly.dev) |
310
- | `CACHLY_BRAIN_INSTANCE_ID` | — | Default instance UUID (optional if passed per-call) |
363
+ | `CACHLY_JWT` | — | API token (set by wizard automatically) |
364
+ | `CACHLY_BRAIN_INSTANCE_ID` | — | Default instance UUID (optional — auto-resolved) |
311
365
  | `CACHLY_API_URL` | `https://api.cachly.dev` | Override for self-hosted |
312
366
  | `CACHLY_NO_TELEMETRY` | unset | Set to `1` to disable anonymous usage pings |
313
367
 
@@ -315,40 +369,16 @@ Set automatically by the setup wizard — only needed for manual configuration.
315
369
 
316
370
  ## 🛠️ Ecosystem
317
371
 
318
- | Package / Extension | What it does |
319
- |---------------------|-------------|
320
- | **[`@cachly-dev/mcp-server`](https://www.npmjs.com/package/@cachly-dev/mcp-server)** | ← you are here — AI Brain for all MCP-compatible editors |
321
- | **[VS Code Extension](https://marketplace.visualstudio.com/items?itemName=cachly-dev.cachly-brain)** | See your Brain's lessons, health & tokens saved inside VS Code |
322
- | **[`@cachly-dev/init`](https://www.npmjs.com/package/@cachly-dev/init)** | One-command setup wizard — detects editors, writes configs automatically |
323
- | **[`@cachly-dev/openclaw`](https://www.npmjs.com/package/@cachly-dev/openclaw)** | Cut LLM costs 60–90% with semantic caching in JS/TS apps |
324
- | **[`@cachly-dev/cli`](https://www.npmjs.com/package/@cachly-dev/cli)** | Terminal CLI — manage Brain instances from your shell |
325
- | **[Go SDK](https://github.com/cachly-dev/sdk-go)** | Native Go client for the cachly API |
326
- | **[Python SDK](https://github.com/cachly-dev/sdk-python)** | Native Python client |
327
- | **[Java / Kotlin / .NET / Rust / PHP / Swift](https://cachly.dev/docs)** | SDKs in 11 languages |
328
-
329
- ---
330
-
331
- ## 📖 Blog & Guides
332
-
333
- - **[How to give Claude Code persistent memory](https://cachly.dev/blog/claude-code-mcp-memory)** — step-by-step
334
- - **[Windsurf persistent memory with cachly](https://cachly.dev/blog/windsurf-persistent-memory)** — full guide
335
- - **[Cline MCP memory — stop re-explaining everything](https://cachly.dev/blog/cline-mcp-memory)** — Cline setup
336
- - **[cachly vs. mem0 — full comparison](https://cachly.dev/blog)** — which is right for you
372
+ | Package | What it does |
373
+ |---------|-------------|
374
+ | **[`@cachly-dev/mcp-server`](https://www.npmjs.com/package/@cachly-dev/mcp-server)** | ← you are here |
375
+ | **[`@cachly-dev/openclaw`](https://www.npmjs.com/package/@cachly-dev/openclaw)** | Cut LLM costs 60–90% in JS/TS apps |
337
376
 
338
377
  ---
339
378
 
340
379
  ## Links
341
380
 
342
- - 🌐 [cachly.dev](https://cachly.dev?utm_source=npm&utm_medium=readme&utm_campaign=mcp-server) — Dashboard & free Brain signup
381
+ - 🌐 [cachly.dev](https://cachly.dev) — Dashboard & free signup
343
382
  - 📖 [Docs](https://cachly.dev/docs/ai-memory) — Full documentation
344
- - 🔌 [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=cachly-dev.cachly-brain) — Brain panel inside VS Code
345
383
  - 💬 [GitHub Issues](https://github.com/cachly-dev/cachly-mcp/issues) — Bug reports & feature requests
346
384
  - ⭐ [Star on GitHub](https://github.com/cachly-dev/cachly-mcp) — If cachly saves you time, a star means a lot!
347
-
348
- ---
349
-
350
- <p align="center">
351
- <a href="https://cachly.dev?utm_source=npm&utm_medium=readme&utm_campaign=mcp-bottom">
352
- <strong>→ Start free at cachly.dev — no credit card, no expiry</strong>
353
- </a>
354
- </p>
@@ -0,0 +1 @@
1
+ export {};