purecontext-mcp 1.5.2 → 1.11.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/AGENT_INSTRUCTIONS.md +18 -10
- package/AGENT_REFERENCE.md +684 -561
- package/CHANGELOG.md +567 -445
- package/CODE-HISTORY.md +29 -1
- package/FRAMEWORK-ADAPTERS.md +368 -351
- package/FULL-INSTALLATION-GUIDE.md +351 -341
- package/README.md +411 -339
- package/REFACTORING-SAFELY.md +338 -279
- package/SAFE-CHANGES.md +208 -156
- package/USER-GUIDE.md +3 -1
- package/WHY-PURECONTEXT.md +103 -73
- package/WORKFLOW-PR-REVIEW.md +245 -199
- package/dist/adapters/astro-preprocessor.d.ts +25 -0
- package/dist/adapters/astro-preprocessor.d.ts.map +1 -0
- package/dist/adapters/astro-preprocessor.js +50 -0
- package/dist/adapters/astro-preprocessor.js.map +1 -0
- package/dist/adapters/astro.d.ts +13 -0
- package/dist/adapters/astro.d.ts.map +1 -0
- package/dist/adapters/astro.js +83 -0
- package/dist/adapters/astro.js.map +1 -0
- package/dist/adapters/detect-utils.d.ts +38 -0
- package/dist/adapters/detect-utils.d.ts.map +1 -0
- package/dist/adapters/detect-utils.js +95 -0
- package/dist/adapters/detect-utils.js.map +1 -0
- package/dist/adapters/nuxt.d.ts +20 -0
- package/dist/adapters/nuxt.d.ts.map +1 -1
- package/dist/adapters/nuxt.js +128 -13
- package/dist/adapters/nuxt.js.map +1 -1
- package/dist/adapters/svelte-preprocessor.d.ts +29 -0
- package/dist/adapters/svelte-preprocessor.d.ts.map +1 -0
- package/dist/adapters/svelte-preprocessor.js +83 -0
- package/dist/adapters/svelte-preprocessor.js.map +1 -0
- package/dist/adapters/svelte.d.ts +13 -0
- package/dist/adapters/svelte.d.ts.map +1 -0
- package/dist/adapters/svelte.js +96 -0
- package/dist/adapters/svelte.js.map +1 -0
- package/dist/adapters/vue.d.ts.map +1 -1
- package/dist/adapters/vue.js +87 -20
- package/dist/adapters/vue.js.map +1 -1
- package/dist/bin.d.ts +16 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +21 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli/hooks.d.ts +2 -2
- package/dist/cli/hooks.d.ts.map +1 -1
- package/dist/cli/hooks.js +123 -135
- package/dist/cli/hooks.js.map +1 -1
- package/dist/cli/install-writers.d.ts.map +1 -1
- package/dist/cli/install-writers.js +281 -36
- package/dist/cli/install-writers.js.map +1 -1
- package/dist/cli/resolve-node.d.ts +53 -0
- package/dist/cli/resolve-node.d.ts.map +1 -0
- package/dist/cli/resolve-node.js +84 -0
- package/dist/cli/resolve-node.js.map +1 -0
- package/dist/config/config-loader.js +24 -0
- package/dist/config/config-loader.js.map +1 -1
- package/dist/config/config-schema.d.ts +71 -0
- package/dist/config/config-schema.d.ts.map +1 -1
- package/dist/config/config-schema.js +102 -0
- package/dist/config/config-schema.js.map +1 -1
- package/dist/core/db/api-keys.d.ts +1 -1
- package/dist/core/db/api-keys.d.ts.map +1 -1
- package/dist/core/db/api-keys.js +39 -39
- package/dist/core/db/api-keys.js.map +1 -1
- package/dist/core/db/co-change-store.d.ts +34 -0
- package/dist/core/db/co-change-store.d.ts.map +1 -0
- package/dist/core/db/co-change-store.js +78 -0
- package/dist/core/db/co-change-store.js.map +1 -0
- package/dist/core/db/schema.d.ts +3 -3
- package/dist/core/db/schema.d.ts.map +1 -1
- package/dist/core/db/schema.js +12 -30
- package/dist/core/db/schema.js.map +1 -1
- package/dist/core/db/sqlite-loader.d.ts +51 -0
- package/dist/core/db/sqlite-loader.d.ts.map +1 -0
- package/dist/core/db/sqlite-loader.js +94 -0
- package/dist/core/db/sqlite-loader.js.map +1 -0
- package/dist/core/db/wasm-sqlite.d.ts +4 -0
- package/dist/core/db/wasm-sqlite.d.ts.map +1 -0
- package/dist/core/db/wasm-sqlite.js +270 -0
- package/dist/core/db/wasm-sqlite.js.map +1 -0
- package/dist/core/diff-parser.d.ts.map +1 -1
- package/dist/core/diff-parser.js +6 -1
- package/dist/core/diff-parser.js.map +1 -1
- package/dist/core/git-log-reader.d.ts +28 -0
- package/dist/core/git-log-reader.d.ts.map +1 -1
- package/dist/core/git-log-reader.js +74 -3
- package/dist/core/git-log-reader.js.map +1 -1
- package/dist/core/index-manager.d.ts.map +1 -1
- package/dist/core/index-manager.js +29 -3
- package/dist/core/index-manager.js.map +1 -1
- package/dist/core/indexing-worker.d.ts +2 -0
- package/dist/core/indexing-worker.d.ts.map +1 -1
- package/dist/core/indexing-worker.js +2 -0
- package/dist/core/indexing-worker.js.map +1 -1
- package/dist/core/watcher/file-watcher.d.ts +6 -0
- package/dist/core/watcher/file-watcher.d.ts.map +1 -1
- package/dist/core/watcher/file-watcher.js +11 -1
- package/dist/core/watcher/file-watcher.js.map +1 -1
- package/dist/graph/path-resolver.js +86 -17
- package/dist/graph/path-resolver.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/node-guard.d.ts +15 -0
- package/dist/node-guard.d.ts.map +1 -0
- package/dist/node-guard.js +33 -0
- package/dist/node-guard.js.map +1 -0
- package/dist/server/admin-api.d.ts +1 -1
- package/dist/server/admin-api.d.ts.map +1 -1
- package/dist/server/admin-api.js +2 -2
- package/dist/server/admin-api.js.map +1 -1
- package/dist/server/auth/api-key.d.ts +1 -1
- package/dist/server/auth/api-key.d.ts.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +25 -0
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/tools/analyze-diff.d.ts +8 -0
- package/dist/server/tools/analyze-diff.d.ts.map +1 -1
- package/dist/server/tools/analyze-diff.js +80 -16
- package/dist/server/tools/analyze-diff.js.map +1 -1
- package/dist/server/tools/change-synthesis.d.ts +90 -0
- package/dist/server/tools/change-synthesis.d.ts.map +1 -0
- package/dist/server/tools/change-synthesis.js +236 -0
- package/dist/server/tools/change-synthesis.js.map +1 -0
- package/dist/server/tools/co-change.d.ts +65 -0
- package/dist/server/tools/co-change.d.ts.map +1 -0
- package/dist/server/tools/co-change.js +146 -0
- package/dist/server/tools/co-change.js.map +1 -0
- package/dist/server/tools/compare-change-impact.d.ts +58 -0
- package/dist/server/tools/compare-change-impact.d.ts.map +1 -0
- package/dist/server/tools/compare-change-impact.js +0 -0
- package/dist/server/tools/compare-change-impact.js.map +1 -0
- package/dist/server/tools/find-refactoring-opportunities.d.ts +1 -1
- package/dist/server/tools/get-architecture-snapshot.d.ts.map +1 -1
- package/dist/server/tools/get-architecture-snapshot.js +28 -14
- package/dist/server/tools/get-architecture-snapshot.js.map +1 -1
- package/dist/server/tools/get-churn-metrics.d.ts.map +1 -1
- package/dist/server/tools/get-churn-metrics.js +1 -12
- package/dist/server/tools/get-churn-metrics.js.map +1 -1
- package/dist/server/tools/get-co-change.d.ts +37 -0
- package/dist/server/tools/get-co-change.d.ts.map +1 -0
- package/dist/server/tools/get-co-change.js +120 -0
- package/dist/server/tools/get-co-change.js.map +1 -0
- package/dist/server/tools/get-context-bundle.d.ts.map +1 -1
- package/dist/server/tools/get-context-bundle.js +56 -3
- package/dist/server/tools/get-context-bundle.js.map +1 -1
- package/dist/server/tools/get-entry-points.d.ts +1 -1
- package/dist/server/tools/get-symbol-risk.d.ts +25 -0
- package/dist/server/tools/get-symbol-risk.d.ts.map +1 -0
- package/dist/server/tools/get-symbol-risk.js +60 -0
- package/dist/server/tools/get-symbol-risk.js.map +1 -0
- package/dist/server/tools/get-symbol-source.d.ts +2 -0
- package/dist/server/tools/get-symbol-source.d.ts.map +1 -1
- package/dist/server/tools/get-symbol-source.js +18 -1
- package/dist/server/tools/get-symbol-source.js.map +1 -1
- package/dist/server/tools/index-repo.d.ts.map +1 -1
- package/dist/server/tools/index-repo.js +8 -2
- package/dist/server/tools/index-repo.js.map +1 -1
- package/dist/server/tools/prepare-change.d.ts +61 -0
- package/dist/server/tools/prepare-change.d.ts.map +1 -0
- package/dist/server/tools/prepare-change.js +262 -0
- package/dist/server/tools/prepare-change.js.map +1 -0
- package/dist/server/tools/search-symbols.d.ts +2 -0
- package/dist/server/tools/search-symbols.d.ts.map +1 -1
- package/dist/server/tools/search-symbols.js +33 -0
- package/dist/server/tools/search-symbols.js.map +1 -1
- package/dist/server/tools/symbol-lines.d.ts +25 -0
- package/dist/server/tools/symbol-lines.d.ts.map +1 -0
- package/dist/server/tools/symbol-lines.js +40 -0
- package/dist/server/tools/symbol-lines.js.map +1 -0
- package/dist/server/tools/symbol-risk.d.ts +109 -0
- package/dist/server/tools/symbol-risk.d.ts.map +1 -0
- package/dist/server/tools/symbol-risk.js +251 -0
- package/dist/server/tools/symbol-risk.js.map +1 -0
- package/dist/server/tools/verify-change.d.ts +40 -0
- package/dist/server/tools/verify-change.d.ts.map +1 -0
- package/dist/server/tools/verify-change.js +149 -0
- package/dist/server/tools/verify-change.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/docs/01-introduction.md +2 -2
- package/docs/02-installation.md +97 -89
- package/docs/03-quick-start.md +138 -135
- package/docs/04-configuration.md +247 -214
- package/docs/05-cli-reference.md +236 -219
- package/docs/06-tools-reference.md +902 -499
- package/docs/14-transport-modes.md +170 -167
- package/docs/18-git-history.md +43 -0
- package/docs/23-performance.md +123 -121
- package/docs/26-troubleshooting.md +249 -234
- package/grammars/README.md +88 -0
- package/package.json +7 -25
- package/AGENT_INSTRUCTIONS_SHORT.md +0 -150
|
@@ -1,341 +1,351 @@
|
|
|
1
|
-
# Installation
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
## Prerequisites
|
|
5
|
-
|
|
6
|
-
| Requirement | Version | Notes |
|
|
7
|
-
|-------------|---------|-------|
|
|
8
|
-
| Node.js | >= 18.0.0 | 18, 20, and 22 are tested |
|
|
9
|
-
| npm | >= 9.0.0 | Ships with Node 18+ |
|
|
10
|
-
| Git | any | Required only for `index_repo` (remote repo cloning) |
|
|
11
|
-
|
|
12
|
-
## Install via npm (recommended)
|
|
13
|
-
|
|
14
|
-
```bash
|
|
15
|
-
npm install -g purecontext-mcp@latest
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
After this, `purecontext-mcp` is available as a global command.
|
|
19
|
-
|
|
20
|
-
If you prefer not to install globally, use `npx` to run without installing:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npx purecontext-mcp@latest
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
`npx` downloads the package on first use and caches it. This is the recommended approach for most AI client integrations because it picks up new versions automatically without a manual upgrade step.
|
|
27
|
-
|
|
28
|
-
## Prebuilt binaries
|
|
29
|
-
|
|
30
|
-
PureContext uses `better-sqlite3` for SQLite access. Pre-built native binaries are bundled for:
|
|
31
|
-
|
|
32
|
-
| Platform | Node 18 | Node 20 | Node 22 |
|
|
33
|
-
|----------|---------|---------|---------|
|
|
34
|
-
| Windows x64 | ✓ | ✓ | ✓ |
|
|
35
|
-
| macOS x64 | ✓ | ✓ | ✓ |
|
|
36
|
-
| macOS arm64 | ✓ | ✓ | ✓ |
|
|
37
|
-
| Linux x64 | ✓ | ✓ | ✓ |
|
|
38
|
-
| Linux arm64 | ✓ | ✓ | ✓ |
|
|
39
|
-
|
|
40
|
-
When a prebuilt binary matches your platform, `npm install` completes without any native compilation. No Python, no `node-gyp`, no build tools needed.
|
|
41
|
-
|
|
42
|
-
If your platform/Node combination is not in the table above, `npm install` will attempt a native compile. You will need:
|
|
43
|
-
- Python 3.x
|
|
44
|
-
- A C++ compiler (MSVC on Windows, clang/gcc on macOS/Linux)
|
|
45
|
-
- `node-gyp`: `npm install -g node-gyp`
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Connecting to your AI client
|
|
50
|
-
|
|
51
|
-
PureContext works with any MCP-compatible AI client. Choose the setup that matches your environment.
|
|
52
|
-
|
|
53
|
-
### Claude Code (CLI)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
```bash
|
|
212
|
-
npx purecontext-mcp install
|
|
213
|
-
npx purecontext-mcp install
|
|
214
|
-
npx purecontext-mcp install
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
npx purecontext-mcp install
|
|
222
|
-
npx purecontext-mcp install
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
#
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
**
|
|
302
|
-
```bash
|
|
303
|
-
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
```bash
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
```
|
|
340
|
-
|
|
341
|
-
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Prerequisites
|
|
5
|
+
|
|
6
|
+
| Requirement | Version | Notes |
|
|
7
|
+
|-------------|---------|-------|
|
|
8
|
+
| Node.js | >= 18.0.0 | 18, 20, and 22 are tested |
|
|
9
|
+
| npm | >= 9.0.0 | Ships with Node 18+ |
|
|
10
|
+
| Git | any | Required only for `index_repo` (remote repo cloning) |
|
|
11
|
+
|
|
12
|
+
## Install via npm (recommended)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g purecontext-mcp@latest
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
After this, `purecontext-mcp` is available as a global command.
|
|
19
|
+
|
|
20
|
+
If you prefer not to install globally, use `npx` to run without installing:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx purecontext-mcp@latest
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`npx` downloads the package on first use and caches it. This is the recommended approach for most AI client integrations because it picks up new versions automatically without a manual upgrade step.
|
|
27
|
+
|
|
28
|
+
## Prebuilt binaries
|
|
29
|
+
|
|
30
|
+
PureContext uses `better-sqlite3` for SQLite access. Pre-built native binaries are bundled for:
|
|
31
|
+
|
|
32
|
+
| Platform | Node 18 | Node 20 | Node 22 |
|
|
33
|
+
|----------|---------|---------|---------|
|
|
34
|
+
| Windows x64 | ✓ | ✓ | ✓ |
|
|
35
|
+
| macOS x64 | ✓ | ✓ | ✓ |
|
|
36
|
+
| macOS arm64 | ✓ | ✓ | ✓ |
|
|
37
|
+
| Linux x64 | ✓ | ✓ | ✓ |
|
|
38
|
+
| Linux arm64 | ✓ | ✓ | ✓ |
|
|
39
|
+
|
|
40
|
+
When a prebuilt binary matches your platform, `npm install` completes without any native compilation. No Python, no `node-gyp`, no build tools needed.
|
|
41
|
+
|
|
42
|
+
If your platform/Node combination is not in the table above, `npm install` will attempt a native compile. You will need:
|
|
43
|
+
- Python 3.x
|
|
44
|
+
- A C++ compiler (MSVC on Windows, clang/gcc on macOS/Linux)
|
|
45
|
+
- `node-gyp`: `npm install -g node-gyp`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Connecting to your AI client
|
|
50
|
+
|
|
51
|
+
PureContext works with any MCP-compatible AI client. Choose the setup that matches your environment.
|
|
52
|
+
|
|
53
|
+
### Claude Code (CLI)
|
|
54
|
+
|
|
55
|
+
Easiest — let the installer register the server (pinned to your global Node) and add the workflow rules in one step:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx purecontext-mcp@latest install claude
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or register the server manually:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
claude mcp add purecontext-mcp -- npx purecontext-mcp@latest
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Verify:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
claude mcp list
|
|
71
|
+
# purecontext-mcp connected npx purecontext-mcp
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Claude Desktop
|
|
75
|
+
|
|
76
|
+
Edit `~/.claude/claude_desktop_config.json` (create it if it doesn't exist):
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcpServers": {
|
|
81
|
+
"purecontext": {
|
|
82
|
+
"command": "npx",
|
|
83
|
+
"args": ["purecontext-mcp@latest"]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If you installed globally (`npm install -g purecontext-mcp`), you can use the binary directly:
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"mcpServers": {
|
|
94
|
+
"purecontext": {
|
|
95
|
+
"command": "purecontext-mcp@latest"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Restart Claude Desktop after saving the file.
|
|
102
|
+
|
|
103
|
+
### Cursor
|
|
104
|
+
|
|
105
|
+
Create or edit `.cursor/mcp.json` in your project directory for a project-scoped connection, or `~/.cursor/mcp.json` for a global one:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"mcpServers": {
|
|
110
|
+
"purecontext": {
|
|
111
|
+
"command": "npx",
|
|
112
|
+
"args": ["purecontext-mcp@latest"]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Reload the Cursor window after saving (`Ctrl+Shift+P` → "Developer: Reload Window").
|
|
119
|
+
|
|
120
|
+
### Windsurf
|
|
121
|
+
|
|
122
|
+
Open Windsurf Settings and navigate to the MCP section, or edit the MCP configuration file directly:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"mcpServers": {
|
|
127
|
+
"purecontext": {
|
|
128
|
+
"command": "npx",
|
|
129
|
+
"args": ["purecontext-mcp@latest"]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### VS Code (with MCP support)
|
|
136
|
+
|
|
137
|
+
Create `.vscode/mcp.json` in your project:
|
|
138
|
+
|
|
139
|
+
```json
|
|
140
|
+
{
|
|
141
|
+
"servers": {
|
|
142
|
+
"purecontext": {
|
|
143
|
+
"type": "stdio",
|
|
144
|
+
"command": "npx",
|
|
145
|
+
"args": ["purecontext-mcp@latest"]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Connecting to a shared team server (HTTP)
|
|
152
|
+
|
|
153
|
+
If your team runs a shared PureContext server, connect with an HTTP transport instead of launching a local process. The config format is the same across all clients — only the transport section changes:
|
|
154
|
+
|
|
155
|
+
**Claude Code CLI:**
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
claude mcp add purecontext-shared \
|
|
159
|
+
--transport http \
|
|
160
|
+
--url https://purecontext.yourcompany.com/mcp/sse \
|
|
161
|
+
--header "Authorization: Bearer pctx_yourpersonalkey"
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Claude Desktop / Cursor / Windsurf (config file):**
|
|
165
|
+
|
|
166
|
+
```json
|
|
167
|
+
{
|
|
168
|
+
"mcpServers": {
|
|
169
|
+
"purecontext": {
|
|
170
|
+
"transport": "http",
|
|
171
|
+
"url": "https://purecontext.yourcompany.com/mcp/sse",
|
|
172
|
+
"headers": {
|
|
173
|
+
"Authorization": "Bearer pctx_yourpersonalkey"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Your API key is issued by your team's PureContext administrator. See [Team Setup](15-team-setup.md) for how to deploy and manage a shared server.
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Teaching your AI agent to use PureContext well
|
|
185
|
+
|
|
186
|
+
Installing PureContext gives your AI agent access to the tools. Adding the agent instructions tells it *how* to use them efficiently — which tool to pick for each situation, in what order to call them, and what patterns to avoid.
|
|
187
|
+
|
|
188
|
+
Without them, an AI agent given access to PureContext may default to reading entire files (wasting tokens) rather than using `search_symbols`, or may not know to call `list_repos` first to get the `repoId` required by every tool. The instructions encode the correct workflow: check if indexed → search by name or meaning → retrieve source only for what you'll use.
|
|
189
|
+
|
|
190
|
+
### Recommended: `purecontext-mcp install`
|
|
191
|
+
|
|
192
|
+
PureContext ships with a multi-IDE installer that writes the workflow rules into each tool's conventions file **and registers the `purecontext-mcp` MCP server** (pinned to your global Node — so it works in every project regardless of any per-project Node pin). Run it once inside your project root:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npx purecontext-mcp install all
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
This auto-detects which AI tools are configured in the project (by looking for marker files such as `.cursor/`, `.windsurf/`, `CLAUDE.md`, `.continue/`, etc.) and sets up each.
|
|
199
|
+
|
|
200
|
+
When no `--scope` flag is given, the CLI prompts you to choose where to install:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
Where should PureContext be installed?
|
|
204
|
+
1) Local — this project only
|
|
205
|
+
2) Global — all projects (user-level config)
|
|
206
|
+
3) Both
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Pass `--scope` to skip the prompt:
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
npx purecontext-mcp install all --scope=local # this project only
|
|
213
|
+
npx purecontext-mcp install all --scope=global # user-level, all projects
|
|
214
|
+
npx purecontext-mcp install all --scope=both # both places at once
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
For a single tool:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
npx purecontext-mcp install cursor --scope=global
|
|
221
|
+
npx purecontext-mcp install windsurf
|
|
222
|
+
npx purecontext-mcp install continue
|
|
223
|
+
# ...etc.
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Useful flags:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
npx purecontext-mcp install --list # show detection state, write nothing
|
|
230
|
+
npx purecontext-mcp install all --dry-run # preview which writers would run
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Supported tools
|
|
234
|
+
|
|
235
|
+
| Tool | Local | Global | Notes |
|
|
236
|
+
|------|-------|--------|-------|
|
|
237
|
+
| `claude` | `CLAUDE.md` in project | `~/.claude/CLAUDE.md` + hooks | Global installs PostToolUse re-index, PreCompact snapshot, and edit guard. |
|
|
238
|
+
| `cursor` | `.cursor/rules/purecontext.mdc` | `~/.cursor/rules/purecontext.mdc` | MDC frontmatter with `alwaysApply: true`. |
|
|
239
|
+
| `windsurf` | `.windsurf/rules/purecontext.md` | `~/.windsurf/rules/purecontext.md` | Marked block appended or replaced in place. |
|
|
240
|
+
| `continue` | `.continue/config.json` | `~/.continue/config.json` | JSON-aware merge; other fields are preserved. |
|
|
241
|
+
| `cline` | `.clinerules` | local only | No known global config path. |
|
|
242
|
+
| `roo-code` | `.roo/rules-code.md` | local only | No known global config path. |
|
|
243
|
+
| `copilot` | `.github/copilot-instructions.md` | local only | Picked up by GitHub Copilot in VS Code. |
|
|
244
|
+
| `claude-desktop` | always global | always global | Merges MCP server entry; leaves other servers untouched. |
|
|
245
|
+
|
|
246
|
+
In addition to the rules file above, every tool also gets the `purecontext-mcp` **MCP server** registered (pinned to your global Node), so its tools are available — not just referenced by the rules. The server is written to each agent's own MCP config (`~/.cursor/mcp.json`, `~/.codeium/windsurf/mcp_config.json`, Continue's `config.yaml`, VS Code's user `mcp.json` for Copilot, the VS Code globalStorage settings for Cline/Roo, and `claude mcp add` for Claude Code). Where a config location can't be determined, `install` prints the entry to add manually. Set `PCTX_SKIP_MCP_REGISTER=1` to install rules only.
|
|
247
|
+
|
|
248
|
+
### Idempotency
|
|
249
|
+
|
|
250
|
+
Every writer is safe to re-run. The Markdown writers wrap their content in HTML comment markers:
|
|
251
|
+
|
|
252
|
+
```html
|
|
253
|
+
<!-- purecontext-mcp-start -->
|
|
254
|
+
... PureContext workflow rules ...
|
|
255
|
+
<!-- purecontext-mcp-end -->
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
On re-run, the marked block is replaced in place. Anything outside the markers (your own rules, other tools' rules) is preserved. The JSON writers (`continue`, `claude-desktop`) parse and merge structurally rather than re-emitting the whole file.
|
|
259
|
+
|
|
260
|
+
### Manual install (if you'd rather paste)
|
|
261
|
+
|
|
262
|
+
The two source-of-truth files are at the repository root:
|
|
263
|
+
|
|
264
|
+
- **`AGENT_INSTRUCTIONS.md`** — the onboarding doc: mandatory workflow, tool-selection table, navigation patterns, anti-patterns. Paste into your agent's rules file for complex multi-step workflows. (`npx purecontext-mcp install <tool>` writes a compact, always-on subset automatically.)
|
|
265
|
+
- **`AGENT_REFERENCE.md`** — the single canonical reference: a full intent→tool picker, every parameter, every navigation pattern, and known limitations. Read this when an agent needs the authoritative answer.
|
|
266
|
+
|
|
267
|
+
To use these manually:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
# Claude Code
|
|
271
|
+
cat AGENT_INSTRUCTIONS.md >> CLAUDE.md
|
|
272
|
+
|
|
273
|
+
# Cursor — paste into .cursorrules or via Cursor Settings → Rules
|
|
274
|
+
# Windsurf — paste into .windsurf/rules/purecontext.md or workspace memory
|
|
275
|
+
# Anything else — paste into whatever rule/memory config it supports
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Verifying the installation
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
purecontext-mcp --version
|
|
284
|
+
# 1.x.x
|
|
285
|
+
|
|
286
|
+
purecontext-mcp config --check
|
|
287
|
+
# ✓ Node.js 20.11.0
|
|
288
|
+
# ✓ SQLite (better-sqlite3 9.x)
|
|
289
|
+
# ✓ Grammar: tree-sitter-typescript.wasm
|
|
290
|
+
# ✓ Grammar: tree-sitter-javascript.wasm
|
|
291
|
+
# ... (all 34 grammars)
|
|
292
|
+
# ✓ Config: ~/.purecontext/config.json
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
`config --check` validates the installation, verifies all grammar files are present, and reports the effective configuration.
|
|
296
|
+
|
|
297
|
+
## Upgrading
|
|
298
|
+
|
|
299
|
+
Run the command that matches how you installed PureContext:
|
|
300
|
+
|
|
301
|
+
**Installed with Volta:**
|
|
302
|
+
```bash
|
|
303
|
+
volta install purecontext-mcp
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Installed with npm globally:**
|
|
307
|
+
```bash
|
|
308
|
+
npm install -g purecontext-mcp@latest
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**Running via npx (no global install):** npx may serve a cached older version. Force the latest:
|
|
312
|
+
```bash
|
|
313
|
+
npx purecontext-mcp@latest
|
|
314
|
+
```
|
|
315
|
+
To always get the latest version automatically, use `purecontext-mcp@latest` in your MCP client config instead of the bare package name.
|
|
316
|
+
|
|
317
|
+
**Installed from source:**
|
|
318
|
+
```bash
|
|
319
|
+
cd /path/to/purecontext-mcp
|
|
320
|
+
git pull
|
|
321
|
+
npm install
|
|
322
|
+
npm run build
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
> **Note:** `npm update -g purecontext-mcp` does not work reliably — use `npm install -g purecontext-mcp@latest` instead.
|
|
326
|
+
|
|
327
|
+
Index files (SQLite databases) are forward-compatible within a major version. After upgrading from `1.x` to `1.y`, existing indexes continue to work. A major version upgrade (e.g., `1.x` → `2.0`) may require a re-index — the CLI will warn if it detects an incompatible index version.
|
|
328
|
+
|
|
329
|
+
## Install from source
|
|
330
|
+
|
|
331
|
+
Use this when contributing, testing unreleased features, or running a local build.
|
|
332
|
+
|
|
333
|
+
```bash
|
|
334
|
+
git clone <repository-url> purecontext-mcp
|
|
335
|
+
cd purecontext-mcp
|
|
336
|
+
npm install
|
|
337
|
+
npm run build
|
|
338
|
+
npm link # makes 'purecontext-mcp' available globally from this build
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
## Uninstalling
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
npm uninstall -g purecontext-mcp
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
This removes the binaries. Index files and configuration are not removed. To clean everything up:
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
rm -rf ~/.purecontext # Removes indexes, config, savings stats
|
|
351
|
+
```
|