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
package/README.md
CHANGED
|
@@ -1,339 +1,411 @@
|
|
|
1
|
-
# PureContext MCP
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/purecontext-mcp)
|
|
4
|
-
[](docs/27-api-stability.md)
|
|
5
|
-
[](LICENSE)
|
|
6
|
-
|
|
7
|
-
**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
#
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Total context used: ~
|
|
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
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
npx
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
-
|
|
338
|
-
|
|
339
|
-
|
|
1
|
+
# PureContext MCP
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/purecontext-mcp)
|
|
4
|
+
[](docs/27-api-stability.md)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
**Most tools help an AI agent *read* your codebase. PureContext helps it *change* your codebase safely.**
|
|
8
|
+
|
|
9
|
+
Agents are already good at finding code. What they can't see is the part that breaks things: what a symbol connects to, what quietly changes alongside it, and whether it's risky to touch at all. PureContext MCP indexes your codebase into a structured, queryable model and gives agents that missing layer — **impact, coupling, and change-risk intelligence, before the edit.**
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
Before changing processRefund(), the agent checks:
|
|
13
|
+
|
|
14
|
+
get_symbol_risk → band: HIGH — 47 dependents · churn 8/90d
|
|
15
|
+
· no direct test · co-changes with ledger.ts (conf 0.71)
|
|
16
|
+
get_blast_radius → 23 files affected across 4 modules
|
|
17
|
+
get_co_change → usually moves together with refund.test.ts and ledger.ts
|
|
18
|
+
|
|
19
|
+
→ so it updates those together, instead of shipping a half-change that
|
|
20
|
+
passes locally and breaks billing in production.
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This is the layer autonomous agents are missing. Refactoring and change-safety tooling is still mostly built for humans clicking through an IDE — not for an agent about to edit code it has never seen. PureContext closes that gap: blast radius, temporal co-change, rename/delete/move safety checks, and a composite per-symbol risk score — all queryable as MCP tools.
|
|
24
|
+
|
|
25
|
+
It's built on **token-efficient retrieval** as the foundation: agents pull a single function, class, or route by name or meaning instead of reading whole files — typically **90%+ fewer context tokens** ([see it in action](#what-this-looks-like-in-practice)). Precise context means less hallucination, more accurate edits, and the ability to work on codebases far larger than any context window.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# Inside your project: registers the MCP server (pinned to your global Node) AND
|
|
33
|
+
# adds the workflow rules — auto-detects Claude / Cursor / Windsurf / Continue /
|
|
34
|
+
# Cline / Roo Code / Copilot / Claude Desktop
|
|
35
|
+
npx purecontext-mcp@latest install all
|
|
36
|
+
|
|
37
|
+
# Prefer to wire up Claude Code by hand? Register the server manually:
|
|
38
|
+
claude mcp add purecontext-mcp -- npx purecontext-mcp@latest
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Then in a Claude Code conversation:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
Index my project at /path/to/my-project
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
That's it. Claude will index your codebase and you can start navigating it by name, by meaning, or by dependency — without reading files.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## What this looks like in practice
|
|
52
|
+
|
|
53
|
+
### First, find and understand it
|
|
54
|
+
|
|
55
|
+
A typical "find and understand" conversation, before vs. after:
|
|
56
|
+
|
|
57
|
+
**Without PureContext**
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
You: Where do we handle Stripe webhook signature verification?
|
|
61
|
+
Claude: I'll search the codebase.
|
|
62
|
+
[reads src/api/webhooks/stripe.ts — 412 lines, ~3,100 tokens]
|
|
63
|
+
[reads src/lib/stripe-client.ts — 287 lines, ~2,150 tokens]
|
|
64
|
+
[reads src/middleware/webhook.ts — 198 lines, ~1,490 tokens]
|
|
65
|
+
Verification happens in verifyStripeSignature() at line 87 of stripe.ts.
|
|
66
|
+
Total context used: ~6,740 tokens
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**With PureContext**
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
You: Where do we handle Stripe webhook signature verification?
|
|
73
|
+
Claude: search_symbols(query: "stripe webhook signature")
|
|
74
|
+
→ 3 matches, 78 tokens
|
|
75
|
+
get_symbol_source(symbolId: "verifyStripeSignature")
|
|
76
|
+
→ 32 lines, 180 tokens
|
|
77
|
+
verifyStripeSignature() at src/api/webhooks/stripe.ts:87.
|
|
78
|
+
It uses the timing-safe HMAC check from Stripe's SDK with a 5-minute tolerance.
|
|
79
|
+
Total context used: ~258 tokens — 96% less
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The agent stays in the conversation instead of running out of context after one file read — which frees it to get to the part that actually matters: changing the code safely.
|
|
83
|
+
|
|
84
|
+
### Then change it without breaking things
|
|
85
|
+
|
|
86
|
+
A typical "modify this" conversation, before vs. after:
|
|
87
|
+
|
|
88
|
+
**Without PureContext**
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
You: Add a partial-refund path to processRefund().
|
|
92
|
+
Claude: [reads processRefund, edits it]
|
|
93
|
+
Done — added the partial-refund branch.
|
|
94
|
+
|
|
95
|
+
(Never saw that ledger.ts reconciles every refund, or that
|
|
96
|
+
refund.test.ts asserts the old totals. CI breaks; billing
|
|
97
|
+
drifts in production.)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**With PureContext**
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
You: Add a partial-refund path to processRefund().
|
|
104
|
+
Claude: get_symbol_risk(symbolId: "processRefund")
|
|
105
|
+
→ band: HIGH — 47 dependents · churn 8/90d · no direct test
|
|
106
|
+
· co-changes with ledger.ts (conf 0.71)
|
|
107
|
+
get_blast_radius(symbolId: "processRefund")
|
|
108
|
+
→ 23 files affected across 4 modules
|
|
109
|
+
get_co_change(symbolId: "processRefund")
|
|
110
|
+
→ usually moves together with ledger.ts and refund.test.ts
|
|
111
|
+
|
|
112
|
+
This symbol is high-risk and untested. I'll update processRefund(),
|
|
113
|
+
adjust the reconciliation in ledger.ts, and extend refund.test.ts
|
|
114
|
+
in the same change.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The difference here isn't tokens — it's that the agent saw the second-order edits *before* writing code, instead of discovering them in a failed CI run or a production incident.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Change & refactoring intelligence
|
|
122
|
+
|
|
123
|
+
This is the part most code tools leave to humans. PureContext exposes it as MCP tools an agent can call *before* it edits — so autonomous changes come with the same impact awareness a careful senior engineer would bring.
|
|
124
|
+
|
|
125
|
+
| Question the agent can answer | Tool |
|
|
126
|
+
|---|---|
|
|
127
|
+
| What breaks if I change this symbol? | `get_blast_radius` |
|
|
128
|
+
| What files historically change *together* with this one (but don't import it)? | `get_co_change` |
|
|
129
|
+
| How risky is this symbol to change, and why? | `get_symbol_risk` |
|
|
130
|
+
| Is it safe to rename / delete / move this? | `check_rename_safe` · `check_delete_safe` · `check_move_safe` |
|
|
131
|
+
| What's the impact *before* I edit, and what will I forget to touch? | `prepare_change` |
|
|
132
|
+
| Did my applied change actually cover everything I planned? | `verify_change` |
|
|
133
|
+
| Did my change introduce a new cycle or layer violation? | `compare_change_impact` |
|
|
134
|
+
| What's the sequenced, risk-annotated plan for a larger refactor? | `plan_refactoring` |
|
|
135
|
+
| Who calls this, and who do they call? | `get_call_hierarchy` · `find_references` |
|
|
136
|
+
| What's churning or accumulating debt? | `get_churn_metrics` · `get_debt_report` · `health_radar` |
|
|
137
|
+
|
|
138
|
+
**`get_symbol_risk`** is the composite verdict: it fuses change frequency (churn), centrality (how much depends on it), complexity, test-coverage gaps, and temporal co-change into one banded score (`low` / `review` / `high`) with human-readable reasons — never a black-box number, and deliberately **code-centered** (no author or productivity metrics). **`get_co_change`** surfaces the coupling the import graph can't see — the test, the migration, or the feature flag that always moves with a file. Together they let an agent edit unfamiliar code the way a cautious human does: check the blast radius, update what moves with it, and flag what it shouldn't touch alone.
|
|
139
|
+
|
|
140
|
+
PureContext also closes the loop *around* an edit — **judgment, not actuation** (it never writes files; your agent does): **`prepare_change`** gives a pre-edit impact verdict for a stated intent (and flags the co-change partners you're about to forget), **`verify_change`** reconciles the real diff against that plan (`complete` / `incomplete` / `scope_expanded`), and **`compare_change_impact`** reports the *new* cycles or layer violations a change introduced — never blaming it for pre-existing ones.
|
|
141
|
+
|
|
142
|
+
→ Full tool list and parameters: [AGENT_REFERENCE.md](AGENT_REFERENCE.md) · safe-change workflow: [SAFE-CHANGES.md](SAFE-CHANGES.md)
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Measured search precision
|
|
147
|
+
|
|
148
|
+
PureContext is benchmarked on **87 real-world open-source projects** with 25 curated ground-truth queries each. Top-rank precision (P@1) reaches 84% on NestJS, 84% on Terraform, 72% on Protobuf and GraphQL, 60% on Nix, 52% on LÖVE (Lua/C++), and 40% on Tokio (Rust). Full per-language tables, methodology, and reproduction steps are in [BENCHMARKS.md](BENCHMARKS.md).
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Documentation
|
|
153
|
+
|
|
154
|
+
### User Guide — start here
|
|
155
|
+
|
|
156
|
+
The guide explains what PureContext does, why each feature exists, and how to use it effectively in real-world situations. It covers both solo developers and team deployments.
|
|
157
|
+
|
|
158
|
+
| | |
|
|
159
|
+
|-|-|
|
|
160
|
+
| [Why PureContext](WHY-PURECONTEXT.md) | The full case — beyond token savings |
|
|
161
|
+
| [Navigating a New Codebase](NAVIGATING-NEW-CODE.md) | Day one on an unfamiliar project |
|
|
162
|
+
| [Finding Code](FINDING-CODE.md) | Three search modes with examples |
|
|
163
|
+
| [Making Changes Safely](SAFE-CHANGES.md) | Blast radius and dependency analysis |
|
|
164
|
+
| [Understanding Code Relationships](UNDERSTANDING-RELATIONSHIPS.md) | Call hierarchies, cycles, coupling, implementations |
|
|
165
|
+
| [Refactoring Safely](REFACTORING-SAFELY.md) | Pre-flight checks before rename, delete, or move |
|
|
166
|
+
| [Understanding Code History](CODE-HISTORY.md) | Symbol-level git history and churn |
|
|
167
|
+
| [The Web UI](WEB-UI.md) | Visual graph, heatmap, symbol timeline |
|
|
168
|
+
| [AI Summaries](AI-SUMMARIES.md) | Better search on undocumented codebases |
|
|
169
|
+
| [Code Health & Architecture Analysis](CODE-HEALTH.md) | Quality metrics, anti-patterns, arch docs |
|
|
170
|
+
| [Health Dashboards & Debt Reporting](HEALTH-DASHBOARDS.md) | Health radar, debt scores, PR health diffs |
|
|
171
|
+
| [Visualizing Code Structure](VISUALIZING-CODE.md) | Mermaid/DOT diagrams, architecture snapshots |
|
|
172
|
+
| [AST-Level Search](AST-SEARCH.md) | Node types, signatures, decorators, complexity |
|
|
173
|
+
| [Code Intelligence](CODE-INTELLIGENCE.md) | Entry points, public API, TODOs, coverage |
|
|
174
|
+
| [Language Support](LANGUAGE-SUPPORT.md) | All 34 supported languages and what's extracted |
|
|
175
|
+
| [Framework Adapters](FRAMEWORK-ADAPTERS.md) | Vue, React, Django, Spring, Rails, Flutter, ORMs, and more |
|
|
176
|
+
| [Using PureContext with a Team](TEAM-SETUP.md) | Shared server, enterprise setup |
|
|
177
|
+
|
|
178
|
+
**Real-world workflows:**
|
|
179
|
+
|
|
180
|
+
| | |
|
|
181
|
+
|-|-|
|
|
182
|
+
| [Onboarding to a New Codebase](WORKFLOW-ONBOARDING.md) | First day on a 6,000-file microservices platform |
|
|
183
|
+
| [Refactoring Legacy Code](WORKFLOW-REFACTORING.md) | Replacing auth in a 6-year-old Django monolith |
|
|
184
|
+
| [Reviewing a Pull Request](WORKFLOW-PR-REVIEW.md) | 40-file PR, 45 minutes, two real bugs found |
|
|
185
|
+
| [Running a Tech Debt Sprint](WORKFLOW-TECH-DEBT.md) | Two-week debt reduction: assess, plan, execute, measure |
|
|
186
|
+
|
|
187
|
+
→ [Full guide index](USER-GUIDE.md)
|
|
188
|
+
|
|
189
|
+
### Reference Manual
|
|
190
|
+
|
|
191
|
+
Parameter-level documentation for every tool, configuration option, language, framework adapter, and deployment option lives in [`docs/README.md`](docs/README.md). The reference manual is cross-linked with the user guide above — every topic has both a narrative and a reference page where one helps.
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## What it indexes
|
|
196
|
+
|
|
197
|
+
### Languages
|
|
198
|
+
|
|
199
|
+
**34 languages** via bundled tree-sitter WASM grammars — no separate install required.
|
|
200
|
+
|
|
201
|
+
| Category | Languages |
|
|
202
|
+
|----------|-----------|
|
|
203
|
+
| Web / Application | TypeScript, JavaScript, Python, PHP, Ruby, Go, Java, Kotlin, C#, Scala, Dart, Swift, Elixir, Haskell, Lua, R, Perl, Groovy, Erlang, Gleam |
|
|
204
|
+
| Systems | C, C++, Rust, Fortran, Objective-C |
|
|
205
|
+
| Scripting & Game | Bash, GDScript |
|
|
206
|
+
| Infrastructure & Config | Terraform / HCL, Nix |
|
|
207
|
+
| Data & API | SQL, Protobuf, GraphQL, OpenAPI / YAML, XML |
|
|
208
|
+
| Styling (regex-based) | SCSS, SASS, LESS, CSS |
|
|
209
|
+
|
|
210
|
+
→ [Language Support guide](LANGUAGE-SUPPORT.md) · [Full reference](docs/07-language-support.md)
|
|
211
|
+
|
|
212
|
+
### Frameworks
|
|
213
|
+
|
|
214
|
+
**Framework-aware extraction** — routes, components, hooks, models, ORM entities, and middleware are pulled out as first-class symbols (not just functions and classes).
|
|
215
|
+
|
|
216
|
+
| Stack | Frameworks |
|
|
217
|
+
|-------|-----------|
|
|
218
|
+
| JavaScript / TypeScript | Vue 3, React, Nuxt, Next.js (Pages + App Router), Angular, NestJS, Express, Fastify |
|
|
219
|
+
| Python | Django, FastAPI, Flask |
|
|
220
|
+
| Go | Gin, Echo, Fiber |
|
|
221
|
+
| PHP | Laravel, Symfony |
|
|
222
|
+
| Ruby | Rails, Sinatra |
|
|
223
|
+
| Java | Spring Boot, Micronaut, Quarkus |
|
|
224
|
+
| Kotlin | Ktor, Spring (Kotlin) |
|
|
225
|
+
| Rust | Axum, Actix-web, Rocket |
|
|
226
|
+
| Mobile | Flutter |
|
|
227
|
+
| ORMs | Hibernate, SQLAlchemy, Django ORM, Prisma, TypeORM |
|
|
228
|
+
|
|
229
|
+
→ [Framework Adapters guide](FRAMEWORK-ADAPTERS.md) · [Full reference](docs/08-framework-adapters.md)
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Installation
|
|
234
|
+
|
|
235
|
+
**Requirements:** Node.js 18, 20, or 22. Prebuilt binaries included for Windows, macOS, and Linux — no native compilation needed.
|
|
236
|
+
|
|
237
|
+
### Claude Code
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
claude mcp add purecontext-mcp -- npx purecontext-mcp@latest
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Claude Desktop
|
|
244
|
+
|
|
245
|
+
Edit `~/.claude/claude_desktop_config.json`:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"mcpServers": {
|
|
250
|
+
"purecontext": {
|
|
251
|
+
"command": "npx",
|
|
252
|
+
"args": ["purecontext-mcp@latest"]
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Cursor
|
|
259
|
+
|
|
260
|
+
Create `.cursor/mcp.json` in your project (or `~/.cursor/mcp.json` for global):
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"mcpServers": {
|
|
265
|
+
"purecontext": {
|
|
266
|
+
"command": "npx",
|
|
267
|
+
"args": ["purecontext-mcp@latest"]
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Windsurf
|
|
274
|
+
|
|
275
|
+
Open Windsurf Settings → MCP section, or edit the MCP config file directly:
|
|
276
|
+
|
|
277
|
+
```json
|
|
278
|
+
{
|
|
279
|
+
"mcpServers": {
|
|
280
|
+
"purecontext": {
|
|
281
|
+
"command": "npx",
|
|
282
|
+
"args": ["purecontext-mcp@latest"]
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### VS Code
|
|
289
|
+
|
|
290
|
+
Create `.vscode/mcp.json` in your project:
|
|
291
|
+
|
|
292
|
+
```json
|
|
293
|
+
{
|
|
294
|
+
"servers": {
|
|
295
|
+
"purecontext": {
|
|
296
|
+
"type": "stdio",
|
|
297
|
+
"command": "npx",
|
|
298
|
+
"args": ["purecontext-mcp@latest"]
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Shared team server (HTTP)
|
|
305
|
+
|
|
306
|
+
If your team runs a shared PureContext server, connect with an HTTP transport instead:
|
|
307
|
+
|
|
308
|
+
```json
|
|
309
|
+
{
|
|
310
|
+
"mcpServers": {
|
|
311
|
+
"purecontext": {
|
|
312
|
+
"transport": "http",
|
|
313
|
+
"url": "https://purecontext.yourcompany.com/mcp/sse",
|
|
314
|
+
"headers": {
|
|
315
|
+
"Authorization": "Bearer pctx_yourpersonalkey"
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
→ [Full installation guide](FULL-INSTALLATION-GUIDE.md)
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## Teaching your AI agent to use PureContext well
|
|
327
|
+
|
|
328
|
+
Installing PureContext gives your agent the tools. Adding the agent instructions tells it *how* to use them — which tool to pick for each task, in what order, and what to avoid.
|
|
329
|
+
|
|
330
|
+
Without these instructions, an agent may default to reading entire files rather than using `search_symbols`, or may not know to call `list_repos` first to get the repository ID required by every tool.
|
|
331
|
+
|
|
332
|
+
### One-command install (recommended)
|
|
333
|
+
|
|
334
|
+
Run this once inside your project directory:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
npx purecontext-mcp@latest install all
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
This auto-detects which AI coding tools you have set up in the project and writes the PureContext workflow rules to the right place for each. Re-running is safe — every writer is idempotent (managed blocks are marked and replaced rather than appended).
|
|
341
|
+
|
|
342
|
+
When no `--scope` flag is given, the CLI prompts you to choose where to install:
|
|
343
|
+
|
|
344
|
+
```
|
|
345
|
+
Where should PureContext be installed?
|
|
346
|
+
1) Local — this project only
|
|
347
|
+
2) Global — all projects (user-level config)
|
|
348
|
+
3) Both
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
Pass `--scope` to skip the prompt:
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
npx purecontext-mcp@latest install all --scope=local # this project only
|
|
355
|
+
npx purecontext-mcp@latest install all --scope=global # user-level, all projects
|
|
356
|
+
npx purecontext-mcp@latest install all --scope=both # both places at once
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
For a single tool:
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
npx purecontext-mcp@latest install <tool> --scope=global
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
To preview without writing files:
|
|
366
|
+
|
|
367
|
+
```bash
|
|
368
|
+
npx purecontext-mcp@latest install all --dry-run
|
|
369
|
+
npx purecontext-mcp@latest install --list # show which IDEs were detected
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Supported tools and where each one writes its workflow rules (it also registers the `purecontext-mcp` MCP server with each — pinned to your global Node — in that tool's own MCP config):
|
|
373
|
+
|
|
374
|
+
| Tool | Local | Global |
|
|
375
|
+
|------|-------|--------|
|
|
376
|
+
| `claude` | `CLAUDE.md` in project | `~/.claude/CLAUDE.md` + hooks |
|
|
377
|
+
| `cursor` | `.cursor/rules/purecontext.mdc` | `~/.cursor/rules/purecontext.mdc` |
|
|
378
|
+
| `windsurf` | `.windsurf/rules/purecontext.md` | `~/.windsurf/rules/purecontext.md` |
|
|
379
|
+
| `continue` | `.continue/config.json` | `~/.continue/config.json` |
|
|
380
|
+
| `cline` | `.clinerules` | local only |
|
|
381
|
+
| `roo-code` | `.roo/rules-code.md` | local only |
|
|
382
|
+
| `copilot` | `.github/copilot-instructions.md` | local only |
|
|
383
|
+
| `claude-desktop` | always global | always global |
|
|
384
|
+
|
|
385
|
+
### Manual install
|
|
386
|
+
|
|
387
|
+
If you'd rather paste the rules yourself, two instruction files are at the repository root:
|
|
388
|
+
|
|
389
|
+
- **[`AGENT_INSTRUCTIONS.md`](AGENT_INSTRUCTIONS.md)** — the onboarding doc: mandatory workflow, tool-selection table, navigation patterns, and anti-patterns. Paste into your agent's rules file, or run `npx purecontext-mcp install <tool>` to write a compact, always-on version automatically.
|
|
390
|
+
- **[`AGENT_REFERENCE.md`](AGENT_REFERENCE.md)** — the single canonical reference: a full intent→tool picker, every parameter, every navigation pattern, and known limitations. Installed automatically by `hooks --install`; read this when an agent needs the authoritative answer.
|
|
391
|
+
|
|
392
|
+
Paste the contents into whatever system prompt, memory, or rules configuration your agent uses.
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## License
|
|
397
|
+
|
|
398
|
+
MIT — see [LICENSE](LICENSE).
|
|
399
|
+
|
|
400
|
+
## Contributing
|
|
401
|
+
|
|
402
|
+
Issues and pull requests are welcome at [github.com/goranocokoljic/pure-context](https://github.com/goranocokoljic/pure-context). Before opening a feature PR, please open an issue to discuss the design — the three-layer architecture (Core → Handlers → Adapters) has hard rules about dependency direction that are easy to violate accidentally. See [`CLAUDE.md`](CLAUDE.md) at the project root for the architectural conventions.
|
|
403
|
+
|
|
404
|
+
For language or framework adapters: pick a real-world repository, add a 25-query ground-truth file in `benchmarks/<project>/queries.json`, and include benchmark numbers (P@1 / P@3 / R@5) in the PR description so reviewers can confirm the change is a net improvement.
|
|
405
|
+
|
|
406
|
+
## Support
|
|
407
|
+
|
|
408
|
+
- **Bug reports and feature requests:** [GitHub Issues](https://github.com/goranocokoljic/pure-context/issues)
|
|
409
|
+
- **Questions about MCP integration:** Open a Discussion on the repository
|
|
410
|
+
- **Changelog:** [CHANGELOG.md](CHANGELOG.md)
|
|
411
|
+
- **Stability and semver policy:** [docs/27-api-stability.md](docs/27-api-stability.md)
|