klypix-mcp 1.25.0 → 1.29.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.
- package/FORMAT.md +1 -1
- package/LICENSE +202 -21
- package/README.md +71 -81
- package/bin/klypix-mcp.mjs +14 -1
- package/package.json +4 -4
- package/src/global-brain-hook.mjs +200 -2
- package/src/klypix-core.mjs +30 -0
- package/src/klypix-format.mjs +863 -225
package/FORMAT.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
`.klypix` is an **open, local-first, agent-neutral** canvas file. It's a plain
|
|
4
4
|
**ZIP** of JSON + assets — no proprietary binary, fully inspectable (`unzip
|
|
5
|
-
your.klypix`), and parseable with the
|
|
5
|
+
your.klypix`), and parseable with the Apache-2.0 library in this package. You own it;
|
|
6
6
|
any agent or app can read and write it.
|
|
7
7
|
|
|
8
8
|
## Container layout
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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,35 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Every project gets a brain.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### Not a *second* brain. A **shared** one.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
messy project at once. `klypix-mcp` fixes that with a single portable file:
|
|
5
|
+
You've seen the setup: point an AI at a folder of notes, watch the graph fill up, call it a brain. Look closer — **the human never touches anything.** Even the pattern's inventor says it: *"you never write the wiki yourself… I browse the results in real time."* The human is a reader. The AI is the sole writer. That's not a brain — that's an aquarium.
|
|
7
6
|
|
|
8
|
-
-
|
|
9
|
-
screenshots, audio, code, links — arranged and connected on an infinite canvas.
|
|
10
|
-
- This package is an **MCP server**: any MCP-capable agent (Claude Desktop,
|
|
11
|
-
Cursor, Cline, …) can **list, read, search, create, and append** to your
|
|
12
|
-
`.klypix` canvases — so your agent gets durable, multimodal, *spatial* memory.
|
|
13
|
-
- **Local-first + agent-neutral.** The file lives on *your* disk. No lab is in
|
|
14
|
-
the loop — read it with Claude today, GPT tomorrow, a local model next week.
|
|
15
|
-
No vendor can take it away.
|
|
7
|
+
**`klypix-mcp` gives your project a brain you're allowed inside while it works.** One file — `brain.klypix` — in your repo, versioned with git, that your AI agents read, write, and argue from. And in the [KLYPIX app](https://klypix.com), you work *in* it while they do: your cursor typing in one card while agent decisions land beside your hands, each in its area, with an arrow explaining why — and the save refuses to write a file that lost a card.
|
|
16
8
|
|
|
17
|
-
>
|
|
18
|
-
> between agents; MCP connects an agent to its tools; **`.klypix` is the owned,
|
|
19
|
-
> multimodal context both layers read and write.** KLYPIX ships *two* faces over
|
|
20
|
-
> one engine — an **MCP server** (`klypix-mcp`) and an **A2A agent**
|
|
21
|
-
> (`klypix-a2a`) — so whichever protocol your stack speaks, the memory node is
|
|
22
|
-
> the same portable file you own. See **[A2A.md](A2A.md)**.
|
|
9
|
+
> *Their AI keeps a diary about your project. Ours works in the same room as you — and the room remembers.*
|
|
23
10
|
|
|
24
|
-
## Quick start
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
**Claude Code (native — live hooks, zero effort):**
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx klypix-mcp install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Every repo on your machine with a `brain.klypix` now auto-briefs each session with the project's state and auto-captures decisions as you work. Give a project a brain by dropping a `brain.klypix` in it — the [KLYPIX app](https://klypix.com) does it in one click (*Save canvas as project brain*), or `create_canvas` makes one from any agent.
|
|
20
|
+
|
|
21
|
+
**Every other agent tool (one command per project):**
|
|
25
22
|
|
|
26
23
|
```bash
|
|
27
|
-
|
|
28
|
-
npx klypix-mcp --vault ./canvases
|
|
24
|
+
npx klypix-mcp link
|
|
29
25
|
```
|
|
30
26
|
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
Extends the brain to Cursor & VS Code/Copilot (MCP config + rules) and to Cline, Windsurf, Gemini CLI, Aider, and any AGENTS.md-reading agent — always-on rules that teach the tool to read and capture the brain.
|
|
28
|
+
|
|
29
|
+
## What a project brain does
|
|
30
|
+
|
|
31
|
+
The difference from a folder of notes is not the shape — it's that this memory is a **mechanism, not a filing convention**:
|
|
32
|
+
|
|
33
|
+
- **It briefs every session.** Each agent session starts already knowing the project's decisions, open questions, and standing rules — a compact brief (≈3–5k tokens even at 600+ cards, growing sublinearly). Measured on our own brain: **73% of past decisions recovered with one search round (55% brief-only) vs 0% cold** (n=20).
|
|
34
|
+
- **It argues back.** `brain_challenge`: propose a decision and the brain answers with receipts — *"you reversed this on June 12; here's the correction — captured by a different agent, coordinate before overriding."* Deterministic evidence only (correction-cues, opposite-polarity), never mere topical similarity. A memory that can't disagree with you is flattery.
|
|
35
|
+
- **It knows when it's stale.** Decision cards can anchor to the exact code they were decided against (git blob OID). When that code moves on, the card raises its hand in the next brief. Their notes rot silently; ours confess.
|
|
36
|
+
- **It answers from the past.** `brain_ask` with `as_of: 2026-03-01` answers what the project believed *then* — corrections from the future never leak backwards.
|
|
37
|
+
- **Position means something.** Drag a card into the 📌 Focus area and it leads every future session's brief. Layout is instruction, not decoration.
|
|
38
|
+
- **Many agents, no chaos.** Concurrent sessions take a capture lock (zero captures lost, tested at four simultaneous writers), tag *who* wrote each card, message each other through the brain (`brain_message`), and genuine contradictions surface as red arrows for a human to arbitrate — never auto-resolved.
|
|
39
|
+
- **Retrieval that's measured, failures included.** Hybrid on-device search (semantic + lexical + cross-encoder rerank, no cloud): recall@5 of the true source card went **5% → 15% → 40%** across our upgrades (n=20 frozen human-paraphrase questions) — and the experiment that *regressed* (contextual prefixes on short cards) is recorded next to the wins.
|
|
40
|
+
|
|
41
|
+
## One file you can hold
|
|
42
|
+
|
|
43
|
+
The whole brain — layout, decisions, arrows, **and the actual bytes** (images, PDFs, audio, code) — is a single `.klypix` file. Email it. Git it. Hand it to an agent. A folder of markdown points at its attachments; this file *carries* them.
|
|
44
|
+
|
|
45
|
+
And it's not a cage: everything **exports to Markdown and JSON Canvas** in one command, and **Obsidian `.canvas` files open directly** in KLYPIX. Plain markdown is the most portable text on earth — that's exactly why we export to it. Full spec: [FORMAT.md](FORMAT.md).
|
|
46
|
+
|
|
47
|
+
**"Project" means any project.** Two showcase brains ship in [`examples/`](examples/), identical in engine, different in life: [`showcase-brain.klypix`](examples/showcase-brain.klypix) is *Aurora*, a fictional weather app mid-build (radar tiles, API caps, a correction with its receipt) — and [`showcase-wedding.klypix`](examples/showcase-wedding.klypix) is *Our Wedding* (venue, vendors, guest list, the same correction machinery pointed at a caterer). Same 📌 Focus, same arrows, same brief. If it has decisions worth keeping, it gets a brain.
|
|
48
|
+
|
|
49
|
+
## Setup for plain MCP clients
|
|
50
|
+
|
|
51
|
+
Any MCP client gets the tools without the hooks. For **Claude Desktop**, in `claude_desktop_config.json`:
|
|
33
52
|
|
|
34
53
|
```json
|
|
35
54
|
{
|
|
@@ -42,71 +61,45 @@ Then add it to your MCP client. For **Claude Desktop**, in
|
|
|
42
61
|
}
|
|
43
62
|
```
|
|
44
63
|
|
|
45
|
-
|
|
46
|
-
notes into a board,"* or *"add a card with the decision we just made."*
|
|
64
|
+
Then ask your agent things like *"what did we decide about auth?"*, *"challenge this: let's switch to polling"*, or *"turn these notes into a board."*
|
|
47
65
|
|
|
48
|
-
##
|
|
66
|
+
## The 16 verbs
|
|
49
67
|
|
|
50
68
|
| Tool | What it does |
|
|
51
69
|
|---|---|
|
|
52
|
-
| `
|
|
53
|
-
| `
|
|
70
|
+
| `brain_ask` | Whole-brain question answering — correction-aware, `as_of` time-travel |
|
|
71
|
+
| `brain_challenge` | The brain argues back: contradictions with receipts, tried-and-reversed chains, standing rules, other-agent provenance flags |
|
|
72
|
+
| `brain_note` | Capture with the full lifecycle — supersede / ✓ resolve / ~ update / 🛠 skill / closes: |
|
|
73
|
+
| `brain_reconcile` | Find stale-vs-correction pairs + unrecorded migrations |
|
|
74
|
+
| `brain_insights` | Hubs, orphaned decisions, stale questions, area sizes |
|
|
75
|
+
| `brain_garden` | Maintenance pass over the brain |
|
|
76
|
+
| `brain_doctor` | Self-diagnosis: version alignment, hooks wired, projection drift |
|
|
77
|
+
| `brain_message` | Session-to-session coordination notes |
|
|
78
|
+
| `brain_connect` | Find + draw related-but-unlinked cards |
|
|
79
|
+
| `canvas_view` | The board as an MCP App — Apps-capable chats get an interactive spatial view; everyone else gets clean text |
|
|
80
|
+
| `read_canvas` | A canvas as markdown (cards, connection graph, `[[links]]`, `#tags`) |
|
|
54
81
|
| `search_canvases` | Search across canvases by name + content |
|
|
55
82
|
| `search_all_brains` | Cross-project memory search across every registered brain |
|
|
56
|
-
| `
|
|
57
|
-
| `
|
|
58
|
-
| `
|
|
59
|
-
| `create_canvas` | Create a new `.klypix` from cards + connections |
|
|
60
|
-
| `add_to_canvas` | Append cards/connections to an existing canvas (positions preserved) |
|
|
83
|
+
| `create_canvas` | New `.klypix` from cards + connections |
|
|
84
|
+
| `add_to_canvas` | Append cards/connections (positions preserved) |
|
|
85
|
+
| `list_canvases` | List every `.klypix` in the vault |
|
|
61
86
|
|
|
62
87
|
### Tools vs. the *automatic* brain
|
|
63
88
|
|
|
64
|
-
This package is the **agent-neutral read/write surface** — any MCP client (Claude
|
|
65
|
-
Code, Claude Desktop, Cursor, Cline, Windsurf…) gets the **tools** above and can
|
|
66
|
-
read, search, and write canvases on demand (*pull*). That works in any agent, in
|
|
67
|
-
any project.
|
|
68
|
-
|
|
69
|
-
The **automatic** brain — auto-capturing decisions from your work, injecting the
|
|
70
|
-
relevant cards into each prompt, and coordinating across concurrent sessions
|
|
71
|
-
(*push*) — runs in a host **hook**, which is a Claude Code / KLYPIX-desktop
|
|
72
|
-
feature, not part of this npm package. So `npx klypix-mcp` gives you the tools
|
|
73
|
-
everywhere; the hands-free brain comes with the [KLYPIX desktop app](https://klypix.com)
|
|
74
|
-
or the Claude Code project-brain hook. (`search_all_brains` is also hook-fed — it
|
|
75
|
-
reads the cross-project registry the hook writes, so it stays empty until a hook
|
|
76
|
-
has registered at least one brain.)
|
|
89
|
+
This package is the **agent-neutral read/write surface** — any MCP client gets the tools above on demand (*pull*), in any project. The **automatic** brain — auto-capturing decisions from your work, injecting the brief into each session, coordinating concurrent sessions (*push*) — runs in a host **hook**, which `npx klypix-mcp install` wires for Claude Code (and the [KLYPIX desktop app](https://klypix.com) ships built-in). Other tools get the always-on rules via `link`.
|
|
77
90
|
|
|
78
91
|
### Updates — the propagation contract
|
|
79
92
|
|
|
80
|
-
`
|
|
81
|
-
into `~/.claude/project-brain`, and the emitted MCP config runs the server **from
|
|
82
|
-
that installed bundle** (no npx cache to go stale). From then on updates are
|
|
83
|
-
automatic: at session start the hook checks npm (≤ once/24h, fail-open, disable
|
|
84
|
-
with `KLYPIX_AUTO_UPDATE=0`) and self-installs a newer release, so a publish
|
|
85
|
-
reaches every machine by its **next session**.
|
|
86
|
-
|
|
87
|
-
One honest caveat: a running stdio MCP server can't hot-swap, and **resuming a
|
|
88
|
-
session (or opening a new chat in the same app) does not respawn it** — only a
|
|
89
|
-
full app quit + reopen (or `/mcp` reconnect after the old process exits) starts
|
|
90
|
-
the new binary. `brain_doctor` tells you when that's needed: its RUNNING line
|
|
91
|
-
compares the *live server's* self-reported version against the installed bundle
|
|
92
|
-
and npm, and reads `DRIFTED → /mcp reconnect` instead of pretending a stale
|
|
93
|
-
server is current.
|
|
93
|
+
`install` lays the whole brain (hooks + engine + local MCP server) into `~/.claude/project-brain`, and the emitted config runs the server **from that installed bundle** (no npx cache to go stale). Updates are then automatic: at session start the hook checks npm (≤ once/24h, fail-open, disable with `KLYPIX_AUTO_UPDATE=0`) and self-installs newer releases. One honest caveat: a running stdio server can't hot-swap — a new binary loads on the next full app launch (or `/mcp` reconnect); `brain_doctor`'s RUNNING line tells you when that's needed.
|
|
94
94
|
|
|
95
95
|
## Also speaks A2A (Agent-to-Agent)
|
|
96
96
|
|
|
97
|
-
The same engine is exposed as an **A2A agent** so other agents and orchestrators
|
|
98
|
-
can delegate memory tasks to KLYPIX as a discoverable peer:
|
|
99
|
-
|
|
100
97
|
```bash
|
|
101
98
|
npx -p klypix-mcp klypix-a2a --vault ./canvases # 127.0.0.1:41241
|
|
102
99
|
# Agent Card: http://127.0.0.1:41241/.well-known/agent-card.json
|
|
103
100
|
```
|
|
104
101
|
|
|
105
|
-
Skills: `make_board`, `remember`, `recall`, `read_canvas`, `list_canvases`,
|
|
106
|
-
`brain_insights`, `search_all_brains`. Unlike a typical A2A agent that returns
|
|
107
|
-
text, KLYPIX returns the **`.klypix` board itself** as a multimodal artifact.
|
|
108
|
-
Full protocol details (JSON-RPC methods, message shapes, streaming) in
|
|
109
|
-
**[A2A.md](A2A.md)**.
|
|
102
|
+
Skills: `make_board`, `remember`, `recall`, `read_canvas`, `list_canvases`, `brain_insights`, `search_all_brains`. Unlike a typical A2A agent that returns text, KLYPIX returns the **`.klypix` board itself** as a multimodal artifact. Details: [A2A.md](A2A.md).
|
|
110
103
|
|
|
111
104
|
## Use it as a library
|
|
112
105
|
|
|
@@ -114,27 +107,24 @@ Full protocol details (JSON-RPC methods, message shapes, streaming) in
|
|
|
114
107
|
import { parseKlypix, buildKlypix, appendToKlypix, structToMarkdown } from 'klypix-mcp';
|
|
115
108
|
```
|
|
116
109
|
|
|
117
|
-
…or read/write from the shell:
|
|
118
|
-
|
|
119
110
|
```bash
|
|
120
111
|
npx -p klypix-mcp klypix-read path/to/board.klypix # → markdown brief
|
|
121
112
|
echo '{ "title": "Plan", "cards": [{ "text": "kickoff" }] }' \
|
|
122
113
|
| npx -p klypix-mcp klypix-write --out plan.klypix
|
|
123
114
|
```
|
|
124
115
|
|
|
125
|
-
## The
|
|
116
|
+
## The workspace it opens in
|
|
117
|
+
|
|
118
|
+
The brain is open and free — this package, the hooks, the format. **[KLYPIX](https://klypix.com)** is the Windows app built around it: see the brain as a living spatial map, work inside it while your agents write, capture anything from anywhere, act with agents, share encrypted. Bilingual English/Arabic.
|
|
119
|
+
|
|
120
|
+
## Honesty notes
|
|
126
121
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
122
|
+
- Dogfooded hard: **KLYPIX itself is built with its own brain** — 600+ cards, multiple concurrent agent sessions, receipts in the file.
|
|
123
|
+
- All engine intelligence is deterministic and local — the only LLM anywhere is *your* agent. No telemetry, no cloud calls, works offline.
|
|
124
|
+
- Every number above is measured on our own project brain; the eval harness ships in the repo.
|
|
130
125
|
|
|
131
126
|
## Why this exists
|
|
132
127
|
|
|
133
|
-
Frontier labs are racing to put your context inside *their*
|
|
134
|
-
motel your work checks into and never leaves for a competitor. `klypix-mcp` is
|
|
135
|
-
the opposite: **your project, your file, any model, offline.** That's the one
|
|
136
|
-
thing a lab is structurally disincentivized to build.
|
|
128
|
+
Frontier labs are racing to put your context inside *their* memory — a roach motel your work checks into and never leaves for a competitor. `klypix-mcp` is the opposite: **your project, your file, any model, offline.** A brain that any agent reads and writes is the one thing a lab is structurally disincentivized to build.
|
|
137
129
|
|
|
138
|
-
|
|
139
|
-
app is the spatial editor for these files — but the file and this server are
|
|
140
|
-
fully open and work without it.
|
|
130
|
+
Apache-2.0 © [Dahshan Labs](https://klypix.com). The KLYPIX desktop app is a separate, proprietary product — the file and this server are fully open and work without it.
|
package/bin/klypix-mcp.mjs
CHANGED
|
@@ -26,7 +26,7 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
26
26
|
import {
|
|
27
27
|
resolveVault, getEmbedder, buildKlypixMap, cardSchema, connSchema,
|
|
28
28
|
opListCanvases, opReadCanvas, opSearchCanvases, opSearchAllBrains,
|
|
29
|
-
opBrainInsights, opBrainConnect, opBrainReconcile, opBrainGarden, opCreateCanvas, opAddToCanvas, opBrainNote, opBrainMessage, opBrainAsk, opBrainChallenge, opCanvasView,
|
|
29
|
+
opBrainInsights, opBrainConnect, opBrainReconcile, opBrainGarden, opCreateCanvas, opAddToCanvas, opBrainNote, opBrainMessage, opBrainAsk, opBrainChallenge, opCanvasView, opBrainLens,
|
|
30
30
|
} from '../src/klypix-core.mjs';
|
|
31
31
|
import { mcpServerEntry } from '../src/agent-rules.mjs';
|
|
32
32
|
|
|
@@ -63,6 +63,7 @@ if (process.argv[2] === 'init') {
|
|
|
63
63
|
if (fs.existsSync(target)) { console.error(`brain.klypix already exists in ${process.cwd()} — not overwriting.`); process.exit(0); }
|
|
64
64
|
const buf = await buildKlypixMap({
|
|
65
65
|
title: 'project brain',
|
|
66
|
+
kind: 'brain', // explicit flag — co-owned merge semantics survive a rename
|
|
66
67
|
areas: [
|
|
67
68
|
{ title: 'Goal', cards: [{ text: '❓ What is this project for, and for whom?\nAgent: survey the repo on your first session and replace this with the real goal.' }] },
|
|
68
69
|
{ title: 'Architecture', cards: [{ text: '❓ Key components and how they fit.\nAgent: record the actual shape from the repo — only what a new session must know.' }] },
|
|
@@ -152,6 +153,18 @@ server.registerTool('brain_insights', {
|
|
|
152
153
|
},
|
|
153
154
|
}, async ({ canvas, staleDays }) => toContent(await opBrainInsights({ vault: VAULT, canvas, staleDays })));
|
|
154
155
|
|
|
156
|
+
server.registerTool('brain_lens', {
|
|
157
|
+
title: 'Brain lens — machine-readable views of a brain (freshness · provenance · activity · timeline · orrery · unresolved)',
|
|
158
|
+
description: 'The data twin of the desktop app\'s Brain Lenses: ONE structured payload any surface (agent, web viewer, iOS) can render. Views: freshness (age buckets + stale open ❓), provenance (who wrote the brain, by channel: you/claude/cursor/git/gardener/…), activity (last 7 days), timeline (birth-order events — the Replay spine; events included only for view:"timeline"), orrery (focus+context neighborhood of one card: 1/2/3-hop ring-capped nodes + typed edges — pass root as a card title prefix or id, defaults to the most-connected hub), unresolved (open-❓ triage, oldest first, with typed evidence). Read-only by construction — it never writes. Use it to answer "what\'s rotting / who wrote this / what happened this week / what\'s around X / what\'s undecided" with receipts, or to feed a UI.',
|
|
159
|
+
inputSchema: {
|
|
160
|
+
canvas: z.string().optional().describe('Canvas filename/path. Defaults to the project brain ("brain").'),
|
|
161
|
+
view: z.enum(['all', 'freshness', 'provenance', 'activity', 'timeline', 'orrery', 'unresolved']).optional().describe('Which lens to compute (default "all" — every section, timeline events omitted from structured output unless view is "timeline").'),
|
|
162
|
+
root: z.string().optional().describe('Orrery center: a card title prefix or id. Default: the most-connected hub card.'),
|
|
163
|
+
staleDays: z.number().optional().describe('Open questions older than this count as stale (default 21).'),
|
|
164
|
+
limit: z.number().optional().describe('Cap for recent-activity entries (default 30).'),
|
|
165
|
+
},
|
|
166
|
+
}, async ({ canvas, view, root, staleDays, limit }) => toContent(await opBrainLens({ vault: VAULT, canvas, view, root, staleDays, limit })));
|
|
167
|
+
|
|
155
168
|
server.registerTool('brain_connect', {
|
|
156
169
|
title: 'Connect related-but-unlinked brain cards (densify the graph)',
|
|
157
170
|
description: 'Finds genuinely related cards that AREN\'T linked yet and proposes connections — semantic similarity when the on-device model is installed, else shared tags + [[mentions]]. Dry-run by default (review the suggestions); pass apply:true to draw them (ADDITIVE — never deletes; the human can remove any arrow). Use after brain_insights flags many orphans, to turn a flat list into a real knowledge graph. To DISMISS a brain_reconcile false-positive contradiction, pass pairs:[{fromId,toId}] (the ids are in the reconcile output) with relationship:"not_contradiction" — a persisted dismissal that stops that pair ever resurfacing as a candidate.',
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "klypix-mcp",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.29.0",
|
|
4
|
+
"description": "Every project gets a brain — one open .klypix file your AI agents read, write, and argue from, over MCP. Works with Claude, Cursor, Cline, any model.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"mcp",
|
|
9
9
|
"model-context-protocol",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"node": ">=18"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
|
-
"test": "node test/brain-doctor.mjs && node test/version-currency.mjs && node test/ship-capture.mjs && node test/lane-message.mjs && node test/brain-quality.mjs && node test/brief-and-recall.mjs && node test/layout-cluster.mjs && node test/brain-ask.mjs && node test/field-report-2026-07-04.mjs && node test/autoprop.mjs && node test/overlay-recency-2026-07-12.mjs && node test/brain-challenge.mjs && node test/canvas-view.mjs"
|
|
56
|
+
"test": "node test/brain-doctor.mjs && node test/version-currency.mjs && node test/ship-capture.mjs && node test/lane-message.mjs && node test/brain-quality.mjs && node test/brief-and-recall.mjs && node test/layout-cluster.mjs && node test/brain-ask.mjs && node test/field-report-2026-07-04.mjs && node test/autoprop.mjs && node test/overlay-recency-2026-07-12.mjs && node test/brain-challenge.mjs && node test/brain-lens.mjs && node test/brain-kind.mjs && node test/rule-drafts.mjs && node test/canvas-view.mjs"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@modelcontextprotocol/ext-apps": "^1.7.4",
|