semantic-js-mcp 0.8.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.
@@ -0,0 +1,125 @@
1
+ ---
2
+ name: semantic-navigation
3
+ description: Use semantic-js-mcp for TypeScript, JavaScript, TSX, JSX, and Vue navigation, code review, security auditing, regression analysis, debugging, refactoring, implementation, or named-symbol tracing. Explains the complementary tool graph and literal result contract.
4
+ ---
5
+
6
+ # Semantic Navigation
7
+
8
+ Use `semantic-js-mcp` as static semantic evidence alongside text search, direct source inspection, dependency inspection, and focused tests.
9
+
10
+ Supported source extensions are `.ts`, `.tsx`, `.mts`, `.cts`, `.js`, `.jsx`, `.mjs`, `.cjs`, and `.vue`.
11
+
12
+ ## Choose The Smallest Useful Tool
13
+
14
+ | Starting information | Call | Provides | Continue with |
15
+ | ---------------------------------------------------- | ------------------------------- | -------------------------------------------------------- | -------------------------------------------------- |
16
+ | One file | `lsp_document_symbols` | File structure | `lsp_definition`, `lsp_audit_symbol` |
17
+ | Partial symbol name | `lsp_workspace_symbols` | Declaration discovery | `lsp_count_named_symbol`, `lsp_audit_named_symbol` |
18
+ | Exact source position | `lsp_definition` | Resolved declaration | `lsp_hover`, `lsp_count_references` |
19
+ | Exact source position | `lsp_hover` | Inferred type and documentation | `lsp_definition`, `lsp_audit_symbol` |
20
+ | One changed file | `lsp_diagnostics` | Focused diagnostics | `lsp_definition`, `lsp_hover` |
21
+ | Exact symbol text, unknown scope | `lsp_count_text_matches` | Text-match and file counts without semantic verification | `lsp_count_named_symbol`, `lsp_audit_named_symbol` |
22
+ | Exact symbol name, broad scope | `lsp_count_named_symbol` | Small count response | `lsp_audit_named_symbol`, `lsp_references` |
23
+ | Exact source position, broad scope | `lsp_count_references` | Small count response | `lsp_audit_symbol`, `lsp_references` |
24
+ | Exact symbol name, composed evidence | `lsp_audit_named_symbol` | Definition, signature, counts, files | `lsp_references` |
25
+ | Exact source position, composed evidence | `lsp_audit_symbol` | Definition, signature, counts, files | `lsp_references` |
26
+ | Exact source position, locations needed | `lsp_references` | First verified-location page | `lsp_reference_page` |
27
+ | Existing `referenceSetId` | `lsp_reference_page` | Later verified-location page | `lsp_reference_page`, `lsp_definition` |
28
+ | Existing `referenceSetId` with unresolved candidates | `lsp_unresolved_reference_page` | Candidate locations and literal resolution reasons | `lsp_unresolved_reference_page`, `lsp_definition` |
29
+
30
+ Composite audit tools are convenience calls over shared internal primitives. They preserve access to narrow tools; choose either route according to the evidence needed.
31
+
32
+ The complete protocol vocabulary is generated from the server's source of truth. Read [references/protocol-literals.md](references/protocol-literals.md) when implementing an adapter, validating a response parser, or interpreting an unfamiliar literal.
33
+
34
+ ## Named Symbols
35
+
36
+ When a task names a material symbol and an exact position is unavailable, use `lsp_audit_named_symbol`. For shared code, security boundaries, unfamiliar symbols, or broad changes, call `lsp_count_text_matches` first when repository scale is unknown. It cheaply reports textual work size without claiming symbol identity. Then use `lsp_count_named_symbol` for verified semantic counts; the following audit reuses compatible collected references.
37
+
38
+ When an exact file, line, and column are already known, use `lsp_audit_symbol` or a narrower position tool.
39
+
40
+ `lsp_document_symbols` provides structure. Reference, caller, route-wiring, and runtime claims require the corresponding semantic tool plus direct inspection.
41
+
42
+ ## Read The Result Literally
43
+
44
+ The canonical machine result is JSON in `structuredContent`. The model-facing text is YAML generated from the same object.
45
+
46
+ Every result has:
47
+
48
+ - `server`: the exact semantic-js-mcp server name and version that answered the call.
49
+ - `resultSchema`: the exact canonical result schema name and version.
50
+ - `request`: normalized inputs and limit interpretation.
51
+ - `result`: evidence returned by the tool.
52
+ - `collection`: completion state for evidence collection.
53
+ - `presentation`: response shape for the collected evidence.
54
+ - `continueWith`: exact tool names that add another evidence type.
55
+
56
+ ### Collection
57
+
58
+ - `complete`: the requested scope completed and every discovered item was classified.
59
+ - `limited`: a caller-supplied collection limit stopped the scan.
60
+ - `partial`: unresolved definitions or unreadable owning files are explicitly counted.
61
+ - `failed`: the call failed; read `error.message`.
62
+
63
+ Collection status describes static evidence collection. Runtime correctness comes from source and behavioral verification.
64
+
65
+ ### Presentation
66
+
67
+ - `all-items`: all collected items appear.
68
+ - `subset`: the response contains a requested subset; counts describe the full collection.
69
+ - `count-only`: locations are retained for reuse and omitted from this response.
70
+ - `summary-by-file`: locations are grouped by file and retained for reuse.
71
+ - `page`: locations are paginated; use `presentation.nextCursor` with `lsp_reference_page`.
72
+
73
+ Presentation shape does not change `collection.status`.
74
+
75
+ For reference calls, `includeDeclaration: false` removes locations that resolve to the requested declaration. It does not remove the query position when that position is a usage. Verify the literal accounting invariant `verifiedTotal = foundByOwningWorkspaceLanguageServer + verifiedFromOtherWorkspaces`; a violation is a tool-contract defect, not evidence about the repository.
76
+
77
+ ### Limits
78
+
79
+ Omitted `maxCandidates` and `maxDefinitions` mean `{mode: unlimited}`. A supplied positive value means `{mode: maximum, maximum: N}` and may produce `collection.status: limited`.
80
+
81
+ `maxResults` and `pageSize` are presentation controls where exposed. Use `lsp_count_named_symbol` or `lsp_count_references` when only scope is needed; use pages when locations are needed.
82
+
83
+ ### Text Search Accounting
84
+
85
+ - `matchesFound`: repository text matches discovered.
86
+ - `matchesChecked`: matches whose symbol identity was inspected.
87
+ - `matchesToRequestedSymbol`: matches resolved to the requested declaration.
88
+ - `matchesToDifferentSymbols`: matches resolved elsewhere.
89
+ - `matchesWhoseDefinitionCouldNotBeResolved`: explicit unresolved matches.
90
+ - `accountingStatus: complete`: every discovered match has one classification.
91
+ - `accountingStatus: incomplete`: some matches were not checked, normally because an explicit limit stopped collection.
92
+
93
+ `matchesWhoseDefinitionCouldNotBeResolved > 0` keeps uncertainty visible and produces `collection.status: partial` even when accounting is complete.
94
+
95
+ Use the reported `referenceSetId` with `lsp_unresolved_reference_page` when unresolved candidates are material. Read `reason` and `typescriptProject` literally. `candidate-opened-in-inferred-typescript-project` proves tsserver did not associate that file with a configured project; other reasons do not establish that an alias, exclusion, or project configuration caused the failure.
96
+
97
+ ### Freshness
98
+
99
+ Reference collections include `collection.contentFreshness: verified-current-file-content` and `collection.repositoryInventoryFreshness: verified-current-repository-source-inventory`. `lsp_reference_page` verifies direct content hashes plus the repository source inventory before returning a page. This detects new, deleted, renamed, and normally modified source files. A change returns `error.code: REFERENCE_SET_CONTENT_CHANGED`; an expired or evicted set returns `REFERENCE_SET_NOT_FOUND_OR_EXPIRED`. Call `lsp_references` to create a current set. `REPOSITORY_CHANGED_DURING_COLLECTION` means edits did not settle during the collection attempts.
100
+
101
+ Diagnostics identify the analyzed document with a version and SHA-256 fingerprint. Treat only `result.evidence.status: verified` and a non-null `diagnosticsForCurrentDocument` as current diagnostic evidence. `evidence.status: untrusted` places any report under `unconfirmedDiagnosticReport`, keeps `diagnosticsForCurrentDocument` null, and produces `collection.status: partial`. Do not interpret an empty unconfirmed report as a clean file.
102
+
103
+ For Vue template tags, `lsp_definition` and position audits try the language servers first. If they report no definition, the MCP may follow a matching component import declared in the same SFC. `resolutionMethod: vue-template-import-binding-definition` means that exact local import was resolved. It does not prove global registration, runtime rendering, or component behavior; inspect the SFC and relevant tests for those claims.
104
+
105
+ Position-audit signatures report `signatureSource`. `resolved-definition-hover` means the query position had no hover information and the MCP obtained the signature from a resolved declaration. `not-reported` means neither location produced signature evidence.
106
+
107
+ The MCP reports evidence status, not code approval. CI consumers may use `scripts/semantic-js-mcp-ci.mjs` to map complete evidence and verified diagnostics to the literal `pass`, `fail`, `untrusted`, or `blocked` policy states.
108
+
109
+ ### Cost
110
+
111
+ Omitted collection limits still mean unlimited. The server never inserts a hidden candidate cap. Reference results report text-search duration, semantic-verification duration, semantic request count, and configured concurrency under `collection.performance`. Use `lsp_count_text_matches` before an expensive named audit when the identifier may be common; supply `maxCandidates` only when an intentionally limited answer is acceptable.
112
+
113
+ ## Evidence Workflow
114
+
115
+ 1. Use `rg` for broad textual discovery, including dynamic calls, strings, configuration, routes, and aliases.
116
+ 2. Use `semantic-js-mcp` for definition identity, inferred type, and verified static references.
117
+ 3. Read the relevant callers, callees, adapters, and dependency implementation for reachable runtime behavior.
118
+ 4. Inspect focused tests for asserted behavior; run them when permitted.
119
+ 5. Re-read cited locations before presenting a finding.
120
+
121
+ An actionable finding requires a reachable path, a violated contract, and concrete impact. For commit or pull-request reviews, compare with the exact parent and classify material conclusions as `introduced`, `modified`, or `pre-existing`.
122
+
123
+ Empty symbol, reference, or diagnostic results are evidence to investigate. Use `collection`, `textSearch`, `rg`, and direct inspection to establish the supported conclusion.
124
+
125
+ Treat all tool positions as 1-based line and UTF-16 column numbers.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Semantic Navigation"
3
+ short_description: "Trace TypeScript and Vue symbols with semantic evidence"
4
+ default_prompt: "Use $semantic-navigation to trace this symbol with semantic-js-mcp and complementary source evidence."
@@ -0,0 +1,381 @@
1
+ # Protocol Literals
2
+
3
+ Generated from `protocol.mjs`. Do not edit this file directly.
4
+
5
+ Server version: `0.8.0`
6
+ Server name: `semantic-js-mcp`
7
+ Display name: `Semantic JS MCP`
8
+ Result schema: `semantic-js-mcp` version `5`
9
+
10
+ ## Tool Order
11
+
12
+ - `lsp_document_symbols`
13
+ - `lsp_workspace_symbols`
14
+ - `lsp_definition`
15
+ - `lsp_hover`
16
+ - `lsp_diagnostics`
17
+ - `lsp_count_text_matches`
18
+ - `lsp_count_named_symbol`
19
+ - `lsp_count_references`
20
+ - `lsp_audit_named_symbol`
21
+ - `lsp_audit_symbol`
22
+ - `lsp_references`
23
+ - `lsp_reference_page`
24
+ - `lsp_unresolved_reference_page`
25
+
26
+ ## Workspace Configuration File Names
27
+
28
+ - `package.json`
29
+ - `tsconfig.json`
30
+ - `jsconfig.json`
31
+
32
+ ## Configuration Files
33
+
34
+ - `package.json`
35
+ - `tsconfig.json`
36
+ - `jsconfig.json`
37
+
38
+ ## Workspace Root Marker File Names
39
+
40
+ - `package.json`
41
+ - `tsconfig.json`
42
+
43
+ ## Source File Globs
44
+
45
+ - `*.ts`
46
+ - `*.tsx`
47
+ - `*.mts`
48
+ - `*.cts`
49
+ - `*.js`
50
+ - `*.jsx`
51
+ - `*.mjs`
52
+ - `*.cjs`
53
+ - `*.vue`
54
+
55
+ ## Excluded Source Globs
56
+
57
+ - `!**/node_modules/**`
58
+ - `!**/dist/**`
59
+ - `!**/coverage/**`
60
+
61
+ ## Source Extensions
62
+
63
+ - `.ts`
64
+ - `.tsx`
65
+ - `.mts`
66
+ - `.cts`
67
+ - `.js`
68
+ - `.jsx`
69
+ - `.mjs`
70
+ - `.cjs`
71
+ - `.vue`
72
+
73
+ ## Language IDs
74
+
75
+ - `typescript`
76
+ - `typescriptreact`
77
+ - `javascript`
78
+ - `javascriptreact`
79
+ - `vue`
80
+
81
+ ## Vue Script Languages
82
+
83
+ - `js`
84
+ - `jsx`
85
+
86
+ ## Collection Status
87
+
88
+ - `complete`
89
+ - `limited`
90
+ - `partial`
91
+ - `failed`
92
+
93
+ ## Presentation Mode
94
+
95
+ - `all-items`
96
+ - `subset`
97
+ - `count-only`
98
+ - `summary-by-file`
99
+ - `page`
100
+
101
+ ## Limit Mode
102
+
103
+ - `unlimited`
104
+ - `maximum`
105
+
106
+ ## Accounting Status
107
+
108
+ - `complete`
109
+ - `incomplete`
110
+
111
+ ## Definition Match
112
+
113
+ - `resolved`
114
+ - `unresolved`
115
+
116
+ ## Signature Source
117
+
118
+ - `query-position-hover`
119
+ - `resolved-definition-hover`
120
+ - `not-reported`
121
+
122
+ ## Diagnostic Freshness
123
+
124
+ - `current-document-version`
125
+ - `version-not-reported-by-language-server`
126
+ - `different-document-version`
127
+ - `not-reported-for-current-document`
128
+
129
+ ## Diagnostic Severity
130
+
131
+ - `error`
132
+ - `warning`
133
+ - `information`
134
+ - `hint`
135
+ - `not-reported`
136
+
137
+ ## Diagnostic Evidence Reason
138
+
139
+ - `current-document-version-confirmed`
140
+ - `language-server-version-not-reported`
141
+ - `language-server-reported-different-version`
142
+ - `language-server-did-not-report-current-document`
143
+
144
+ ## Evidence Status
145
+
146
+ - `verified`
147
+ - `untrusted`
148
+
149
+ ## Reference Content Freshness
150
+
151
+ - `verified-current-file-content`
152
+ - `verified-current-repository-source-inventory`
153
+
154
+ ## Error Code
155
+
156
+ - `TOOL_EXECUTION_FAILED`
157
+ - `REFERENCE_SET_CONTENT_CHANGED`
158
+ - `REFERENCE_SET_NOT_FOUND_OR_EXPIRED`
159
+ - `REPOSITORY_CHANGED_DURING_COLLECTION`
160
+ - `RUNTIME_DEPENDENCY_MISSING`
161
+ - `RUNTIME_REQUIREMENT_UNMET`
162
+
163
+ ## Evidence Type
164
+
165
+ - `exact-identifier-text-match`
166
+
167
+ ## Fingerprint Algorithm
168
+
169
+ - `sha256`
170
+
171
+ ## Reference Discovery Method
172
+
173
+ - `owning-workspace-language-server`
174
+ - `definition-match-from-another-workspace`
175
+
176
+ ## Reference Set Change Type
177
+
178
+ - `evidence-file-content-changed`
179
+ - `repository-source-inventory-changed`
180
+
181
+ ## Definition Resolution Method
182
+
183
+ - `language-server-definition`
184
+ - `typescript-server-definition`
185
+ - `vue-template-import-binding-definition`
186
+ - `unresolved`
187
+
188
+ ## Unresolved Reference Reason
189
+
190
+ - `definition-tools-returned-no-location`
191
+ - `typescript-server-request-failed-after-language-server-returned-no-location`
192
+ - `candidate-analysis-failed`
193
+ - `candidate-opened-in-inferred-typescript-project`
194
+
195
+ ## TypeScript Project Kind
196
+
197
+ - `configured-typescript-project`
198
+ - `inferred-typescript-project`
199
+ - `typescript-project-kind-not-reported`
200
+
201
+ ## CI Status
202
+
203
+ - `pass`
204
+ - `fail`
205
+ - `untrusted`
206
+ - `blocked`
207
+
208
+ ## CI Exit Codes
209
+
210
+ - `PASS`: `0`
211
+ - `FAIL`: `1`
212
+ - `UNTRUSTED`: `2`
213
+ - `BLOCKED`: `3`
214
+
215
+ ## CI Reason
216
+
217
+ - `complete-evidence`
218
+ - `verified-current-document-has-error-diagnostics`
219
+ - `collection-is-limited-or-partial`
220
+ - `diagnostics-for-current-document-are-untrusted`
221
+ - `tool-execution-failed`
222
+ - `input-is-not-a-semantic-js-mcp-result`
223
+
224
+ ## CLI Commands
225
+
226
+ - `serve`
227
+ - `doctor`
228
+ - `help`
229
+ - `version`
230
+
231
+ ## CLI Arguments
232
+
233
+ - `--help`
234
+ - `-h`
235
+ - `--version`
236
+ - `-v`
237
+ - `--yaml`
238
+
239
+ ## CLI Messages
240
+
241
+ - `Unknown command`
242
+ - `Unknown argument`
243
+ - `Unknown option`
244
+
245
+ ## Doctor Checks
246
+
247
+ - `node-runtime`
248
+ - `runtime-components`
249
+ - `ripgrep`
250
+ - `mcp-startup`
251
+ - `tool-discovery`
252
+ - `typescript-symbols`
253
+ - `typescript-references`
254
+ - `diagnostic-freshness`
255
+ - `vue-symbols`
256
+ - `vue-template-definition`
257
+
258
+ ## Doctor Reasons
259
+
260
+ - `check-completed`
261
+ - `unsupported-node-runtime`
262
+ - `runtime-component-missing`
263
+ - `ripgrep-unavailable`
264
+ - `mcp-startup-failed`
265
+ - `tool-set-different-from-protocol`
266
+ - `typescript-symbol-not-found`
267
+ - `typescript-reference-accounting-incomplete`
268
+ - `diagnostics-not-confirmed-for-current-document`
269
+ - `vue-symbol-not-found`
270
+ - `vue-template-definition-unresolved`
271
+ - `check-failed`
272
+
273
+ ## Doctor Distribution Accepted Status
274
+
275
+ - `pass`
276
+ - `untrusted`
277
+
278
+ ## Doctor Status Priority
279
+
280
+ - `pass`: `0`
281
+ - `untrusted`: `1`
282
+ - `fail`: `2`
283
+ - `blocked`: `3`
284
+
285
+ ## Required Runtime Components
286
+
287
+ - `TYPESCRIPT_LANGUAGE_SERVER`: `typescript-language-server/lib/cli.mjs`
288
+ - `VUE_LANGUAGE_SERVER`: `@vue/language-server/bin/vue-language-server.js`
289
+ - `TYPESCRIPT_SERVER`: `typescript/lib/tsserver.js`
290
+ - `VUE_SFC_COMPILER`: `@vue/compiler-sfc/dist/compiler-sfc.cjs.js`
291
+ - `VUE_TYPESCRIPT_PLUGIN`: `@vue/typescript-plugin/package.json`
292
+
293
+ ## Runtime Commands
294
+
295
+ - `rg`
296
+
297
+ ## Runtime Requirements
298
+
299
+ - `MINIMUM_NODE_MAJOR`: `22`
300
+
301
+ ## Runtime Requirement Kinds
302
+
303
+ - `node`
304
+ - `runtime-component`
305
+
306
+ ## Package Paths
307
+
308
+ - `server.mjs`
309
+ - `cli.mjs`
310
+
311
+ ## Runtime Status
312
+
313
+ - `ready`
314
+ - `blocked`
315
+
316
+ ## Node Event
317
+
318
+ - `error`
319
+ - `close`
320
+
321
+ ## Process Exit Codes
322
+
323
+ - `SUCCESS`: `0`
324
+ - `FAILURE`: `1`
325
+
326
+ ## Internal Resolution Source
327
+
328
+ - `native-lsp`
329
+ - `tsserver-fallback`
330
+ - `cross-workspace-definition`
331
+ - `vue-template-import-binding`
332
+ - `unresolved`
333
+
334
+ ## Forbidden Ambiguous Public Fields
335
+
336
+ - `confidence`
337
+ - `exhaustive`
338
+ - `rejectedCandidateCount`
339
+ - `rejectedCandidates`
340
+ - `rejectedCandidatesByReason`
341
+ - `semanticIdentity`
342
+ - `truncated`
343
+
344
+ ## Default Configuration Values
345
+
346
+ - `REQUEST_TIMEOUT_MS`: `30000`
347
+ - `DIAGNOSTIC_WAIT_MS`: `2000`
348
+ - `CLIENT_IDLE_TIMEOUT_MS`: `60000`
349
+ - `CLIENT_MINIMUM_EVICTION_AGE_MS`: `15000`
350
+ - `MAXIMUM_ACTIVE_CLIENTS`: `4`
351
+ - `REFERENCE_SET_TTL_MS`: `300000`
352
+ - `MAXIMUM_REFERENCE_SETS`: `12`
353
+ - `MAXIMUM_CHANGED_REFERENCE_SET_MARKERS`: `24`
354
+ - `MAXIMUM_CACHED_REFERENCE_LOCATIONS`: `50000`
355
+ - `REFERENCE_PAGE_SIZE`: `100`
356
+ - `CROSS_WORKSPACE_CONCURRENCY`: `6`
357
+ - `FILE_FINGERPRINT_CONCURRENCY`: `8`
358
+ - `NAMED_DEFINITION_CONCURRENCY`: `2`
359
+ - `WORKSPACE_FILE_CONCURRENCY`: `5`
360
+ - `FILE_SUGGESTION_COUNT`: `8`
361
+ - `MILLISECONDS_PER_SECOND`: `1000`
362
+ - `BENCHMARK_COUNTS`: `10,100,1000`
363
+ - `MCP_STARTUP_TIMEOUT_SECONDS`: `30`
364
+ - `MCP_TOOL_TIMEOUT_SECONDS`: `300`
365
+ - `INVENTORY_STAT_CONCURRENCY`: `32`
366
+ - `COLLECTION_STABILITY_ATTEMPTS`: `2`
367
+ - `PROCESS_ARGUMENT_OFFSET`: `2`
368
+
369
+ ## Environment Variables
370
+
371
+ - `PROCESS_CWD`: `SEMANTIC_JS_MCP_PROCESS_CWD`
372
+ - `CLIENT_IDLE_TIMEOUT_MS`: `SEMANTIC_JS_MCP_CLIENT_IDLE_TIMEOUT_MS`
373
+ - `CLIENT_MINIMUM_EVICTION_AGE_MS`: `SEMANTIC_JS_MCP_CLIENT_MINIMUM_EVICTION_AGE_MS`
374
+ - `MAXIMUM_ACTIVE_CLIENTS`: `SEMANTIC_JS_MCP_MAXIMUM_ACTIVE_CLIENTS`
375
+ - `REFERENCE_SET_TTL_MS`: `SEMANTIC_JS_MCP_REFERENCE_SET_TTL_MS`
376
+ - `MAXIMUM_REFERENCE_SETS`: `SEMANTIC_JS_MCP_MAXIMUM_REFERENCE_SETS`
377
+ - `MAXIMUM_CHANGED_REFERENCE_SET_MARKERS`: `SEMANTIC_JS_MCP_MAXIMUM_CHANGED_REFERENCE_SET_MARKERS`
378
+ - `MAXIMUM_CACHED_REFERENCE_LOCATIONS`: `SEMANTIC_JS_MCP_MAXIMUM_CACHED_REFERENCE_LOCATIONS`
379
+ - `DEFAULT_REFERENCE_PAGE_SIZE`: `SEMANTIC_JS_MCP_DEFAULT_REFERENCE_PAGE_SIZE`
380
+ - `CROSS_WORKSPACE_CONCURRENCY`: `SEMANTIC_JS_MCP_CROSS_WORKSPACE_CONCURRENCY`
381
+ - `BENCHMARK_COUNTS`: `SEMANTIC_JS_MCP_BENCHMARK_COUNTS`