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.
Files changed (196) hide show
  1. package/AGENT_INSTRUCTIONS.md +18 -10
  2. package/AGENT_REFERENCE.md +684 -561
  3. package/CHANGELOG.md +567 -445
  4. package/CODE-HISTORY.md +29 -1
  5. package/FRAMEWORK-ADAPTERS.md +368 -351
  6. package/FULL-INSTALLATION-GUIDE.md +351 -341
  7. package/README.md +411 -339
  8. package/REFACTORING-SAFELY.md +338 -279
  9. package/SAFE-CHANGES.md +208 -156
  10. package/USER-GUIDE.md +3 -1
  11. package/WHY-PURECONTEXT.md +103 -73
  12. package/WORKFLOW-PR-REVIEW.md +245 -199
  13. package/dist/adapters/astro-preprocessor.d.ts +25 -0
  14. package/dist/adapters/astro-preprocessor.d.ts.map +1 -0
  15. package/dist/adapters/astro-preprocessor.js +50 -0
  16. package/dist/adapters/astro-preprocessor.js.map +1 -0
  17. package/dist/adapters/astro.d.ts +13 -0
  18. package/dist/adapters/astro.d.ts.map +1 -0
  19. package/dist/adapters/astro.js +83 -0
  20. package/dist/adapters/astro.js.map +1 -0
  21. package/dist/adapters/detect-utils.d.ts +38 -0
  22. package/dist/adapters/detect-utils.d.ts.map +1 -0
  23. package/dist/adapters/detect-utils.js +95 -0
  24. package/dist/adapters/detect-utils.js.map +1 -0
  25. package/dist/adapters/nuxt.d.ts +20 -0
  26. package/dist/adapters/nuxt.d.ts.map +1 -1
  27. package/dist/adapters/nuxt.js +128 -13
  28. package/dist/adapters/nuxt.js.map +1 -1
  29. package/dist/adapters/svelte-preprocessor.d.ts +29 -0
  30. package/dist/adapters/svelte-preprocessor.d.ts.map +1 -0
  31. package/dist/adapters/svelte-preprocessor.js +83 -0
  32. package/dist/adapters/svelte-preprocessor.js.map +1 -0
  33. package/dist/adapters/svelte.d.ts +13 -0
  34. package/dist/adapters/svelte.d.ts.map +1 -0
  35. package/dist/adapters/svelte.js +96 -0
  36. package/dist/adapters/svelte.js.map +1 -0
  37. package/dist/adapters/vue.d.ts.map +1 -1
  38. package/dist/adapters/vue.js +87 -20
  39. package/dist/adapters/vue.js.map +1 -1
  40. package/dist/bin.d.ts +16 -0
  41. package/dist/bin.d.ts.map +1 -0
  42. package/dist/bin.js +21 -0
  43. package/dist/bin.js.map +1 -0
  44. package/dist/cli/hooks.d.ts +2 -2
  45. package/dist/cli/hooks.d.ts.map +1 -1
  46. package/dist/cli/hooks.js +123 -135
  47. package/dist/cli/hooks.js.map +1 -1
  48. package/dist/cli/install-writers.d.ts.map +1 -1
  49. package/dist/cli/install-writers.js +281 -36
  50. package/dist/cli/install-writers.js.map +1 -1
  51. package/dist/cli/resolve-node.d.ts +53 -0
  52. package/dist/cli/resolve-node.d.ts.map +1 -0
  53. package/dist/cli/resolve-node.js +84 -0
  54. package/dist/cli/resolve-node.js.map +1 -0
  55. package/dist/config/config-loader.js +24 -0
  56. package/dist/config/config-loader.js.map +1 -1
  57. package/dist/config/config-schema.d.ts +71 -0
  58. package/dist/config/config-schema.d.ts.map +1 -1
  59. package/dist/config/config-schema.js +102 -0
  60. package/dist/config/config-schema.js.map +1 -1
  61. package/dist/core/db/api-keys.d.ts +1 -1
  62. package/dist/core/db/api-keys.d.ts.map +1 -1
  63. package/dist/core/db/api-keys.js +39 -39
  64. package/dist/core/db/api-keys.js.map +1 -1
  65. package/dist/core/db/co-change-store.d.ts +34 -0
  66. package/dist/core/db/co-change-store.d.ts.map +1 -0
  67. package/dist/core/db/co-change-store.js +78 -0
  68. package/dist/core/db/co-change-store.js.map +1 -0
  69. package/dist/core/db/schema.d.ts +3 -3
  70. package/dist/core/db/schema.d.ts.map +1 -1
  71. package/dist/core/db/schema.js +12 -30
  72. package/dist/core/db/schema.js.map +1 -1
  73. package/dist/core/db/sqlite-loader.d.ts +51 -0
  74. package/dist/core/db/sqlite-loader.d.ts.map +1 -0
  75. package/dist/core/db/sqlite-loader.js +94 -0
  76. package/dist/core/db/sqlite-loader.js.map +1 -0
  77. package/dist/core/db/wasm-sqlite.d.ts +4 -0
  78. package/dist/core/db/wasm-sqlite.d.ts.map +1 -0
  79. package/dist/core/db/wasm-sqlite.js +270 -0
  80. package/dist/core/db/wasm-sqlite.js.map +1 -0
  81. package/dist/core/diff-parser.d.ts.map +1 -1
  82. package/dist/core/diff-parser.js +6 -1
  83. package/dist/core/diff-parser.js.map +1 -1
  84. package/dist/core/git-log-reader.d.ts +28 -0
  85. package/dist/core/git-log-reader.d.ts.map +1 -1
  86. package/dist/core/git-log-reader.js +74 -3
  87. package/dist/core/git-log-reader.js.map +1 -1
  88. package/dist/core/index-manager.d.ts.map +1 -1
  89. package/dist/core/index-manager.js +29 -3
  90. package/dist/core/index-manager.js.map +1 -1
  91. package/dist/core/indexing-worker.d.ts +2 -0
  92. package/dist/core/indexing-worker.d.ts.map +1 -1
  93. package/dist/core/indexing-worker.js +2 -0
  94. package/dist/core/indexing-worker.js.map +1 -1
  95. package/dist/core/watcher/file-watcher.d.ts +6 -0
  96. package/dist/core/watcher/file-watcher.d.ts.map +1 -1
  97. package/dist/core/watcher/file-watcher.js +11 -1
  98. package/dist/core/watcher/file-watcher.js.map +1 -1
  99. package/dist/graph/path-resolver.js +86 -17
  100. package/dist/graph/path-resolver.js.map +1 -1
  101. package/dist/index.d.ts +3 -0
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js +11 -1
  104. package/dist/index.js.map +1 -1
  105. package/dist/node-guard.d.ts +15 -0
  106. package/dist/node-guard.d.ts.map +1 -0
  107. package/dist/node-guard.js +33 -0
  108. package/dist/node-guard.js.map +1 -0
  109. package/dist/server/admin-api.d.ts +1 -1
  110. package/dist/server/admin-api.d.ts.map +1 -1
  111. package/dist/server/admin-api.js +2 -2
  112. package/dist/server/admin-api.js.map +1 -1
  113. package/dist/server/auth/api-key.d.ts +1 -1
  114. package/dist/server/auth/api-key.d.ts.map +1 -1
  115. package/dist/server/mcp-server.d.ts.map +1 -1
  116. package/dist/server/mcp-server.js +25 -0
  117. package/dist/server/mcp-server.js.map +1 -1
  118. package/dist/server/tools/analyze-diff.d.ts +8 -0
  119. package/dist/server/tools/analyze-diff.d.ts.map +1 -1
  120. package/dist/server/tools/analyze-diff.js +80 -16
  121. package/dist/server/tools/analyze-diff.js.map +1 -1
  122. package/dist/server/tools/change-synthesis.d.ts +90 -0
  123. package/dist/server/tools/change-synthesis.d.ts.map +1 -0
  124. package/dist/server/tools/change-synthesis.js +236 -0
  125. package/dist/server/tools/change-synthesis.js.map +1 -0
  126. package/dist/server/tools/co-change.d.ts +65 -0
  127. package/dist/server/tools/co-change.d.ts.map +1 -0
  128. package/dist/server/tools/co-change.js +146 -0
  129. package/dist/server/tools/co-change.js.map +1 -0
  130. package/dist/server/tools/compare-change-impact.d.ts +58 -0
  131. package/dist/server/tools/compare-change-impact.d.ts.map +1 -0
  132. package/dist/server/tools/compare-change-impact.js +0 -0
  133. package/dist/server/tools/compare-change-impact.js.map +1 -0
  134. package/dist/server/tools/find-refactoring-opportunities.d.ts +1 -1
  135. package/dist/server/tools/get-architecture-snapshot.d.ts.map +1 -1
  136. package/dist/server/tools/get-architecture-snapshot.js +28 -14
  137. package/dist/server/tools/get-architecture-snapshot.js.map +1 -1
  138. package/dist/server/tools/get-churn-metrics.d.ts.map +1 -1
  139. package/dist/server/tools/get-churn-metrics.js +1 -12
  140. package/dist/server/tools/get-churn-metrics.js.map +1 -1
  141. package/dist/server/tools/get-co-change.d.ts +37 -0
  142. package/dist/server/tools/get-co-change.d.ts.map +1 -0
  143. package/dist/server/tools/get-co-change.js +120 -0
  144. package/dist/server/tools/get-co-change.js.map +1 -0
  145. package/dist/server/tools/get-context-bundle.d.ts.map +1 -1
  146. package/dist/server/tools/get-context-bundle.js +56 -3
  147. package/dist/server/tools/get-context-bundle.js.map +1 -1
  148. package/dist/server/tools/get-entry-points.d.ts +1 -1
  149. package/dist/server/tools/get-symbol-risk.d.ts +25 -0
  150. package/dist/server/tools/get-symbol-risk.d.ts.map +1 -0
  151. package/dist/server/tools/get-symbol-risk.js +60 -0
  152. package/dist/server/tools/get-symbol-risk.js.map +1 -0
  153. package/dist/server/tools/get-symbol-source.d.ts +2 -0
  154. package/dist/server/tools/get-symbol-source.d.ts.map +1 -1
  155. package/dist/server/tools/get-symbol-source.js +18 -1
  156. package/dist/server/tools/get-symbol-source.js.map +1 -1
  157. package/dist/server/tools/index-repo.d.ts.map +1 -1
  158. package/dist/server/tools/index-repo.js +8 -2
  159. package/dist/server/tools/index-repo.js.map +1 -1
  160. package/dist/server/tools/prepare-change.d.ts +61 -0
  161. package/dist/server/tools/prepare-change.d.ts.map +1 -0
  162. package/dist/server/tools/prepare-change.js +262 -0
  163. package/dist/server/tools/prepare-change.js.map +1 -0
  164. package/dist/server/tools/search-symbols.d.ts +2 -0
  165. package/dist/server/tools/search-symbols.d.ts.map +1 -1
  166. package/dist/server/tools/search-symbols.js +33 -0
  167. package/dist/server/tools/search-symbols.js.map +1 -1
  168. package/dist/server/tools/symbol-lines.d.ts +25 -0
  169. package/dist/server/tools/symbol-lines.d.ts.map +1 -0
  170. package/dist/server/tools/symbol-lines.js +40 -0
  171. package/dist/server/tools/symbol-lines.js.map +1 -0
  172. package/dist/server/tools/symbol-risk.d.ts +109 -0
  173. package/dist/server/tools/symbol-risk.d.ts.map +1 -0
  174. package/dist/server/tools/symbol-risk.js +251 -0
  175. package/dist/server/tools/symbol-risk.js.map +1 -0
  176. package/dist/server/tools/verify-change.d.ts +40 -0
  177. package/dist/server/tools/verify-change.d.ts.map +1 -0
  178. package/dist/server/tools/verify-change.js +149 -0
  179. package/dist/server/tools/verify-change.js.map +1 -0
  180. package/dist/version.d.ts +1 -1
  181. package/dist/version.d.ts.map +1 -1
  182. package/dist/version.js +1 -1
  183. package/dist/version.js.map +1 -1
  184. package/docs/01-introduction.md +2 -2
  185. package/docs/02-installation.md +97 -89
  186. package/docs/03-quick-start.md +138 -135
  187. package/docs/04-configuration.md +247 -214
  188. package/docs/05-cli-reference.md +236 -219
  189. package/docs/06-tools-reference.md +902 -499
  190. package/docs/14-transport-modes.md +170 -167
  191. package/docs/18-git-history.md +43 -0
  192. package/docs/23-performance.md +123 -121
  193. package/docs/26-troubleshooting.md +249 -234
  194. package/grammars/README.md +88 -0
  195. package/package.json +7 -25
  196. package/AGENT_INSTRUCTIONS_SHORT.md +0 -150
