purecontext-mcp 1.5.0 → 1.5.2

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/BENCHMARKS.md ADDED
@@ -0,0 +1,153 @@
1
+ # Benchmarks
2
+
3
+ PureContext is benchmarked on **87 real-world open-source projects** spanning 29 language groups. This page reports measured search precision so you can decide whether PureContext fits your stack before installing.
4
+
5
+ The benchmarks are reproducible — every project, query set, and result file lives in the `benchmarks/` directory of the source repository.
6
+
7
+ ---
8
+
9
+ ## Methodology
10
+
11
+ For each project:
12
+
13
+ 1. **Index it** with PureContext.
14
+ 2. **Run 25 ground-truth queries** drawn from real symbol names and natural-language descriptions of what each symbol does. Ground-truth answers are the curated "correct" symbols a developer would expect.
15
+ 3. **Score three metrics:**
16
+ - **P@1** (Precision at rank 1): the correct symbol is the top result.
17
+ - **P@3** (Precision at rank 3): the correct symbol is in the top 3.
18
+ - **R@5** (Recall at top 5): the correct symbol appears anywhere in the top 5.
19
+
20
+ P@1 is the most demanding metric — it measures how often the *first* answer is the right one without the agent having to scroll through alternatives. P@3 and R@5 reflect what an agent actually consumes in a real session.
21
+
22
+ Ground-truth query sets are intentionally curated by hand (`benchmarks/<project>/queries.json`), not auto-generated, and can be inspected or extended.
23
+
24
+ ---
25
+
26
+ ## Per-language averages
27
+
28
+ Group averages over all benchmarked projects in each language.
29
+
30
+ | Language group | Projects | P@1 | P@3 | R@5 |
31
+ |----------------|---------:|----:|----:|----:|
32
+ | GraphQL | 3 | **65%** | 81% | 87% |
33
+ | Nix | 2 | **60%** | 74% | 76% |
34
+ | GDScript | 2 | **58%** | 78% | 88% |
35
+ | Terraform / HCL | 2 | **53%** | 64% | 67% |
36
+ | Protobuf | 3 | **51%** | 51% | 60% |
37
+ | TypeScript / JavaScript | 4 | **44%** | 57% | 61% |
38
+ | Lua | 2 | **36%** | 56% | 64% |
39
+ | PHP | 2 | **36%** | 54% | 58% |
40
+ | Python | 2 | **34%** | 46% | 56% |
41
+ | Rust | 2 | **34%** | 50% | 60% |
42
+ | OpenAPI / YAML | 3 | **31%** | 32% | 36% |
43
+ | Kotlin | 2 | **30%** | 36% | 40% |
44
+ | Go | 1 | **28%** | 56% | 76% |
45
+ | Java | 1 | **24%** | 32% | 44% |
46
+ | SQL | 3 | **23%** | 44% | 52% |
47
+ | C / C++ | 6 | **13%** | 22% | 30% |
48
+ | Scala | 2 | 12% | 20% | 32% |
49
+ | Swift | 3 | 11% | 19% | 23% |
50
+ | Ruby | 4 | 10% | 16% | 20% |
51
+ | C# / .NET | 2 | 10% | 16% | 18% |
52
+ | Dart / Flutter | 2 | 8% | 14% | 18% |
53
+ | Objective-C | 3 | 5% | 11% | 16% |
54
+ | Haskell | 2 | 0% | 16% | 22% |
55
+
56
+ Numbers are averages across the projects in each row. Bold P@1 values mark groups where PureContext consistently produces the right answer at rank 1 on a non-trivial fraction of queries.
57
+
58
+ ---
59
+
60
+ ## Per-project highlights
61
+
62
+ Selected projects from the full set of 87 — full results in `benchmarks/<project>/results/purecontext.json`.
63
+
64
+ | Project | Language / framework | P@1 | P@3 | R@5 | Symbols indexed |
65
+ |---------|----------------------|----:|----:|----:|----------------:|
66
+ | nestjs-ecommerce-api | TypeScript / NestJS | 84% | 100% | 100% | 3,314 |
67
+ | terraform-aws-eks | Terraform / HCL | 84% | 92% | 96% | 1,589 |
68
+ | dialogic | GDScript | 84% | 100% | 100% | 3,025 |
69
+ | grpc-proto | Protobuf | 72% | 80% | 92% | 260 |
70
+ | saleor | GraphQL / Python | 72% | 88% | 96% | 27,719 |
71
+ | graphql-code-generator | TypeScript / GraphQL | 72% | 84% | 84% | 3,602 |
72
+ | terraform-aws-components | Terraform / HCL | 68% | 80% | 84% | 14,914 |
73
+ | kubernetes-openapi | OpenAPI / YAML | 64% | 68% | 80% | 4,739 |
74
+ | eu-za-tebe | PHP / CodeIgniter | 60% | 72% | 72% | 5,575 |
75
+ | envoy | Protobuf / C++ | 60% | 60% | 68% | 44,739 |
76
+ | home-manager | Nix | 60% | 72% | 76% | 9,023 |
77
+ | flake-utils | Nix | 60% | 76% | 76% | 50 |
78
+ | kurirfe | JavaScript / Nuxt | 56% | 60% | 64% | 382 |
79
+ | love | C++ / Lua | 52% | 80% | 88% | 26,165 |
80
+ | graphql-engine | GraphQL / Rust / Haskell | 52% | 72% | 80% | 40,417 |
81
+ | maven | XML / Java | 48% | 52% | 56% | 15,284 |
82
+ | jaffle-shop | SQL / dbt | 44% | 80% | 84% | 54 |
83
+ | ecrad | Fortran | 44% | 60% | 64% | 684 |
84
+ | ktor | Kotlin | 44% | 48% | 52% | 11,974 |
85
+ | tokio | Rust | 40% | 60% | 72% | 2,799 |
86
+ | phoenix | Elixir / Phoenix | 36% | 64% | 76% | 1,317 |
87
+ | neovim | Lua / C | 36% | 68% | 80% | 9,514 |
88
+ | kong | Lua / Kong | 36% | 52% | 56% | 4,210 |
89
+ | sqitch | Perl | 36% | 60% | 72% | 1,143 |
90
+ | rabbitmq-server | Erlang | 36% | 48% | 52% | 32,585 |
91
+ | angular-realworld | Angular / TypeScript | 36% | 68% | 72% | 127 |
92
+ | jhipster-sample-app | Angular / TypeScript | 32% | 36% | 48% | 1,302 |
93
+ | godot-demo-projects | GDScript | 32% | 56% | 76% | 3,274 |
94
+ | stripe-openapi | OpenAPI / YAML | 28% | 28% | 28% | 43,078 |
95
+ | listmonk | Go | 28% | 56% | 76% | 966 |
96
+ | serde | Rust | 28% | 40% | 48% | 293 |
97
+ | emqx | Erlang | 28% | 32% | 36% | 43,147 |
98
+ | infisical | React / TypeScript | 8% | 28% | 36% | 27,295 |
99
+
100
+ The TypeScript/NestJS result (84% P@1, 100% P@3) is the strongest single-project number — NestJS routes and providers map cleanly to the decorator-based extraction in PureContext's framework adapter.
101
+
102
+ ---
103
+
104
+ ## Where PureContext wins clearly
105
+
106
+ **Framework-aware extraction.** Adapters for NestJS, Terraform, Protobuf, GraphQL, and dbt-style SQL pull domain symbols (routes, resources, services, schemas, models) out as first-class entries rather than relying on generic function/class extraction. This is where the highest P@1 numbers come from.
107
+
108
+ **Cross-language identifier aliases.** Neovim's C API (`nvim_open_win`) is called from Lua as `vim.api.nvim_open_win`. PureContext stores the Lua alias as an FTS token so semantic queries find the C implementation (36% P@1 on neovim).
109
+
110
+ **Handler depth where it matters.** Ruby DSL macros (`has_many`, `belongs_to`, `before_action`), Rust impl methods stored as bare names with identity-exact ranking, Erlang functions stored without arity suffix, and ObjC selectors built as `setObject:forKey:` — each lift dynamic-language search precision substantially.
111
+
112
+ **IaC and schema languages.** Terraform/HCL extraction (resources, modules, variables, outputs) and OpenAPI handler with hyphen-aware regex give PureContext competitive numbers on infrastructure repos that traditional code-search tools miss.
113
+
114
+ ## Where PureContext currently scores low
115
+
116
+ These are honest gaps, tracked as P1 work:
117
+
118
+ - **Swift (11% P@1).** Generic type parameters are stripped and protocol types lack semantic summaries. Concept-based queries like *"protocol that describes how application state evolves"* fail to match `Reducer<State, Action>`.
119
+ - **Scala (12% P@1).** Heavily generic types (`ZIO[R, E, A]`, `ZLayer[RIn, E, ROut]`) have no FTS overlap with their semantic descriptions; `given`/`using` instances are not extracted.
120
+ - **Haskell (0% P@1, 16% P@3).** Record types and functions have no docstrings by default; FTS content is name-tokens only. Symbols enter the top-5 (R@5 = 22%) but never rank first.
121
+ - **Objective-C (5% P@1).** The handler was strengthened in 1.5.0 (full `@interface`/`@protocol` extraction and selector building) — numbers will rise on the next benchmark cycle.
122
+ - **Large monorepos with abstract type queries (flutter SDK, novu).** Queries like *"abstract widget that owns mutable state"* don't tokenize against `StatefulWidget` without semantic embeddings on top. Improving this requires summary enrichment, not ranker tweaks.
123
+
124
+ ---
125
+
126
+ ## Token efficiency
127
+
128
+ PureContext achieves near-100% token reduction versus the naive "read every source file" baseline on every benchmarked project. Token savings are not the main differentiator — what matters is **whether the returned symbols are correct**, which is what the P@1 / P@3 / R@5 numbers above measure.
129
+
130
+ ---
131
+
132
+ ## Reproducing the benchmark
133
+
134
+ ```bash
135
+ git clone https://github.com/goranocokoljic/pure-context
136
+ cd pure-context
137
+ npm install
138
+ npm run build
139
+ npm run benchmark -- --project nestjs-ecommerce-api
140
+ ```
141
+
142
+ Results are written to `benchmarks/<project>/results/purecontext.json`. Ground-truth query sets live in `benchmarks/<project>/queries.json` and can be inspected, extended, or replaced.
143
+
144
+ ---
145
+
146
+ ## Limitations of these numbers
147
+
148
+ - **25 queries per project is a small sample.** Group averages over multiple projects are more reliable than any single project's score.
149
+ - **Ground-truth queries are biased toward what humans ask AI agents** — symbol lookups by name and short natural-language descriptions. They do not measure agent-driven graph traversal (`get_blast_radius`, `get_call_hierarchy`, etc.), which is where most of the real value in an MCP server shows up in production agent loops.
150
+ - **Numbers reflect PureContext 1.5.0 (May 2026).** Each release shifts results — re-run the benchmark before making decisions on stale data.
151
+ - **Project mix is convenience-sampled.** Projects were selected to cover language and framework breadth, not weighted by GitHub popularity or download counts. Some categories (Web/TypeScript, IaC) are deliberately over-represented; mobile and embedded categories are under-represented.
152
+
153
+ The full per-project breakdown including symbol counts, indexing speeds, and language-group narratives is generated from the same benchmark runs and lives in the `dev-docs/benchmarks/` directory of the source repository (gitignored from npm releases).
@@ -0,0 +1,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
+ ```bash
56
+ claude mcp add purecontext-mcp -- npx purecontext-mcp@latest
57
+ ```
58
+
59
+ Verify:
60
+
61
+ ```bash
62
+ claude mcp list
63
+ # purecontext-mcp connected npx purecontext-mcp
64
+ ```
65
+
66
+ ### Claude Desktop
67
+
68
+ Edit `~/.claude/claude_desktop_config.json` (create it if it doesn't exist):
69
+
70
+ ```json
71
+ {
72
+ "mcpServers": {
73
+ "purecontext": {
74
+ "command": "npx",
75
+ "args": ["purecontext-mcp@latest"]
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ If you installed globally (`npm install -g purecontext-mcp`), you can use the binary directly:
82
+
83
+ ```json
84
+ {
85
+ "mcpServers": {
86
+ "purecontext": {
87
+ "command": "purecontext-mcp@latest"
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ Restart Claude Desktop after saving the file.
94
+
95
+ ### Cursor
96
+
97
+ Create or edit `.cursor/mcp.json` in your project directory for a project-scoped connection, or `~/.cursor/mcp.json` for a global one:
98
+
99
+ ```json
100
+ {
101
+ "mcpServers": {
102
+ "purecontext": {
103
+ "command": "npx",
104
+ "args": ["purecontext-mcp@latest"]
105
+ }
106
+ }
107
+ }
108
+ ```
109
+
110
+ Reload the Cursor window after saving (`Ctrl+Shift+P` → "Developer: Reload Window").
111
+
112
+ ### Windsurf
113
+
114
+ Open Windsurf Settings and navigate to the MCP section, or edit the MCP configuration file directly:
115
+
116
+ ```json
117
+ {
118
+ "mcpServers": {
119
+ "purecontext": {
120
+ "command": "npx",
121
+ "args": ["purecontext-mcp@latest"]
122
+ }
123
+ }
124
+ }
125
+ ```
126
+
127
+ ### VS Code (with MCP support)
128
+
129
+ Create `.vscode/mcp.json` in your project:
130
+
131
+ ```json
132
+ {
133
+ "servers": {
134
+ "purecontext": {
135
+ "type": "stdio",
136
+ "command": "npx",
137
+ "args": ["purecontext-mcp@latest"]
138
+ }
139
+ }
140
+ }
141
+ ```
142
+
143
+ ### Connecting to a shared team server (HTTP)
144
+
145
+ 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:
146
+
147
+ **Claude Code CLI:**
148
+
149
+ ```bash
150
+ claude mcp add purecontext-shared \
151
+ --transport http \
152
+ --url https://purecontext.yourcompany.com/mcp/sse \
153
+ --header "Authorization: Bearer pctx_yourpersonalkey"
154
+ ```
155
+
156
+ **Claude Desktop / Cursor / Windsurf (config file):**
157
+
158
+ ```json
159
+ {
160
+ "mcpServers": {
161
+ "purecontext": {
162
+ "transport": "http",
163
+ "url": "https://purecontext.yourcompany.com/mcp/sse",
164
+ "headers": {
165
+ "Authorization": "Bearer pctx_yourpersonalkey"
166
+ }
167
+ }
168
+ }
169
+ }
170
+ ```
171
+
172
+ 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.
173
+
174
+ ---
175
+
176
+ ## Teaching your AI agent to use PureContext well
177
+
178
+ 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.
179
+
180
+ 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.
181
+
182
+ ### Recommended: `purecontext-mcp install`
183
+
184
+ PureContext ships with a multi-IDE installer that writes the workflow rules into the conventions file each tool expects. Run it once inside your project root:
185
+
186
+ ```bash
187
+ npx purecontext-mcp install all
188
+ ```
189
+
190
+ This auto-detects which AI tools are configured in the project (by looking for marker files such as `.cursor/`, `.windsurfrules`, `CLAUDE.md`, `.continue/`, etc.) and installs the rules for each.
191
+
192
+ When no `--scope` flag is given, the CLI prompts you to choose where to install:
193
+
194
+ ```
195
+ Where should PureContext be installed?
196
+ 1) Local — this project only
197
+ 2) Global — all projects (user-level config)
198
+ 3) Both
199
+ ```
200
+
201
+ Pass `--scope` to skip the prompt:
202
+
203
+ ```bash
204
+ npx purecontext-mcp install all --scope=local # this project only
205
+ npx purecontext-mcp install all --scope=global # user-level, all projects
206
+ npx purecontext-mcp install all --scope=both # both places at once
207
+ ```
208
+
209
+ For a single tool:
210
+
211
+ ```bash
212
+ npx purecontext-mcp install cursor --scope=global
213
+ npx purecontext-mcp install windsurf
214
+ npx purecontext-mcp install continue
215
+ # ...etc.
216
+ ```
217
+
218
+ Useful flags:
219
+
220
+ ```bash
221
+ npx purecontext-mcp install --list # show detection state, write nothing
222
+ npx purecontext-mcp install all --dry-run # preview which writers would run
223
+ ```
224
+
225
+ ### Supported tools
226
+
227
+ | Tool | Local | Global | Notes |
228
+ |------|-------|--------|-------|
229
+ | `claude` | `CLAUDE.md` in project | `~/.claude/CLAUDE.md` + hooks | Global installs PostToolUse re-index, PreCompact snapshot, and edit guard. |
230
+ | `cursor` | `.cursor/rules/purecontext.mdc` | `~/.cursor/rules/purecontext.mdc` | MDC frontmatter with `alwaysApply: true`. |
231
+ | `windsurf` | `.windsurfrules` | `~/.windsurfrules` | Marked block appended or replaced in place. |
232
+ | `continue` | `.continue/config.json` | `~/.continue/config.json` | JSON-aware merge; other fields are preserved. |
233
+ | `cline` | `.clinerules` | local only | No known global config path. |
234
+ | `roo-code` | `.roo/rules-code.md` | local only | No known global config path. |
235
+ | `vscode` | `.github/copilot-instructions.md` | local only | Picked up by GitHub Copilot in VS Code. |
236
+ | `claude-desktop` | always global | always global | Merges MCP server entry; leaves other servers untouched. |
237
+
238
+ ### Idempotency
239
+
240
+ Every writer is safe to re-run. The Markdown writers wrap their content in HTML comment markers:
241
+
242
+ ```html
243
+ <!-- purecontext-mcp-start -->
244
+ ... PureContext workflow rules ...
245
+ <!-- purecontext-mcp-end -->
246
+ ```
247
+
248
+ 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.
249
+
250
+ ### Manual install (if you'd rather paste)
251
+
252
+ The two source-of-truth files are at the repository root:
253
+
254
+ - **`AGENT_INSTRUCTIONS_SHORT.md`** — Compact (~2 KB). Mandatory first step, tool selection table, core rules, common usage patterns. Use for agents with limited system prompt space.
255
+ - **`AGENT_INSTRUCTIONS.md`** — Full (~15 KB). Adds parameter notes, every usage pattern, known limitations, decision trees, anti-patterns. Use for complex multi-step workflows.
256
+
257
+ To use these manually:
258
+
259
+ ```bash
260
+ # Claude Code
261
+ cat AGENT_INSTRUCTIONS_SHORT.md >> CLAUDE.md
262
+
263
+ # Cursor — paste into .cursorrules or via Cursor Settings → Rules
264
+ # Windsurf — paste into .windsurfrules or workspace memory
265
+ # Anything else — paste into whatever rule/memory config it supports
266
+ ```
267
+
268
+ ---
269
+
270
+ ## Verifying the installation
271
+
272
+ ```bash
273
+ purecontext-mcp --version
274
+ # 1.x.x
275
+
276
+ purecontext-mcp config --check
277
+ # ✓ Node.js 20.11.0
278
+ # ✓ SQLite (better-sqlite3 9.x)
279
+ # ✓ Grammar: tree-sitter-typescript.wasm
280
+ # ✓ Grammar: tree-sitter-javascript.wasm
281
+ # ... (all 34 grammars)
282
+ # ✓ Config: ~/.purecontext/config.json
283
+ ```
284
+
285
+ `config --check` validates the installation, verifies all grammar files are present, and reports the effective configuration.
286
+
287
+ ## Upgrading
288
+
289
+ Run the command that matches how you installed PureContext:
290
+
291
+ **Installed with Volta:**
292
+ ```bash
293
+ volta install purecontext-mcp
294
+ ```
295
+
296
+ **Installed with npm globally:**
297
+ ```bash
298
+ npm install -g purecontext-mcp@latest
299
+ ```
300
+
301
+ **Running via npx (no global install):** npx may serve a cached older version. Force the latest:
302
+ ```bash
303
+ npx purecontext-mcp@latest
304
+ ```
305
+ To always get the latest version automatically, use `purecontext-mcp@latest` in your MCP client config instead of the bare package name.
306
+
307
+ **Installed from source:**
308
+ ```bash
309
+ cd /path/to/purecontext-mcp
310
+ git pull
311
+ npm install
312
+ npm run build
313
+ ```
314
+
315
+ > **Note:** `npm update -g purecontext-mcp` does not work reliably — use `npm install -g purecontext-mcp@latest` instead.
316
+
317
+ 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.
318
+
319
+ ## Install from source
320
+
321
+ Use this when contributing, testing unreleased features, or running a local build.
322
+
323
+ ```bash
324
+ git clone <repository-url> purecontext-mcp
325
+ cd purecontext-mcp
326
+ npm install
327
+ npm run build
328
+ npm link # makes 'purecontext-mcp' available globally from this build
329
+ ```
330
+
331
+ ## Uninstalling
332
+
333
+ ```bash
334
+ npm uninstall -g purecontext-mcp
335
+ ```
336
+
337
+ This removes the binaries. Index files and configuration are not removed. To clean everything up:
338
+
339
+ ```bash
340
+ rm -rf ~/.purecontext # Removes indexes, config, savings stats
341
+ ```
package/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/purecontext-mcp.svg)](https://www.npmjs.com/package/purecontext-mcp)
4
4
  [![Stable](https://img.shields.io/badge/stability-stable-brightgreen.svg)](docs/27-api-stability.md)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
5
6
 
6
7
  **Stop burning context tokens reading whole files.** PureContext MCP indexes your codebase and lets AI agents retrieve exactly the code they need — a single function, a class, a route definition — without loading hundreds of irrelevant lines first.
7
8
 
@@ -19,11 +20,11 @@ But token savings are the mechanism, not the point. The point is that AI gets be
19
20
 
20
21
  ```bash
21
22
  # 1. Connect to Claude Code (no global install needed)
22
- claude mcp add purecontext-mcp -- npx purecontext-mcp
23
+ claude mcp add purecontext-mcp -- npx purecontext-mcp@latest
23
24
 
24
25
  # 2. Inside your project, install the workflow rules
25
26
  # (auto-detects Claude / Cursor / Windsurf / Continue / Cline / Roo Code / VS Code / Claude Desktop)
26
- npx purecontext-mcp install all
27
+ npx purecontext-mcp@latest install all
27
28
  ```
28
29
 
29
30
  Then in a Claude Code conversation:
@@ -36,6 +37,45 @@ That's it. Claude will index your codebase and you can start navigating it by na
36
37
 
37
38
  ---
38
39
 
40
+ ## What this looks like in practice
41
+
42
+ A typical "find and understand" conversation, before vs. after:
43
+
44
+ **Without PureContext**
45
+
46
+ ```
47
+ You: Where do we handle Stripe webhook signature verification?
48
+ Claude: I'll search the codebase.
49
+ [reads src/api/webhooks/stripe.ts — 412 lines, ~3,100 tokens]
50
+ [reads src/lib/stripe-client.ts — 287 lines, ~2,150 tokens]
51
+ [reads src/middleware/webhook.ts — 198 lines, ~1,490 tokens]
52
+ Verification happens in verifyStripeSignature() at line 87 of stripe.ts.
53
+ Total context used: ~6,740 tokens
54
+ ```
55
+
56
+ **With PureContext**
57
+
58
+ ```
59
+ You: Where do we handle Stripe webhook signature verification?
60
+ Claude: search_symbols(query: "stripe webhook signature")
61
+ → 3 matches, 78 tokens
62
+ get_symbol_source(symbolId: "verifyStripeSignature")
63
+ → 32 lines, 180 tokens
64
+ verifyStripeSignature() at src/api/webhooks/stripe.ts:87.
65
+ It uses the timing-safe HMAC check from Stripe's SDK with a 5-minute tolerance.
66
+ Total context used: ~258 tokens — 96% less
67
+ ```
68
+
69
+ The agent stays in the conversation and can keep going (blast radius, related tests, change planning) instead of running out of context after one file read.
70
+
71
+ ---
72
+
73
+ ## Measured search precision
74
+
75
+ 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).
76
+
77
+ ---
78
+
39
79
  ## Documentation
40
80
 
41
81
  ### User Guide — start here
@@ -75,9 +115,7 @@ The guide explains what PureContext does, why each feature exists, and how to us
75
115
 
76
116
  ### Reference Manual
77
117
 
78
- Parameter-level documentation for every tool, configuration option, language, framework adapter, and deployment option.
79
-
80
- You should start from docs/README.md.
118
+ 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.
81
119
 
82
120
  ---
83
121
 
@@ -223,7 +261,7 @@ Without these instructions, an agent may default to reading entire files rather
223
261
  Run this once inside your project directory:
224
262
 
225
263
  ```bash
226
- npx purecontext-mcp install all
264
+ npx purecontext-mcp@latest install all
227
265
  ```
228
266
 
229
267
  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).
@@ -240,22 +278,22 @@ Where should PureContext be installed?
240
278
  Pass `--scope` to skip the prompt:
241
279
 
242
280
  ```bash
243
- npx purecontext-mcp install all --scope=local # this project only
244
- npx purecontext-mcp install all --scope=global # user-level, all projects
245
- npx purecontext-mcp install all --scope=both # both places at once
281
+ npx purecontext-mcp@latest install all --scope=local # this project only
282
+ npx purecontext-mcp@latest install all --scope=global # user-level, all projects
283
+ npx purecontext-mcp@latest install all --scope=both # both places at once
246
284
  ```
247
285
 
248
286
  For a single tool:
249
287
 
250
288
  ```bash
251
- npx purecontext-mcp install <tool> --scope=global
289
+ npx purecontext-mcp@latest install <tool> --scope=global
252
290
  ```
253
291
 
254
292
  To preview without writing files:
255
293
 
256
294
  ```bash
257
- npx purecontext-mcp install all --dry-run
258
- npx purecontext-mcp install --list # show which IDEs were detected
295
+ npx purecontext-mcp@latest install all --dry-run
296
+ npx purecontext-mcp@latest install --list # show which IDEs were detected
259
297
  ```
260
298
 
261
299
  Supported tools and where each one writes:
@@ -273,9 +311,29 @@ Supported tools and where each one writes:
273
311
 
274
312
  ### Manual install
275
313
 
276
- If you'd rather paste the rules yourself, two instruction files are at the repository root:
314
+ If you'd rather paste the rules yourself, three instruction files are at the repository root:
277
315
 
278
- - **`AGENT_INSTRUCTIONS_SHORT.md`** — ~2 KB. Mandatory workflow, tool selection table, core rules.
279
- - **`AGENT_INSTRUCTIONS.md`** — ~15 KB. Adds parameter notes, decision trees, anti-patterns.
316
+ - **[`AGENT_INSTRUCTIONS_SHORT.md`](AGENT_INSTRUCTIONS_SHORT.md)** — ~2 KB. Mandatory workflow, tool selection table, core rules. Use for agents with limited system-prompt space.
317
+ - **[`AGENT_INSTRUCTIONS.md`](AGENT_INSTRUCTIONS.md)** — ~15 KB. Adds parameter notes, decision trees, anti-patterns.
318
+ - **[`AGENT_REFERENCE.md`](AGENT_REFERENCE.md)** — ~30 KB. Full tool reference with every parameter, every navigation pattern, and every known limitation. Installed automatically by `hooks --install`; read this when an agent needs the canonical answer.
280
319
 
281
320
  Paste the contents into whatever system prompt, memory, or rules configuration your agent uses.
321
+
322
+ ---
323
+
324
+ ## License
325
+
326
+ MIT — see [LICENSE](LICENSE).
327
+
328
+ ## Contributing
329
+
330
+ 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.
331
+
332
+ 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.
333
+
334
+ ## Support
335
+
336
+ - **Bug reports and feature requests:** [GitHub Issues](https://github.com/goranocokoljic/pure-context/issues)
337
+ - **Questions about MCP integration:** Open a Discussion on the repository
338
+ - **Changelog:** [CHANGELOG.md](CHANGELOG.md)
339
+ - **Stability and semver policy:** [docs/27-api-stability.md](docs/27-api-stability.md)