@llmnesia/mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Keiran Flynn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # @llmnesia/mcp
2
+
3
+ Search your own AI chat history from Claude Desktop, Claude Code, Cursor,
4
+ Codex, and other MCP clients. Covers every conversation the
5
+ [LLMnesia browser extension](https://llmnesia.com) has captured across
6
+ ChatGPT, Claude, Gemini, Character.AI, Grok, DeepSeek, and the rest of the
7
+ supported platforms.
8
+
9
+ **Everything is local.** No network calls, no cloud. The corpus lives on your
10
+ machine and the MCP server speaks [Model Context Protocol](https://modelcontextprotocol.io)
11
+ over stdio.
12
+
13
+ Requires **Node.js ≥ 22.13.0** (for the built-in `node:sqlite` module).
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npx @llmnesia/mcp install
19
+ ```
20
+
21
+ The installer:
22
+
23
+ 1. sets up the native host that bridges the browser extension to your local
24
+ corpus,
25
+ 2. copies the server into `~/.llmnesia/bin` so it has a permanent home,
26
+ 3. detects which MCP clients you have (Claude Code, Claude Desktop, Cursor,
27
+ Codex, and others), and
28
+ 4. registers that copy with each of them — after a confirm prompt and a backup
29
+ of any config file it edits.
30
+
31
+ Then **fully quit and reopen** your MCP client. Clients read their config once
32
+ at startup, so reloading a window is not enough.
33
+
34
+ ### Why it installs a copy
35
+
36
+ Registered clients get an absolute path — your `node` binary plus
37
+ `~/.llmnesia/bin/cli.js` — rather than a bare `llmnesia-mcp` command:
38
+
39
+ - `npx` unpacks packages into a temporary cache that is not on `PATH` and is
40
+ cleared by `npm cache clean`, so a command name registered from an `npx` run
41
+ stops resolving the moment it finishes.
42
+ - Desktop clients launched from the Dock or Start menu inherit a minimal
43
+ `PATH` that usually excludes nvm, Homebrew, and Volta — so even a global
44
+ install can be invisible to them.
45
+
46
+ The copy is self-contained (no `node_modules` beside it) and re-running
47
+ `install` replaces it, which is also how you upgrade.
48
+
49
+ ### Updating
50
+
51
+ ```bash
52
+ npx @llmnesia/mcp@latest install
53
+ ```
54
+
55
+ Your corpus is untouched; only the server copy is replaced.
56
+
57
+ ## The corpus comes from the extension
58
+
59
+ `@llmnesia/mcp` does not collect conversations on its own. The corpus is
60
+ populated by the [LLMnesia browser extension](https://llmnesia.com), free on
61
+ the [Chrome Web Store](https://chromewebstore.google.com/detail/llmnesia/leekfgbdojiaabifbjbbgiiclannjdkf):
62
+
63
+ 1. Install the extension and run a one-time backfill to import existing history.
64
+ 2. After that, the extension captures new conversations as you chat.
65
+ 3. It writes them to the local corpus at `~/.llmnesia/corpus/`. `@llmnesia/mcp`
66
+ reads from the same folder — there is nothing to configure.
67
+
68
+ If you have not run the extension yet, the corpus will be empty and every
69
+ search will come back empty too.
70
+
71
+ ## Tools
72
+
73
+ Once registered, your MCP client gains five tools over the corpus:
74
+
75
+ | Tool | Purpose |
76
+ | --- | --- |
77
+ | `search_conversations` | Full-text search across every past conversation. Returns ranked matches with highlighted snippets. Supports `platform`, `title`, `date_from`/`date_to` filters and a `match_mode` (`any` / `all` / `phrase`) for when a wrong hit matters. |
78
+ | `get_conversation` | Fetch the full transcript of one conversation by its id (the `id` field from search results). |
79
+ | `list_recent` | List the most recently updated conversations with title, summary, and platform. |
80
+ | `corpus_status` | Report when the corpus last received data and how many conversations it holds. Use this when an expected conversation cannot be found, to tell a genuinely missing chat apart from a corpus that has stopped receiving updates. |
81
+ | `save_conversation` | Add or update a conversation in the corpus, so MCP is also an ingestion route. |
82
+
83
+ Search and list results carry a `corpus` block saying when the corpus last
84
+ received data — check it before concluding a chat does not exist.
85
+
86
+ ## Supported clients
87
+
88
+ | Client | How `install` wires it |
89
+ | --- | --- |
90
+ | Claude Code | Runs `claude mcp add` with the absolute Node and installed runtime paths (detects `claude` on PATH). |
91
+ | Claude Desktop | Edits `claude_desktop_config.json` at the standard OS-specific path. |
92
+ | Cursor | Edits `~/.cursor/mcp.json`. |
93
+ | Codex | Prints a TOML block for `~/.codex/config.toml` (auto-edit is too fragile). |
94
+ | Others (Windsurf, Zed, LM Studio, …) | Prints the generic stdio block for you to paste. |
95
+
96
+ **Cloud-only clients cannot reach a local stdio server** (web ChatGPT, Lovable,
97
+ and similar). That is architectural, not a packaging gap — a future relay may
98
+ close it.
99
+
100
+ ## Diagnose an install
101
+
102
+ ```bash
103
+ npx @llmnesia/mcp doctor
104
+ ```
105
+
106
+ Checks whether the native host is installed, the server runtime is present, the
107
+ corpus is receiving data, and each detected client is correctly wired —
108
+ including whether the command each client is registered with can actually be
109
+ executed, which is the usual cause of a server that silently never starts.
110
+
111
+ Exit code 0 means no check is failing; some checks are warnings that are
112
+ correct on a healthy machine (a client you don't use, the un-checkable restart
113
+ reminder).
114
+
115
+ ## Uninstall
116
+
117
+ ```bash
118
+ npx @llmnesia/mcp uninstall
119
+ ```
120
+
121
+ Removes native-host manifests and registry keys, the copied server in
122
+ `~/.llmnesia/bin`, and client registrations. The shared config file and your
123
+ conversation corpus are **not** deleted — `uninstall` prints the corpus path
124
+ and the `rm -rf` command if you want to remove the data yourself.
125
+
126
+ ## CLI reference
127
+
128
+ The bin exposes the subcommands above plus power-user verbs for working
129
+ directly with the corpus:
130
+
131
+ ```
132
+ llmnesia-mcp install # native host + client registration
133
+ llmnesia-mcp serve # the MCP stdio server clients spawn
134
+ llmnesia-mcp doctor # diagnose the install
135
+ llmnesia-mcp uninstall # remove manifests, config, client entries
136
+ llmnesia-mcp init # create an empty corpus
137
+ llmnesia-mcp ingest <…> # ingest an NDJSON backup file
138
+ llmnesia-mcp drain # ingest everything in <corpus>/inbox
139
+ llmnesia-mcp watch # ingest new inbox deltas live (Ctrl+C to stop)
140
+ llmnesia-mcp stats # corpus summary
141
+ llmnesia-mcp reindex # drop + rebuild the search index from the corpus
142
+ llmnesia-mcp search <q> # one-shot search from the terminal
143
+ llmnesia-mcp --version # print the installed version
144
+ ```
145
+
146
+ ## Support
147
+
148
+ Questions and bug reports: [llmnesia.com/mcp](https://llmnesia.com/mcp) or
149
+ hello@llmnesia.com.
150
+
151
+ ## License
152
+
153
+ MIT — see [LICENSE](./LICENSE).
@@ -0,0 +1,205 @@
1
+ @llmnesia/mcp includes portions of the following third-party software.
2
+
3
+ -------------------------------------------------------------------------------
4
+ @modelcontextprotocol/sdk
5
+
6
+ MIT License
7
+
8
+ Copyright (c) 2024 Anthropic, PBC
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ -------------------------------------------------------------------------------
29
+ zod
30
+
31
+ MIT License
32
+
33
+ Copyright (c) 2025 Colin McDonnell
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining a copy
36
+ of this software and associated documentation files (the "Software"), to deal
37
+ in the Software without restriction, including without limitation the rights
38
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39
+ copies of the Software, and to permit persons to whom the Software is
40
+ furnished to do so, subject to the following conditions:
41
+
42
+ The above copyright notice and this permission notice shall be included in all
43
+ copies or substantial portions of the Software.
44
+
45
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
51
+ SOFTWARE.
52
+
53
+ -------------------------------------------------------------------------------
54
+ ajv and ajv-formats
55
+
56
+ The MIT License (MIT)
57
+
58
+ Copyright (c) 2015-2021 Evgeny Poberezkin (ajv)
59
+ Copyright (c) 2020 Evgeny Poberezkin (ajv-formats)
60
+
61
+ Permission is hereby granted, free of charge, to any person obtaining a copy
62
+ of this software and associated documentation files (the "Software"), to deal
63
+ in the Software without restriction, including without limitation the rights
64
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
65
+ copies of the Software, and to permit persons to whom the Software is
66
+ furnished to do so, subject to the following conditions:
67
+
68
+ The above copyright notice and this permission notice shall be included in all
69
+ copies or substantial portions of the Software.
70
+
71
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
72
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
73
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
74
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
75
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
76
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
77
+ SOFTWARE.
78
+
79
+ -------------------------------------------------------------------------------
80
+ fast-uri
81
+
82
+ Copyright (c) 2011-2021, Gary Court until
83
+ https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
84
+ Copyright (c) 2021-present The Fastify team
85
+ <https://github.com/fastify/fastify#team>
86
+ All rights reserved.
87
+
88
+ Redistribution and use in source and binary forms, with or without
89
+ modification, are permitted provided that the following conditions are met:
90
+ * Redistributions of source code must retain the above copyright
91
+ notice, this list of conditions and the following disclaimer.
92
+ * Redistributions in binary form must reproduce the above copyright
93
+ notice, this list of conditions and the following disclaimer in the
94
+ documentation and/or other materials provided with the distribution.
95
+ * The names of any contributors may not be used to endorse or promote
96
+ products derived from this software without specific prior written
97
+ permission.
98
+
99
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
100
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
101
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
102
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
103
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
104
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
105
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
106
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
107
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
108
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
109
+
110
+ The complete list of contributors can be found at:
111
+ https://github.com/garycourt/uri-js/graphs/contributors
112
+
113
+ -------------------------------------------------------------------------------
114
+ chokidar
115
+
116
+ The MIT License (MIT)
117
+
118
+ Copyright (c) 2012 Paul Miller (https://paulmillr.com), Elan Shanker
119
+
120
+ Permission is hereby granted, free of charge, to any person obtaining a copy
121
+ of this software and associated documentation files (the “Software”), to deal
122
+ in the Software without restriction, including without limitation the rights
123
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
124
+ copies of the Software, and to permit persons to whom the Software is
125
+ furnished to do so, subject to the following conditions:
126
+
127
+ The above copyright notice and this permission notice shall be included in
128
+ all copies or substantial portions of the Software.
129
+
130
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
131
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
132
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
133
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
134
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
135
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
136
+ THE SOFTWARE.
137
+
138
+ -------------------------------------------------------------------------------
139
+ readdirp
140
+
141
+ MIT License
142
+
143
+ Copyright (c) 2012-2019 Thorsten Lorenz, Paul Miller (https://paulmillr.com)
144
+
145
+ Permission is hereby granted, free of charge, to any person obtaining a copy
146
+ of this software and associated documentation files (the "Software"), to deal
147
+ in the Software without restriction, including without limitation the rights
148
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
149
+ copies of the Software, and to permit persons to whom the Software is
150
+ furnished to do so, subject to the following conditions:
151
+
152
+ The above copyright notice and this permission notice shall be included in all
153
+ copies or substantial portions of the Software.
154
+
155
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
156
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
157
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
158
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
159
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
160
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
161
+ SOFTWARE.
162
+
163
+ -------------------------------------------------------------------------------
164
+ fast-deep-equal and json-schema-traverse
165
+
166
+ MIT License
167
+
168
+ Copyright (c) 2017 Evgeny Poberezkin
169
+
170
+ Permission is hereby granted, free of charge, to any person obtaining a copy
171
+ of this software and associated documentation files (the "Software"), to deal
172
+ in the Software without restriction, including without limitation the rights
173
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
174
+ copies of the Software, and to permit persons to whom the Software is
175
+ furnished to do so, subject to the following conditions:
176
+
177
+ The above copyright notice and this permission notice shall be included in all
178
+ copies or substantial portions of the Software.
179
+
180
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
181
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
182
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
183
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
184
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
185
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
186
+ SOFTWARE.
187
+
188
+ -------------------------------------------------------------------------------
189
+ zod-to-json-schema
190
+
191
+ ISC License
192
+
193
+ Copyright (c) 2020, Stefan Terdell
194
+
195
+ Permission to use, copy, modify, and/or distribute this software for any
196
+ purpose with or without fee is hereby granted, provided that the above
197
+ copyright notice and this permission notice appear in all copies.
198
+
199
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
200
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
201
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
202
+ SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
203
+ RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
204
+ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE
205
+ USE OR PERFORMANCE OF THIS SOFTWARE.