@@ -1,89 +1,97 @@
1
- # Installation — Reference
2
-
3
- This is the reference page for installation: prerequisites, prebuilt-binary support matrix, verification commands, and upgrade paths.
4
-
5
- For the **user-friendly walkthrough** — per-IDE setup, agent-instructions installer, team server connection — see [`FULL-INSTALLATION-GUIDE.md`](../FULL-INSTALLATION-GUIDE.md) at the project root.
6
-
7
- ---
8
-
9
- ## Prerequisites
10
-
11
- | Requirement | Version | Notes |
12
- |-------------|---------|-------|
13
- | Node.js | >= 18.0.0 | 18, 20, and 22 are tested |
14
- | npm | >= 9.0.0 | Ships with Node 18+ |
15
- | Git | any | Required only for `index_repo` (cloning remote repositories) |
16
-
17
- ---
18
-
19
- ## Install commands
20
-
21
- ```bash
22
- # Recommended: run via npx (no global install needed)
23
- npx purecontext-mcp@latest
24
-
25
- # Or install globally
26
- npm install -g purecontext-mcp@latest
27
- ```
28
-
29
- The `@latest` tag is recommended in AI-client configurations so new versions are picked up without manual upgrade steps.
30
-
31
- ---
32
-
33
- ## Prebuilt binary support matrix
34
-
35
- `better-sqlite3` is the only native dependency. Prebuilt binaries are bundled for:
36
-
37
- | Platform | Node 18 | Node 20 | Node 22 |
38
- |----------|:-------:|:-------:|:-------:|
39
- | Windows x64 | ✓ | ✓ | ✓ |
40
- | macOS x64 | ✓ | ✓ | ✓ |
41
- | macOS arm64 | ✓ | ✓ | ✓ |
42
- | Linux x64 | ✓ | ✓ | ✓ |
43
- | Linux arm64 | ✓ | ✓ | ✓ |
44
-
45
- When your platform matches a row above, `npm install` completes with zero native compilation. For unsupported combinations, `npm install` falls back to a source build, which requires Python 3.x, a C++ toolchain, and `node-gyp`.
46
-
47
- ---
48
-
49
- ## Verification
50
-
51
- ```bash
52
- purecontext-mcp --version
53
- purecontext-mcp config --check
54
- ```
55
-
56
- `config --check` validates the install: confirms Node and SQLite versions, verifies all 34 grammar WASM files load, and reports the effective configuration.
57
-
58
- ---
59
-
60
- ## Upgrade matrix
61
-
62
- | How you installed | Command to upgrade |
63
- |-------------------|--------------------|
64
- | Volta | `volta install purecontext-mcp` |
65
- | npm global | `npm install -g purecontext-mcp@latest` |
66
- | npx (cached) | `npx purecontext-mcp@latest` (forces a fresh fetch) |
67
- | Source / clone | `git pull && npm install && npm run build` |
68
-
69
- > `npm update -g` is not reliable for this package — use `npm install -g ...@latest`.
70
-
71
- **Index compatibility:** SQLite indexes are forward-compatible within a major version (`1.x` → `1.y` keeps existing indexes). Major upgrades (`1.x` → `2.0`) may require a re-index; the CLI warns when it detects an incompatible index.
72
-
73
- ---
74
-
75
- ## Uninstall
76
-
77
- ```bash
78
- npm uninstall -g purecontext-mcp
79
- rm -rf ~/.purecontext # removes indexes, config, savings stats
80
- ```
81
-
82
- ---
83
-
84
- ## Related reference
85
-
86
- - [Configuration](04-configuration.md) — full `config.json` schema and environment variable overrides
87
- - [CLI Reference](05-cli-reference.md) every command and flag
88
- - [Transport Modes](14-transport-modes.md) — stdio vs HTTP/SSE deployment
89
- - [Team Setup & Multi-Tenant](15-team-setup.md) — reference for shared-server config
1
+ # Installation — Reference
2
+
3
+ This is the reference page for installation: prerequisites, prebuilt-binary support matrix, verification commands, and upgrade paths.
4
+
5
+ For the **user-friendly walkthrough** — per-IDE setup, agent-instructions installer, team server connection — see [`FULL-INSTALLATION-GUIDE.md`](../FULL-INSTALLATION-GUIDE.md) at the project root.
6
+
7
+ ---
8
+
9
+ ## Prerequisites
10
+
11
+ | Requirement | Version | Notes |
12
+ |-------------|---------|-------|
13
+ | Node.js | >= 18.0.0 | 18, 20, and 22 are tested |
14
+ | npm | >= 9.0.0 | Ships with Node 18+ |
15
+ | Git | any | Required only for `index_repo` (cloning remote repositories) |
16
+
17
+ ---
18
+
19
+ ## Install commands
20
+
21
+ ```bash
22
+ # Recommended: run via npx (no global install needed)
23
+ npx purecontext-mcp@latest
24
+
25
+ # Or install globally
26
+ npm install -g purecontext-mcp@latest
27
+ ```
28
+
29
+ The `@latest` tag is recommended in AI-client configurations so new versions are picked up without manual upgrade steps.
30
+
31
+ ---
32
+
33
+ ## Prebuilt binary support matrix
34
+
35
+ `better-sqlite3` is the only native dependency. Prebuilt binaries are bundled for:
36
+
37
+ | Platform | Node 18 | Node 20 | Node 22 |
38
+ |----------|:-------:|:-------:|:-------:|
39
+ | Windows x64 | ✓ | ✓ | ✓ |
40
+ | macOS x64 | ✓ | ✓ | ✓ |
41
+ | macOS arm64 | ✓ | ✓ | ✓ |
42
+ | Linux x64 | ✓ | ✓ | ✓ |
43
+ | Linux arm64 | ✓ | ✓ | ✓ |
44
+
45
+ When your platform matches a row above, `npm install` completes with zero native compilation. For unsupported combinations, `npm install` falls back to a source build, which requires Python 3.x, a C++ toolchain, and `node-gyp`.
46
+
47
+ ### Runs on any Node ≥ 18 (WASM fallback)
48
+
49
+ The native binary above is an **optimization, not a requirement**. At runtime, if the native `better-sqlite3` addon can't be loaded — you're on a Node version without a matching prebuild (19, 21, 23, 24+), a per-project Node manager like Volta pins a different version than the one the binary was built for, or the build simply isn't present — PureContext automatically falls back to a pure-**WASM** SQLite engine (`@sqlite.org/sqlite-wasm`) that is ABI-independent.
50
+
51
+ The fallback is full-featured (FTS5 search, transactions, the whole schema) — only somewhat slower on large indexes. Backend selection is automatic and logged: you'll see `SQLite backend: WASM (@sqlite.org/sqlite-wasm)`. Set `PCTX_SQLITE_BACKEND=wasm` to force it.
52
+
53
+ Net effect: **PureContext works on any Node ≥ 18**, with or without a version manager. Below Node 18 it exits at startup with a clear message rather than a cryptic failure.
54
+
55
+ ---
56
+
57
+ ## Verification
58
+
59
+ ```bash
60
+ purecontext-mcp --version
61
+ purecontext-mcp config --check
62
+ ```
63
+
64
+ `config --check` validates the install: confirms Node and SQLite versions, verifies all 34 grammar WASM files load, and reports the effective configuration.
65
+
66
+ ---
67
+
68
+ ## Upgrade matrix
69
+
70
+ | How you installed | Command to upgrade |
71
+ |-------------------|--------------------|
72
+ | Volta | `volta install purecontext-mcp` |
73
+ | npm global | `npm install -g purecontext-mcp@latest` |
74
+ | npx (cached) | `npx purecontext-mcp@latest` (forces a fresh fetch) |
75
+ | Source / clone | `git pull && npm install && npm run build` |
76
+
77
+ > `npm update -g` is not reliable for this package — use `npm install -g ...@latest`.
78
+
79
+ **Index compatibility:** SQLite indexes are forward-compatible within a major version (`1.x` → `1.y` keeps existing indexes). Major upgrades (`1.x` → `2.0`) may require a re-index; the CLI warns when it detects an incompatible index.
80
+
81
+ ---
82
+
83
+ ## Uninstall
84
+
85
+ ```bash
86
+ npm uninstall -g purecontext-mcp
87
+ rm -rf ~/.purecontext # removes indexes, config, savings stats
88
+ ```
89
+
90
+ ---
91
+
92
+ ## Related reference
93
+
94
+ - [Configuration](04-configuration.md) — full `config.json` schema and environment variable overrides
95
+ - [CLI Reference](05-cli-reference.md) — every command and flag
96
+ - [Transport Modes](14-transport-modes.md) — stdio vs HTTP/SSE deployment
97
+ - [Team Setup & Multi-Tenant](15-team-setup.md) — reference for shared-server config
@@ -1,135 +1,138 @@
1
- # Quick Start
2
-
3
-
4
- ## Step 1 — Connect to Claude Code
5
-
6
- ```bash
7
- # Recommended: use npx (no global install needed, always up-to-date)
8
- claude mcp add purecontext-mcp -- npx purecontext-mcp
9
-
10
- # Or, if installed globally:
11
- claude mcp add purecontext-mcp purecontext-mcp
12
- ```
13
-
14
- Verify the connection:
15
-
16
- ```bash
17
- claude mcp list
18
- # purecontext-mcp connected npx purecontext-mcp
19
- ```
20
-
21
- ## Step 2 — Index your project
22
-
23
- In a Claude Code conversation, ask:
24
-
25
- > "Use index_folder to index /path/to/my-project."
26
-
27
- Or more naturally:
28
-
29
- > "Index this project so I can search its symbols."
30
-
31
- Claude will call `index_folder`. A typical response looks like:
32
-
33
- ```json
34
- {
35
- "repoId": "a1b2c3d4e5f60001",
36
- "filesIndexed": 342,
37
- "symbolsExtracted": 4821,
38
- "durationMs": 1240,
39
- "languages": ["typescript", "javascript"],
40
- "adapters": ["vue", "nuxt"]
41
- }
42
- ```
43
-
44
- Re-indexing is incremental — only files whose content has changed are re-parsed. You can call `index_folder` again at any time; it is fast on subsequent runs.
45
-
46
- ## Step 3 — Explore the project structure
47
-
48
- ```
49
- Get the repo outline for my project.
50
- ```
51
-
52
- Claude calls `get_repo_outline`, which returns all files and their top-level symbols — a token-efficient project map.
53
-
54
- ## Step 4 — Search for symbols
55
-
56
- ```
57
- Search for functions named 'authenticate'.
58
- ```
59
-
60
- Claude calls `search_symbols`:
61
-
62
- ```json
63
- {
64
- "symbols": [
65
- {
66
- "id": "8f3a2c1d0e4b5f9a",
67
- "name": "authenticateUser",
68
- "kind": "function",
69
- "filePath": "src/auth/validator.ts",
70
- "signature": "function authenticateUser(credentials: Credentials): Promise<User>",
71
- "summary": "Validates user credentials and returns an authenticated User object."
72
- }
73
- ]
74
- }
75
- ```
76
-
77
- Note: `search_symbols` returns signatures and summaries — **no source code**. This keeps the response tiny.
78
-
79
- ## Step 5 — Retrieve source when you need it
80
-
81
- ```
82
- Get the source for the authenticateUser symbol.
83
- ```
84
-
85
- Claude calls `get_symbol_source` using the `id` from step 4 and gets back just those lines — not the whole file.
86
-
87
- ## Example workflow
88
-
89
- ```
90
- User: "Find the authentication logic in this project."
91
-
92
- Claude:
93
- 1. search_symbols(query: "auth", kind: "function")
94
- → Returns: authenticateUser, validateToken, hashPassword (3 matches, ~80 tokens)
95
-
96
- 2. get_symbol_source(symbolId: "authenticateUser-id")
97
- → Returns: 45 lines of source (~150 tokens)
98
-
99
- Total: ~230 tokens
100
- Without PureContext: read the 800-line auth file → ~2,000 tokens
101
- Savings: 88%
102
- ```
103
-
104
- ## What to try next
105
-
106
- | Task | Tool |
107
- |------|------|
108
- | See all symbols in a file | `get_file_outline` |
109
- | Find what a function imports | `get_context_bundle` |
110
- | Find what uses a function | `get_blast_radius` |
111
- | Find unused exports | `find_dead_code` |
112
- | Search by meaning, not name | `search_semantic` |
113
- | Text search (like grep) | `search_text` |
114
-
115
- ## Connecting to a team server
116
-
117
- If your team runs a shared PureContext server:
118
-
119
- ```bash
120
- claude mcp add purecontext-remote \
121
- --transport http \
122
- --url https://purecontext.mycompany.com/mcp/sse \
123
- --header "Authorization: Bearer pctx_yourpersonalkey"
124
- ```
125
-
126
- See [Team Setup](15-team-setup.md) for full instructions.
127
-
128
- ## Generating a config file
129
-
130
- ```bash
131
- purecontext-mcp config --init
132
- # Creates ~/.purecontext/config.json with defaults and comments
133
- ```
134
-
135
- See [Configuration](04-configuration.md) for all available options.
1
+ # Quick Start
2
+
3
+
4
+ ## Step 1 — Connect to Claude Code
5
+
6
+ ```bash
7
+ # Recommended: registers the server (pinned to your global Node) + adds workflow rules
8
+ npx purecontext-mcp install claude
9
+
10
+ # Or register the server manually with npx:
11
+ claude mcp add purecontext-mcp -- npx purecontext-mcp
12
+
13
+ # Or, if installed globally:
14
+ claude mcp add purecontext-mcp purecontext-mcp
15
+ ```
16
+
17
+ Verify the connection:
18
+
19
+ ```bash
20
+ claude mcp list
21
+ # purecontext-mcp connected npx purecontext-mcp
22
+ ```
23
+
24
+ ## Step 2 — Index your project
25
+
26
+ In a Claude Code conversation, ask:
27
+
28
+ > "Use index_folder to index /path/to/my-project."
29
+
30
+ Or more naturally:
31
+
32
+ > "Index this project so I can search its symbols."
33
+
34
+ Claude will call `index_folder`. A typical response looks like:
35
+
36
+ ```json
37
+ {
38
+ "repoId": "a1b2c3d4e5f60001",
39
+ "filesIndexed": 342,
40
+ "symbolsExtracted": 4821,
41
+ "durationMs": 1240,
42
+ "languages": ["typescript", "javascript"],
43
+ "adapters": ["vue", "nuxt"]
44
+ }
45
+ ```
46
+
47
+ Re-indexing is incremental — only files whose content has changed are re-parsed. You can call `index_folder` again at any time; it is fast on subsequent runs.
48
+
49
+ ## Step 3 Explore the project structure
50
+
51
+ ```
52
+ Get the repo outline for my project.
53
+ ```
54
+
55
+ Claude calls `get_repo_outline`, which returns all files and their top-level symbols — a token-efficient project map.
56
+
57
+ ## Step 4 — Search for symbols
58
+
59
+ ```
60
+ Search for functions named 'authenticate'.
61
+ ```
62
+
63
+ Claude calls `search_symbols`:
64
+
65
+ ```json
66
+ {
67
+ "symbols": [
68
+ {
69
+ "id": "8f3a2c1d0e4b5f9a",
70
+ "name": "authenticateUser",
71
+ "kind": "function",
72
+ "filePath": "src/auth/validator.ts",
73
+ "signature": "function authenticateUser(credentials: Credentials): Promise<User>",
74
+ "summary": "Validates user credentials and returns an authenticated User object."
75
+ }
76
+ ]
77
+ }
78
+ ```
79
+
80
+ Note: `search_symbols` returns signatures and summaries — **no source code**. This keeps the response tiny.
81
+
82
+ ## Step 5 — Retrieve source when you need it
83
+
84
+ ```
85
+ Get the source for the authenticateUser symbol.
86
+ ```
87
+
88
+ Claude calls `get_symbol_source` using the `id` from step 4 and gets back just those lines — not the whole file.
89
+
90
+ ## Example workflow
91
+
92
+ ```
93
+ User: "Find the authentication logic in this project."
94
+
95
+ Claude:
96
+ 1. search_symbols(query: "auth", kind: "function")
97
+ → Returns: authenticateUser, validateToken, hashPassword (3 matches, ~80 tokens)
98
+
99
+ 2. get_symbol_source(symbolId: "authenticateUser-id")
100
+ Returns: 45 lines of source (~150 tokens)
101
+
102
+ Total: ~230 tokens
103
+ Without PureContext: read the 800-line auth file → ~2,000 tokens
104
+ Savings: 88%
105
+ ```
106
+
107
+ ## What to try next
108
+
109
+ | Task | Tool |
110
+ |------|------|
111
+ | See all symbols in a file | `get_file_outline` |
112
+ | Find what a function imports | `get_context_bundle` |
113
+ | Find what uses a function | `get_blast_radius` |
114
+ | Find unused exports | `find_dead_code` |
115
+ | Search by meaning, not name | `search_semantic` |
116
+ | Text search (like grep) | `search_text` |
117
+
118
+ ## Connecting to a team server
119
+
120
+ If your team runs a shared PureContext server:
121
+
122
+ ```bash
123
+ claude mcp add purecontext-remote \
124
+ --transport http \
125
+ --url https://purecontext.mycompany.com/mcp/sse \
126
+ --header "Authorization: Bearer pctx_yourpersonalkey"
127
+ ```
128
+
129
+ See [Team Setup](15-team-setup.md) for full instructions.
130
+
131
+ ## Generating a config file
132
+
133
+ ```bash
134
+ purecontext-mcp config --init
135
+ # Creates ~/.purecontext/config.json with defaults and comments
136
+ ```
137
+
138
+ See [Configuration](04-configuration.md) for all available options.