@adhisang/minecraft-modding-mcp 2.0.0 → 2.1.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/CHANGELOG.md +44 -0
- package/README.md +109 -29
- package/dist/cli.js +31 -4
- package/dist/compat-stdio-transport.d.ts +2 -7
- package/dist/compat-stdio-transport.js +12 -154
- package/dist/index.js +392 -33
- package/dist/json-rpc-framing.d.ts +22 -0
- package/dist/json-rpc-framing.js +168 -0
- package/dist/mapping-pipeline-service.js +9 -1
- package/dist/mapping-service.d.ts +9 -0
- package/dist/mapping-service.js +183 -60
- package/dist/minecraft-explorer-service.d.ts +0 -1
- package/dist/minecraft-explorer-service.js +119 -23
- package/dist/mixin-validator.d.ts +24 -2
- package/dist/mixin-validator.js +223 -98
- package/dist/mod-decompile-service.d.ts +5 -0
- package/dist/mod-decompile-service.js +40 -5
- package/dist/mod-remap-service.js +142 -30
- package/dist/path-resolver.js +41 -4
- package/dist/registry-service.d.ts +10 -1
- package/dist/registry-service.js +154 -22
- package/dist/search-hit-accumulator.js +23 -2
- package/dist/source-jar-reader.js +16 -2
- package/dist/source-resolver.js +6 -7
- package/dist/source-service.d.ts +42 -4
- package/dist/source-service.js +781 -127
- package/dist/stdio-supervisor.d.ts +46 -0
- package/dist/stdio-supervisor.js +349 -0
- package/dist/storage/files-repo.d.ts +3 -9
- package/dist/storage/files-repo.js +66 -43
- package/dist/symbols/symbol-extractor.js +6 -4
- package/dist/tool-execution-gate.d.ts +15 -0
- package/dist/tool-execution-gate.js +58 -0
- package/dist/version-diff-service.js +10 -5
- package/dist/version-service.js +7 -2
- package/dist/workspace-mapping-service.js +12 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,50 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.1.0] - 2026-03-08
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Source inspection tools now expose `artifactContents` so clients can tell whether a result came from a `source-jar` or `decompiled-binary`, whether non-Java resources are indexed, and whether source coverage is `full` or `partial`.
|
|
14
|
+
- `get-class-source`, `get-class-members`, `search-class-source`, and `get-artifact-file` now expose `returnedNamespace` to distinguish the namespace of returned content from the underlying artifact namespace (`mappingApplied`).
|
|
15
|
+
- Token-efficient response shaping options: `find-mapping`, `resolve-method-mapping-exact`, `resolve-workspace-symbol`, and `check-symbol-exists` now accept `maxCandidates`; `get-class-api-matrix` accepts `maxRows`; `diff-class-signatures` accepts `includeFullDiff`; `decompile-mod-jar` accepts `includeFiles` / `maxFiles`; `get-registry-data` accepts `includeData` / `maxEntriesPerRegistry`; `validate-mixin` accepts `includeIssues`.
|
|
16
|
+
- `validate-mixin` now reports per-result `validationStatus` (`full` / `partial` / `invalid`), member coverage counters (`summary.membersValidated` / `membersSkipped` / `membersMissing`), batch `summary.partial`, and scope/source-priority provenance fields (`requestedScope` / `appliedScope`, `requestedSourcePriority` / `appliedSourcePriority`) so partial validation is explicit.
|
|
17
|
+
- `validate-mixin` now supports `input.mode="project"` to recursively discover `*.mixins.json` under a workspace root and validate every referenced Mixin in one call.
|
|
18
|
+
- `validate-mixin` now adds `confidenceBreakdown` and `reportMode="summary-first"` so callers can see why confidence dropped and consume batch-oriented output without repeated per-result provenance/warning payloads.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- `compare-versions` now applies `packageFilter` consistently to `classes.addedCount`, `removedCount`, and `unchanged`, so class summary counts reflect the same filtered package scope as the returned class lists.
|
|
22
|
+
- Heavy analysis tools are now serialized behind a bounded in-process queue, and queue overflow fails fast with `ERR_LIMIT_EXCEEDED` instead of amplifying concurrent load across the whole MCP transport.
|
|
23
|
+
- The stdio CLI entrypoint now supervises an internal worker process, automatically restarts it after an unexpected exit, replays MCP initialization for the live session, and turns in-flight crashes into retryable JSON-RPC request failures instead of a full transport disconnect.
|
|
24
|
+
- `trace-symbol-lifecycle` now uses strict method remapping when a descriptor is provided, falls back to name-only lookup when it is omitted, and surfaces real mapping input failures in warnings instead of collapsing them into generic lookup errors.
|
|
25
|
+
- `get-class-source` / `get-class-members` now infer a missing artifact version from `projectPath` when `preferProjectVersion=true`, making project-aware lookups more consistent for previously resolved artifacts.
|
|
26
|
+
- Error recovery payloads (`suggestedCall`) now use the current `target` object schema instead of deprecated `targetKind` / `targetValue` fields.
|
|
27
|
+
- `list-artifact-files` now warns when callers probe `assets/` or `data/` prefixes against the Java-source index, instead of silently returning an unexplained empty result.
|
|
28
|
+
- `artifactContents.sourceCoverage` now strictly reports `full` or `partial`, matching the documented contract instead of carrying an unreachable `unknown` branch in the exported type.
|
|
29
|
+
- `get-class-members` now rejects malformed field and method descriptors from corrupted bytecode with `ERR_INVALID_INPUT` instead of returning malformed Java signatures, and invalid `void` method arguments now report as method descriptor errors instead of misleading field descriptor errors.
|
|
30
|
+
- `resolve-artifact` now searches project-local and Gradle user-home Loom caches without auto-selecting unrelated mod/library source jars just because their filenames contain the requested Minecraft version.
|
|
31
|
+
- `resolve-artifact` and related version-target mapping failures now preserve `ERR_MAPPING_NOT_APPLIED` while adding `artifactOrigin` plus actionable recovery details for decompile-only artifacts.
|
|
32
|
+
- `remap-mod-jar` now detects Mojang-mapped Fabric/Quilt inputs, returns a copied output for `targetMapping="mojang"`, and fails fast with contextual diagnostics for unsupported Mojang-input `targetMapping="yarn"` requests.
|
|
33
|
+
- `resolve-workspace-symbol` now recognizes NeoForge ModDevGradle workspaces as `mojang` compile mappings instead of returning `mapping_unavailable`.
|
|
34
|
+
- `resolve-artifact`, `get-class-source`, and `get-class-members` now preserve `ERR_JAR_NOT_FOUND` for missing `target.kind=jar` paths instead of leaking raw filesystem `ENOENT` failures through the public contract.
|
|
35
|
+
- `get-registry-data` now invalidates corrupt cached `registries.json` snapshots, regenerates them on demand, and reports `ERR_REGISTRY_GENERATION_FAILED` when the regenerated snapshot is still unreadable.
|
|
36
|
+
- `validate-mixin` now retries with `sourcePriority="maven-first"` after a partial `loom-first` validation caused by mapping/signature resolution limits, reducing false warnings from Loom-only resolution paths.
|
|
37
|
+
- `validate-mixin` no longer emits schema-invalid `check-symbol-exists` recovery payloads in `suggestedCall`; unsupported parameters such as `scope` and `projectPath` are omitted from those calls.
|
|
38
|
+
- `validate-mixin` now lowers confidence for skipped member validation and exposes requested-vs-applied scope/source-priority details instead of making partial results look fully verified.
|
|
39
|
+
- `validate-mixin` now follows the resolved artifact namespace during bytecode lookup for non-vanilla scopes, so `scope="merged"` on Mojang-mapped Loom workspaces validates against merged class names instead of falling back to false partial results and retry-driven timeouts.
|
|
40
|
+
- Invalid `validate-mixin` requests now return the standard `ERR_INVALID_INPUT` envelope with `fieldErrors`, `hints`, and a mode-correct `suggestedCall` instead of the SDK's generic pre-validation text error.
|
|
41
|
+
- Bare string `target` inputs for `resolve-artifact`, `get-class-source`, and `get-class-members` now return `ERR_INVALID_INPUT` with schema-correct wrapper suggestions instead of generic object-schema failures.
|
|
42
|
+
- `validate-mixin` now classifies signature-loading/tool-limited target failures as `validation-incomplete` warnings instead of reporting them as missing classes.
|
|
43
|
+
- `check-symbol-exists` no longer repeats raw Loom tiny-cache miss warnings when Maven tiny mappings successfully satisfy the lookup; successful fallback now emits concise fallback context instead.
|
|
44
|
+
|
|
45
|
+
### Documentation
|
|
46
|
+
- Corrected the `compare-versions` README contract to document registry results under `result.registry`.
|
|
47
|
+
- Documented the new compact-response options, `summary-first` validate-mixin mode, bare-string `target` recovery guidance, and updated token-efficient examples in both READMEs.
|
|
48
|
+
|
|
49
|
+
### Performance
|
|
50
|
+
- `resolve-artifact`, `index-artifact`, and `get-runtime-metrics` now keep cache entry/byte accounting incrementally during ingest, reindex, cache hits, and eviction, avoiding repeated full-cache rescans after each artifact load.
|
|
51
|
+
- `find-mapping`, `get-class-api-matrix`, `resolve-workspace-symbol`, `check-symbol-exists`, and `validate-mixin` now reuse hot-path mapping graph paths, class remaps, and normalization work, reducing latency for repeated namespace lookups and large Mixin validation batches.
|
|
52
|
+
- Warm-cache source and mod workflows now avoid extra regex recompilation, statement-cache churn, and FIFO cache evictions across search, signature lookup, source resolution, and decompile paths.
|
|
53
|
+
|
|
10
54
|
## [2.0.0] - 2026-03-07
|
|
11
55
|
|
|
12
56
|
### Changed
|
package/README.md
CHANGED
|
@@ -179,13 +179,13 @@ Tools for browsing Minecraft versions, resolving source artifacts, and reading/s
|
|
|
179
179
|
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
180
180
|
| --- | --- | --- | --- |
|
|
181
181
|
| `list-versions` | List available Minecraft versions from Mojang manifest + local cache | `includeSnapshots?`, `limit?` | `result.latest`, `result.releases[]`, `meta.warnings[]` |
|
|
182
|
-
| `resolve-artifact` | Resolve source artifact from `version` / `jar` / `coordinate` | `target`, `mapping?`, `sourcePriority?`, `allowDecompile?`, `projectPath?`, `scope?`, `preferProjectVersion?`, `strictVersion?` | `artifactId`, `origin`, `mappingApplied`, `qualityFlags[]`, `adjacentSourceCandidates?`, `sampleEntries?`, `warnings[]` |
|
|
182
|
+
| `resolve-artifact` | Resolve source artifact from `version` / `jar` / `coordinate` | `target`, `mapping?`, `sourcePriority?`, `allowDecompile?`, `projectPath?`, `scope?`, `preferProjectVersion?`, `strictVersion?` | `artifactId`, `origin`, `mappingApplied`, `qualityFlags[]`, `artifactContents`, `adjacentSourceCandidates?`, `sampleEntries?`, `warnings[]` |
|
|
183
183
|
| `find-class` | Resolve simple or fully-qualified class names inside an artifact | `className`, `artifactId`, `limit?` | `matches[]`, `total`, `warnings[]` |
|
|
184
|
-
| `get-class-source` | Get class source by artifact target or resolve target on demand (`mode=metadata` by default) | `className`, `target`, `mode?`, `projectPath?`, `scope?`, `preferProjectVersion?`, `strictVersion?`, `startLine?`, `endLine?`, `maxLines?`, `maxChars?`, `outputFile?` | `mode`, `sourceText`, `returnedRange`, `truncated`, `charsTruncated?`, `outputFile?`, `artifactId`, mapping/provenance metadata |
|
|
185
|
-
| `get-class-members` | Get class fields/methods/constructors from bytecode | `className`, `target`, `mapping?`, `access?`, `includeInherited?`, `maxMembers?`, `strictVersion?` | `members.{constructors,fields,methods}`, `counts`, `truncated`, `context`, `warnings[]` |
|
|
186
|
-
| `search-class-source` | Search indexed class source for symbols/text/path | `artifactId`, `query`, `intent?`, `match?`, `packagePrefix?`, `fileGlob?`, `symbolKind?`, `queryMode?`, `limit?`, `cursor?` | `hits[]`, `nextCursor?`, `mappingApplied` |
|
|
187
|
-
| `get-artifact-file` | Read full source file with byte guard | `artifactId`, `filePath`, `maxBytes?` | `content`, `contentBytes`, `truncated`, `mappingApplied` |
|
|
188
|
-
| `list-artifact-files` | List indexed source file paths with cursor pagination | `artifactId`, `prefix?`, `limit?`, `cursor?` | `items[]`, `nextCursor?`, `mappingApplied` |
|
|
184
|
+
| `get-class-source` | Get class source by artifact target or resolve target on demand (`mode=metadata` by default) | `className`, `target`, `mode?`, `projectPath?`, `scope?`, `preferProjectVersion?`, `strictVersion?`, `startLine?`, `endLine?`, `maxLines?`, `maxChars?`, `outputFile?` | `mode`, `sourceText`, `returnedRange`, `truncated`, `charsTruncated?`, `outputFile?`, `artifactId`, `returnedNamespace`, `artifactContents`, mapping/provenance metadata |
|
|
185
|
+
| `get-class-members` | Get class fields/methods/constructors from bytecode | `className`, `target`, `mapping?`, `access?`, `includeInherited?`, `maxMembers?`, `strictVersion?` | `members.{constructors,fields,methods}`, `counts`, `truncated`, `context`, `returnedNamespace`, `artifactContents`, `warnings[]` |
|
|
186
|
+
| `search-class-source` | Search indexed class source for symbols/text/path | `artifactId`, `query`, `intent?`, `match?`, `packagePrefix?`, `fileGlob?`, `symbolKind?`, `queryMode?`, `limit?`, `cursor?` | `hits[]`, `nextCursor?`, `mappingApplied`, `returnedNamespace`, `artifactContents` |
|
|
187
|
+
| `get-artifact-file` | Read full source file with byte guard | `artifactId`, `filePath`, `maxBytes?` | `content`, `contentBytes`, `truncated`, `mappingApplied`, `returnedNamespace`, `artifactContents` |
|
|
188
|
+
| `list-artifact-files` | List indexed source file paths with cursor pagination | `artifactId`, `prefix?`, `limit?`, `cursor?` | `items[]`, `nextCursor?`, `mappingApplied`, `artifactContents`, `warnings[]` |
|
|
189
189
|
| `index-artifact` | Rebuild index metadata for an existing artifact | `artifactId`, `force?` | `reindexed`, `reason`, `counts`, `indexedAt`, `durationMs` |
|
|
190
190
|
|
|
191
191
|
### Version Comparison & Symbol Tracking
|
|
@@ -194,9 +194,9 @@ Tools for comparing class/registry changes across Minecraft versions and tracing
|
|
|
194
194
|
|
|
195
195
|
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
196
196
|
| --- | --- | --- | --- |
|
|
197
|
-
| `trace-symbol-lifecycle` | Trace when `Class.method` exists across Minecraft versions | `symbol`, `descriptor?`, `fromVersion?`, `toVersion?`, `mapping?`, `sourcePriority?`, `maxVersions?`, `includeTimeline?` | `presence.firstSeen`, `presence.lastSeen`, `presence.missingBetween[]`, `presence.existsNow`, `timeline?`, `warnings[]` |
|
|
198
|
-
| `diff-class-signatures` | Compare one class between two versions and return member deltas | `className`, `fromVersion`, `toVersion`, `mapping?`, `sourcePriority?` | `classChange`, `constructors/methods/fields.{added,removed,modified}`, `summary`, `warnings[]` |
|
|
199
|
-
| `compare-versions` | Compare class/registry changes between two versions | `fromVersion`, `toVersion`, `category?`, `packageFilter?`, `maxClassResults?` | `
|
|
197
|
+
| `trace-symbol-lifecycle` | Trace when `Class.method` exists across Minecraft versions (`descriptor` omitted = name-only lookup) | `symbol`, `descriptor?`, `fromVersion?`, `toVersion?`, `mapping?`, `sourcePriority?`, `maxVersions?`, `includeTimeline?` | `presence.firstSeen`, `presence.lastSeen`, `presence.missingBetween[]`, `presence.existsNow`, `timeline?`, `warnings[]` |
|
|
198
|
+
| `diff-class-signatures` | Compare one class between two versions and return member deltas | `className`, `fromVersion`, `toVersion`, `mapping?`, `sourcePriority?`, `includeFullDiff?` | `classChange`, `constructors/methods/fields.{added,removed,modified}`, `modified`, `modified[].{key,changed,from?,to?}`, `summary`, `warnings[]` |
|
|
199
|
+
| `compare-versions` | Compare class/registry changes between two versions | `fromVersion`, `toVersion`, `category?`, `packageFilter?`, `maxClassResults?` | `classes`, `registry`, `summary`, `warnings[]` |
|
|
200
200
|
|
|
201
201
|
### Mapping & Symbols
|
|
202
202
|
|
|
@@ -204,11 +204,11 @@ Tools for converting symbol names between namespaces and checking symbol existen
|
|
|
204
204
|
|
|
205
205
|
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
206
206
|
| --- | --- | --- | --- |
|
|
207
|
-
| `find-mapping` | Find mapping candidates for class/field/method symbols between namespaces | `version`, `kind`, `name`, `owner?`, `descriptor?`, `sourceMapping`, `targetMapping`, `sourcePriority?`, `disambiguation?` | `querySymbol`, `mappingContext`, `resolved`, `status`, `resolvedSymbol?`, `candidates[]`, `ambiguityReasons?`, `provenance?`, `meta.warnings[]` |
|
|
208
|
-
| `resolve-method-mapping-exact` | Resolve one method mapping with strict owner+name+descriptor matching | `version`, `name`, `owner`, `descriptor`, `sourceMapping`, `targetMapping`, `sourcePriority?` | `querySymbol`, `mappingContext`, `resolved`, `status`, `resolvedSymbol?`, `candidates[]`, `provenance?`, `meta.warnings[]` |
|
|
209
|
-
| `get-class-api-matrix` | Show one class API as a mapping matrix (`obfuscated/mojang/intermediary/yarn`) | `version`, `className`, `classNameMapping`, `includeKinds?`, `sourcePriority?` | `classIdentity`, `rows[]`, `ambiguousRowCount?`, `meta.warnings[]` |
|
|
210
|
-
| `resolve-workspace-symbol` | Resolve compile-visible symbol names for a Gradle workspace (`build.gradle/.kts`) | `projectPath`, `version`, `kind`, `name`, `owner?`, `descriptor?`, `sourceMapping`, `sourcePriority?` | `querySymbol`, `mappingContext`, `resolved`, `status`, `resolvedSymbol?`, `candidates[]`, `workspaceDetection`, `meta.warnings[]` |
|
|
211
|
-
| `check-symbol-exists` | Strict symbol presence check for class/field/method | `version`, `kind`, `name`, `owner?`, `descriptor?`, `sourceMapping`, `sourcePriority?`, `nameMode?`, `signatureMode?` | `querySymbol`, `mappingContext`, `resolved`, `status`, `resolvedSymbol?`, `candidates[]`, `meta.warnings[]` |
|
|
207
|
+
| `find-mapping` | Find mapping candidates for class/field/method symbols between namespaces | `version`, `kind`, `name`, `owner?`, `descriptor?`, `sourceMapping`, `targetMapping`, `sourcePriority?`, `disambiguation?`, `maxCandidates?` | `querySymbol`, `mappingContext`, `resolved`, `status`, `resolvedSymbol?`, `candidates[]`, `candidateCount`, `candidatesTruncated?`, `ambiguityReasons?`, `provenance?`, `meta.warnings[]` |
|
|
208
|
+
| `resolve-method-mapping-exact` | Resolve one method mapping with strict owner+name+descriptor matching | `version`, `name`, `owner`, `descriptor`, `sourceMapping`, `targetMapping`, `sourcePriority?`, `maxCandidates?` | `querySymbol`, `mappingContext`, `resolved`, `status`, `resolvedSymbol?`, `candidates[]`, `candidateCount`, `candidatesTruncated?`, `provenance?`, `meta.warnings[]` |
|
|
209
|
+
| `get-class-api-matrix` | Show one class API as a mapping matrix (`obfuscated/mojang/intermediary/yarn`) | `version`, `className`, `classNameMapping`, `includeKinds?`, `sourcePriority?`, `maxRows?` | `classIdentity`, `rows[]`, `rowCount`, `rowsTruncated?`, `ambiguousRowCount?`, `meta.warnings[]` |
|
|
210
|
+
| `resolve-workspace-symbol` | Resolve compile-visible symbol names for a Gradle workspace (`build.gradle/.kts`) | `projectPath`, `version`, `kind`, `name`, `owner?`, `descriptor?`, `sourceMapping`, `sourcePriority?`, `maxCandidates?` | `querySymbol`, `mappingContext`, `resolved`, `status`, `resolvedSymbol?`, `candidates[]`, `candidateCount`, `candidatesTruncated?`, `workspaceDetection`, `meta.warnings[]` |
|
|
211
|
+
| `check-symbol-exists` | Strict symbol presence check for class/field/method | `version`, `kind`, `name`, `owner?`, `descriptor?`, `sourceMapping`, `sourcePriority?`, `nameMode?`, `signatureMode?`, `maxCandidates?` | `querySymbol`, `mappingContext`, `resolved`, `status`, `resolvedSymbol?`, `candidates[]`, `candidateCount`, `candidatesTruncated?`, `meta.warnings[]` |
|
|
212
212
|
|
|
213
213
|
### NBT Utilities
|
|
214
214
|
|
|
@@ -227,10 +227,10 @@ Tools for extracting metadata from mod JARs, decompiling mod source, searching m
|
|
|
227
227
|
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
228
228
|
| --- | --- | --- | --- |
|
|
229
229
|
| `analyze-mod-jar` | Extract mod metadata/dependencies/entrypoints from mod JAR | `jarPath`, `includeClasses?` | `modId`, `loader`, `jarKind`, `dependencies`, `entrypoints`, `mixinConfigs`, class stats |
|
|
230
|
-
| `decompile-mod-jar` | Decompile mod JAR and optionally return one class source | `jarPath`, `className?` | `outputDir`, `fileCount`, `files?`, `source?`, `warnings[]` |
|
|
230
|
+
| `decompile-mod-jar` | Decompile mod JAR and optionally return one class source | `jarPath`, `className?`, `includeFiles?`, `maxFiles?` | `outputDir`, `fileCount`, `files?`, `returnedFileCount?`, `filesTruncated?`, `filesOmitted?`, `source?`, `warnings[]` |
|
|
231
231
|
| `get-mod-class-source` | Read one class source from decompiled mod cache | `jarPath`, `className`, `maxLines?`, `maxChars?`, `outputFile?` | `className`, `content`, `totalLines`, `truncated?`, `charsTruncated?`, `outputFilePath?`, `warnings[]` |
|
|
232
232
|
| `search-mod-source` | Search decompiled mod source by class/method/field/content | `jarPath`, `query`, `searchType?`, `limit?` | `hits[]`, `totalHits`, `truncated`, `warnings[]` |
|
|
233
|
-
| `remap-mod-jar` | Remap a Fabric mod JAR
|
|
233
|
+
| `remap-mod-jar` | Remap a Fabric/Quilt mod JAR to yarn/mojang names; Mojang-mapped inputs are copied for `targetMapping="mojang"` | `inputJar`, `targetMapping`, `mcVersion?`, `outputJar?` | `outputJar`, `mcVersion`, `fromMapping`, `targetMapping`, `resolvedTargetNamespace`, `warnings[]` |
|
|
234
234
|
|
|
235
235
|
### Validation
|
|
236
236
|
|
|
@@ -238,7 +238,7 @@ Tools for validating Mixin source and Access Widener files against a target Mine
|
|
|
238
238
|
|
|
239
239
|
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
240
240
|
| --- | --- | --- | --- |
|
|
241
|
-
| `validate-mixin` | Parse/validate Mixin source against target Minecraft version | `input`, `sourceRoots?`, `version`, `mapping?`, `sourcePriority?`, `projectPath?`, `scope?`, `preferProjectVersion?`, `minSeverity?`, `hideUncertain?`, `warningMode?`, `preferProjectMapping?`, `reportMode?`, `warningCategoryFilter?`, `treatInfoAsWarning?`, `explain?` | `mode`, `results[]`, `summary`, `issueSummary?`, `toolHealth?`, `confidenceScore?` |
|
|
241
|
+
| `validate-mixin` | Parse/validate Mixin source against target Minecraft version | `input`, `sourceRoots?`, `version`, `mapping?`, `sourcePriority?`, `projectPath?`, `scope?`, `preferProjectVersion?`, `minSeverity?`, `hideUncertain?`, `warningMode?`, `preferProjectMapping?`, `reportMode?`, `warningCategoryFilter?`, `treatInfoAsWarning?`, `explain?`, `includeIssues?` | `mode`, `results[].validationStatus`, `summary.partial`, `issueSummary?`, `provenance?`, `incompleteReasons?`, `toolHealth?`, `confidenceScore?`, `confidenceBreakdown?` |
|
|
242
242
|
| `validate-access-widener` | Parse/validate Access Widener content against target version | `content`, `version`, `mapping?`, `sourcePriority?` | `valid`, `issues[]`, `warnings[]`, `summary` |
|
|
243
243
|
|
|
244
244
|
### Registry & Diagnostics
|
|
@@ -247,7 +247,7 @@ Tools for querying generated registry data and inspecting server runtime state.
|
|
|
247
247
|
|
|
248
248
|
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
249
249
|
| --- | --- | --- | --- |
|
|
250
|
-
| `get-registry-data` | Get generated registry snapshots (blocks/items/entities etc.) | `version`, `registry?` | `registries`
|
|
250
|
+
| `get-registry-data` | Get generated registry snapshots (blocks/items/entities etc.) | `version`, `registry?`, `includeData?`, `maxEntriesPerRegistry?` | `registries`, `data?`, `entryCount`, `returnedEntryCount?`, `registryEntryCounts?`, `dataTruncated?`, `warnings[]` |
|
|
251
251
|
| `get-runtime-metrics` | Inspect runtime counters and latency snapshots | none | `result.*` runtime metrics, `meta` envelope |
|
|
252
252
|
|
|
253
253
|
### Tool Constraints
|
|
@@ -255,11 +255,33 @@ Tools for querying generated registry data and inspecting server runtime state.
|
|
|
255
255
|
`resolve-artifact` now takes `target: { kind, value }`.
|
|
256
256
|
`get-class-source` requires `target`, where `target.type="artifact"` selects a previously resolved `artifactId` and `target.type="resolve"` supplies `{ kind, value }` directly.
|
|
257
257
|
`get-class-members` requires the same `target` object shape and still needs a binary jar (`binaryJarPath`) to read `.class` entries.
|
|
258
|
+
`get-class-members` returns `ERR_INVALID_INPUT` when a classfile contains malformed field or method descriptors instead of emitting malformed Java signature text from corrupted bytecode.
|
|
259
|
+
Malformed `void` usage outside method return positions is rejected with descriptor-specific errors, so invalid method arguments now report as method descriptor failures instead of field descriptor failures.
|
|
260
|
+
Error `suggestedCall` payloads now use the same `target` object schema instead of legacy `targetKind` / `targetValue` fields.
|
|
258
261
|
Positive integer tool parameters accept numeric strings such as `"10"` in addition to JSON numbers.
|
|
259
262
|
This numeric-string coercion only applies to documented top-level tool arguments; nested `typedJson` payloads and JSON Patch `value` objects are preserved verbatim.
|
|
260
|
-
`
|
|
263
|
+
`resolve-artifact`, `get-class-source`, `get-class-members`, `search-class-source`, `get-artifact-file`, and `list-artifact-files` include `artifactContents` so clients can see whether the backing artifact is `source-jar` or `decompiled-binary`, whether resources are indexed (`resourcesIncluded=false` today), and whether source coverage is always `full` or `partial`.
|
|
264
|
+
`get-class-source`, `get-class-members`, `search-class-source`, and `get-artifact-file` include `returnedNamespace`; compare it with `mappingApplied` when a tool returns remapped symbols instead of raw indexed source text.
|
|
265
|
+
`list-artifact-files` warns when you probe `assets/` or `data/` prefixes because the current index stores Java source only, not non-Java resources.
|
|
266
|
+
`get-class-source` and `get-class-members` can infer a missing artifact version from `projectPath` when `preferProjectVersion=true` and artifact metadata does not already contain a version.
|
|
267
|
+
Heavy analysis tools (`trace-symbol-lifecycle`, `diff-class-signatures`, `compare-versions`, `find-mapping`, `resolve-method-mapping-exact`, `get-class-api-matrix`, `get-registry-data`) are serialized inside the server to protect stdio transport stability; when the queue is full they fail fast with `ERR_LIMIT_EXCEEDED`.
|
|
268
|
+
The CLI stdio entrypoint now runs a supervised worker process. If the worker exits unexpectedly, the wrapper restarts it, replays MCP initialization for the current session, and keeps the same stdio connection usable; any request that was already in flight fails with a retryable JSON-RPC internal error instead of tearing down the whole transport.
|
|
269
|
+
`find-mapping`, `resolve-method-mapping-exact`, `resolve-workspace-symbol`, and `check-symbol-exists` accept `maxCandidates` to cap `candidates[]`; `candidateCount` always reports the full pre-truncation candidate total and `candidatesTruncated=true` signals clipping.
|
|
270
|
+
`get-class-api-matrix` accepts `maxRows`; `rowCount` reports the full pre-truncation row total and `rowsTruncated=true` signals clipping.
|
|
271
|
+
`diff-class-signatures` supports `includeFullDiff=false` to omit `from`/`to` snapshots from `modified[]` entries and keep only `key` plus `changed`.
|
|
272
|
+
`validate-mixin` requires `input.mode` to be exactly one of `inline`, `path`, `paths`, `config`, or `project`. `input.path`/`input.paths[]` are normalized for host/WSL path formats before file reads. `input.configPaths[]` reads mixin config JSON files and auto-discovers source files for batch validation (`sourceRoots[]` override lookup roots; otherwise common roots like `src/main/java`, `src/client/java`, `common/src/{main,client}/java`, `fabric/src/{main,client}/java`, `neoforge/src/{main,client}/java`, `forge/src/{main,client}/java`, and `quilt/src/{main,client}/java` are auto-detected from configured mixin classes). `input.mode="project"` recursively discovers `**/*.mixins.json` under `input.path`, then runs the same config-driven batch validation with `projectPath` defaulting to that workspace root.
|
|
261
273
|
`validate-mixin` always returns `mode`, `results[]`, and `summary`; single-input modes still use a one-element `results[]` array.
|
|
274
|
+
`validate-mixin` supports `includeIssues=false` for summary-first workflows that do not need per-result `issues[]`; combine it with `reportMode=compact` and `warningMode=aggregated` to keep responses small.
|
|
275
|
+
`reportMode=summary-first` hoists shared provenance, warnings, and incomplete-reason summaries to the top level while trimming duplicate per-result metadata.
|
|
276
|
+
`validate-mixin` per-result responses now include `validationStatus` (`full`, `partial`, `invalid`) plus `summary.membersValidated`, `summary.membersSkipped`, and `summary.membersMissing`; `quickSummary` now includes member coverage counts instead of only issue counts.
|
|
277
|
+
`validate-mixin` batch `summary` now includes `partial` so callers can distinguish fully clean results from tool-limited-but-non-failing results.
|
|
278
|
+
`validate-mixin` now reports `validation-incomplete` when target metadata cannot be loaded reliably, instead of misclassifying those tool-limited cases as confirmed missing classes.
|
|
279
|
+
`validate-mixin` responses now include `confidenceBreakdown` alongside `confidenceScore`, exposing the base score plus the penalties that lowered confidence.
|
|
262
280
|
`validate-mixin` per-result responses include `provenance.resolutionNotes?` when mapping fallback occurs.
|
|
281
|
+
`validate-mixin` provenance now exposes `requestedScope` / `appliedScope` and `requestedSourcePriority` / `appliedSourcePriority` so fallback and retry behavior is explicit.
|
|
282
|
+
`scope="loader"` currently resolves the same artifact class as `scope="merged"`; keep using `scope` to declare intent, but expect the same underlying lookup path today.
|
|
283
|
+
For non-vanilla scopes such as `scope="merged"`, `validate-mixin` now performs bytecode lookup in the resolved artifact namespace before remapping members back to the requested namespace, so Mojang-mapped Loom workspaces validate against merged class names instead of reporting false partial results.
|
|
284
|
+
`validate-mixin` automatically retries with `sourcePriority="maven-first"` after a partial `loom-first` validation caused by mapping/signature resolution limits, and records that retry in warnings plus provenance notes.
|
|
263
285
|
`validate-mixin` validates `@Invoker` targets against methods only and `@Accessor` targets against fields only.
|
|
264
286
|
`validate-mixin` parser supports both `.class` literal targets and `targets = "..."` / `targets = {"a", "b"}` string forms.
|
|
265
287
|
`validate-mixin` parser handles multi-line annotations between `@Shadow`/`@Accessor` and declarations, and strips inline annotations from declaration lines.
|
|
@@ -267,13 +289,17 @@ This numeric-string coercion only applies to documented top-level tool arguments
|
|
|
267
289
|
`validate-mixin` issues and `structuredWarnings` include `category` (`mapping`, `configuration`, `validation`, `resolution`, or `parse`) to distinguish setup/tooling/parser limits from real validation errors.
|
|
268
290
|
`validate-mixin` supports post-filtering with `minSeverity`, `hideUncertain`, and `warningCategoryFilter`; `treatInfoAsWarning=false` suppresses info-level entries in `structuredWarnings`.
|
|
269
291
|
`validate-mixin` per-result responses include `resolvedMembers?` tracking each member's resolution status (`resolved` or `not-found`).
|
|
270
|
-
`validate-mixin` with `explain=true` enriches each issue with `explanation` and `suggestedCall` (tool + params) for agent-driven recovery.
|
|
292
|
+
`validate-mixin` with `explain=true` enriches each issue with `explanation` and `suggestedCall` (tool + params) for agent-driven recovery; generated `check-symbol-exists` recovery payloads now stay within that tool's public schema.
|
|
293
|
+
Schema validation failures now also return the standard `ERR_INVALID_INPUT` envelope with `fieldErrors`, `hints`, and a mode-correct `suggestedCall` for common `validate-mixin` mistakes such as passing raw source text directly as `input`.
|
|
294
|
+
Bare string `target` values now return `ERR_INVALID_INPUT` with a schema-correct `suggestedCall` wrapper for `resolve-artifact`, `get-class-source`, and `get-class-members`.
|
|
271
295
|
`validate-mixin` summary uses `processingErrors`, `totalValidationErrors`, and `totalValidationWarnings`; the deprecated `summary.errors` field was removed.
|
|
296
|
+
`check-symbol-exists` suppresses raw `No Loom tiny mapping files matched version ...` noise when Maven tiny mappings successfully satisfy the lookup; successful fallback now reports a single concise warning instead of repeating the Loom miss on every result.
|
|
272
297
|
`resolve-artifact` with `target.kind=version` uses Loom cache discovery from `projectPath` only when `mapping=mojang`; mapping failures include `searchedPaths`, `candidateArtifacts`, and `recommendedCommand` in error details.
|
|
273
298
|
`resolve-artifact` supports `scope` (`vanilla`/`merged`/`loader`) and optional `preferProjectVersion=true` to override `target.value` from `gradle.properties` (`minecraft_version`, `mc_version`, `minecraftVersion`) when `target.kind=version`.
|
|
274
299
|
`resolve-artifact` with `target.kind=coordinate` searches the local Maven repository, the local Gradle `modules-2` cache, and configured `MCP_SOURCE_REPOS` before reporting `ERR_SOURCE_NOT_FOUND`.
|
|
300
|
+
`resolve-artifact`, `get-class-source`, and `get-class-members` now preserve `ERR_JAR_NOT_FOUND` for missing or inaccessible `target.kind=jar` paths instead of surfacing raw filesystem exceptions.
|
|
275
301
|
`resolve-artifact` includes `sampleEntries` only when a source JAR is resolved; decompile-only paths leave it unset.
|
|
276
|
-
`resolve-artifact` adds `qualityFlags=["partial-source-no-net-minecraft"]` and a warning when a merged Loom source candidate does not contain `net.minecraft` sources; `get-class-source` now bypasses that sibling `*-sources.jar` during binary fallback so the fallback can actually reach the binary artifact.
|
|
302
|
+
`resolve-artifact` adds `qualityFlags=["partial-source-no-net-minecraft"]` and a warning when a merged Loom source candidate does not contain `net.minecraft` sources; only candidates that still look like Minecraft source artifacts are auto-selected, while version-matching mod/library source jars remain diagnostics only. `get-class-source` now bypasses that sibling `*-sources.jar` during binary fallback so the fallback can actually reach the binary artifact.
|
|
277
303
|
`find-class` returns type symbols (`class`/`interface`/`enum`/`record`) only; fully-qualified lookups are filtered by exact FQCN/file path to avoid false negatives when many classes share the same simple name.
|
|
278
304
|
`find-class` returns an explanatory warning when an `obfuscated` artifact is queried with names that look like deobfuscated Mojang classes.
|
|
279
305
|
`find-class` suppresses non-vanilla matches for vanilla-looking queries on artifacts flagged with `partial-source-no-net-minecraft`; in that situation it returns a warning instead of unrelated modded classes.
|
|
@@ -297,18 +323,22 @@ Mod tool `jarPath` inputs are normalized to a canonical local `.jar` file path b
|
|
|
297
323
|
`search-mod-source` enforces `query.length <= 200` and `limit <= 200`.
|
|
298
324
|
`search-mod-source` detects source-only jars and searches `.java` entries directly without decompilation.
|
|
299
325
|
`get-mod-class-source` supports `maxLines`, `maxChars`, and `outputFile` with truncation behavior aligned to `get-class-source`; when `outputFile` is set, the written file reflects applied truncation.
|
|
326
|
+
`decompile-mod-jar` supports `includeFiles=false` to skip the full class list and `maxFiles` to cap it when you only need counts or a sample. `returnedFileCount`, `filesTruncated`, and `filesOmitted` make the shaping explicit.
|
|
300
327
|
`find-mapping` returns `ambiguityReasons` when `status=ambiguous` to explain why candidates could not be uniquely resolved.
|
|
301
328
|
`get-class-api-matrix` returns `ambiguousRowCount` when one or more rows required ambiguity fallback.
|
|
302
329
|
`check-symbol-exists` defaults to strict FQCN class inputs; set `nameMode=auto` to allow short class names (ambiguous matches return `status=ambiguous`).
|
|
303
330
|
`check-symbol-exists` supports `signatureMode=name-only` to match methods by owner+name without requiring a descriptor. Single match returns `resolved`; multiple overloads return `ambiguous` with all candidates.
|
|
304
331
|
`check-symbol-exists` always validates input shape first and returns `ERR_INVALID_INPUT` for invalid symbol combinations, even when mapping data is unavailable.
|
|
332
|
+
`get-registry-data` now discards corrupt cached `registries.json` files, regenerates them when possible, and returns `ERR_REGISTRY_GENERATION_FAILED` if the regenerated snapshot is still unreadable.
|
|
333
|
+
`get-registry-data` supports `includeData=false` to return registry names and counts without full entry bodies. `maxEntriesPerRegistry` caps returned entries per registry while preserving full `entryCount` and `registryEntryCounts`.
|
|
305
334
|
Migration notes:
|
|
306
335
|
- Replace `resolve-artifact` `targetKind` + `targetValue` with `target: { kind, value }`.
|
|
307
336
|
- Replace `get-class-source` / `get-class-members` top-level `artifactId` / `targetKind` / `targetValue` with `target: { type: "artifact", artifactId }` or `target: { type: "resolve", kind, value }`.
|
|
308
337
|
- `resolve-method-mapping-exact` is method-only and no longer accepts `kind`.
|
|
309
|
-
- Replace `validate-mixin` `source` / `sourcePath` / `sourcePaths` / `mixinConfigPath` / `sourceRoot` with `input.mode` plus `input.source` / `input.path` / `input.paths[]` / `input.configPaths[]` and `sourceRoots[]`. Use `summary.processingErrors` instead of `summary.errors`.
|
|
338
|
+
- Replace `validate-mixin` `source` / `sourcePath` / `sourcePaths` / `mixinConfigPath` / `sourceRoot` with `input.mode` plus `input.source` / `input.path` / `input.paths[]` / `input.configPaths[]` and `sourceRoots[]`. Use `input.mode="project"` when you want to discover `*.mixins.json` automatically from a workspace root. Use `summary.processingErrors` instead of `summary.errors`.
|
|
310
339
|
- `search-class-source` removed `snippetLines`, `includeDefinition`, and `includeOneHop`; responses now contain compact `hits[]` plus `nextCursor?` only, and `symbolKind` may only be used with `intent=symbol`.
|
|
311
340
|
`remap-mod-jar` requires Java to be installed and only supports Fabric/Quilt mods.
|
|
341
|
+
Mojang-mapped inputs can be returned as-is for `targetMapping="mojang"`. `targetMapping="yarn"` still expects an intermediary-built input jar.
|
|
312
342
|
|
|
313
343
|
## Resources
|
|
314
344
|
|
|
@@ -448,7 +478,8 @@ List source files under a specific package to understand project structure:
|
|
|
448
478
|
"className": "net.minecraft.server.Main",
|
|
449
479
|
"fromVersion": "1.20.1",
|
|
450
480
|
"toVersion": "1.21.10",
|
|
451
|
-
"mapping": "obfuscated"
|
|
481
|
+
"mapping": "obfuscated",
|
|
482
|
+
"includeFullDiff": false
|
|
452
483
|
}
|
|
453
484
|
}
|
|
454
485
|
```
|
|
@@ -470,6 +501,10 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
470
501
|
}
|
|
471
502
|
```
|
|
472
503
|
|
|
504
|
+
Registry deltas are returned under `result.registry` (not `registryDiff`).
|
|
505
|
+
When `packageFilter` is provided, `result.classes.addedCount`, `removedCount`, and `unchanged`
|
|
506
|
+
are all scoped to that filtered package set.
|
|
507
|
+
|
|
473
508
|
### Mapping & Symbols
|
|
474
509
|
|
|
475
510
|
#### Lookup mapping candidates
|
|
@@ -483,6 +518,7 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
483
518
|
"sourceMapping": "obfuscated",
|
|
484
519
|
"targetMapping": "mojang",
|
|
485
520
|
"sourcePriority": "loom-first",
|
|
521
|
+
"maxCandidates": 10,
|
|
486
522
|
"disambiguation": {
|
|
487
523
|
"ownerHint": "net.minecraft"
|
|
488
524
|
}
|
|
@@ -529,11 +565,14 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
529
565
|
"version": "1.21.10",
|
|
530
566
|
"className": "a.b.C",
|
|
531
567
|
"classNameMapping": "obfuscated",
|
|
532
|
-
"includeKinds": "class,field,method"
|
|
568
|
+
"includeKinds": "class,field,method",
|
|
569
|
+
"maxRows": 100
|
|
533
570
|
}
|
|
534
571
|
}
|
|
535
572
|
```
|
|
536
573
|
|
|
574
|
+
Add `maxCandidates` or `maxRows` when you only need the top matches or a bounded API slice.
|
|
575
|
+
|
|
537
576
|
#### Resolve workspace compile-visible symbol
|
|
538
577
|
```json
|
|
539
578
|
{
|
|
@@ -649,6 +688,7 @@ Decompile all classes and optionally retrieve a specific class inline:
|
|
|
649
688
|
"tool": "decompile-mod-jar",
|
|
650
689
|
"arguments": {
|
|
651
690
|
"jarPath": "/path/to/mymod-1.0.0.jar",
|
|
691
|
+
"includeFiles": false,
|
|
652
692
|
"className": "com.example.mymod.MyMod"
|
|
653
693
|
}
|
|
654
694
|
}
|
|
@@ -663,7 +703,8 @@ After decompilation, read any class without re-decompiling:
|
|
|
663
703
|
"tool": "get-mod-class-source",
|
|
664
704
|
"arguments": {
|
|
665
705
|
"jarPath": "/path/to/mymod-1.0.0.jar",
|
|
666
|
-
"className": "com.example.mymod.mixin.PlayerMixin"
|
|
706
|
+
"className": "com.example.mymod.mixin.PlayerMixin",
|
|
707
|
+
"maxLines": 120
|
|
667
708
|
}
|
|
668
709
|
}
|
|
669
710
|
```
|
|
@@ -699,6 +740,8 @@ Remap a Fabric mod from `intermediary` to `yarn` names for easier reading:
|
|
|
699
740
|
}
|
|
700
741
|
```
|
|
701
742
|
|
|
743
|
+
If the input jar was already built with Mojang mappings, use `targetMapping: "mojang"` to get a copied output jar and a `fromMapping: "mojang"` result.
|
|
744
|
+
|
|
702
745
|
### Validation
|
|
703
746
|
|
|
704
747
|
#### Validate Mixin source
|
|
@@ -714,7 +757,33 @@ Check a Mixin class source for correctness against a target Minecraft version:
|
|
|
714
757
|
"source": "@Mixin(PlayerEntity.class)\npublic abstract class PlayerMixin {\n @Inject(method = \"tick\", at = @At(\"HEAD\"))\n private void onTick(CallbackInfo ci) {}\n}"
|
|
715
758
|
},
|
|
716
759
|
"version": "1.21.10",
|
|
717
|
-
"mapping": "yarn"
|
|
760
|
+
"mapping": "yarn",
|
|
761
|
+
"reportMode": "compact",
|
|
762
|
+
"warningMode": "aggregated",
|
|
763
|
+
"includeIssues": false
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
#### Validate all Mixins in a project
|
|
769
|
+
|
|
770
|
+
Discover `*.mixins.json` files from a workspace root and validate every referenced Mixin in one call:
|
|
771
|
+
|
|
772
|
+
```json
|
|
773
|
+
{
|
|
774
|
+
"tool": "validate-mixin",
|
|
775
|
+
"arguments": {
|
|
776
|
+
"input": {
|
|
777
|
+
"mode": "project",
|
|
778
|
+
"path": "/workspace/modid"
|
|
779
|
+
},
|
|
780
|
+
"version": "1.21.10",
|
|
781
|
+
"projectPath": "/workspace/modid",
|
|
782
|
+
"preferProjectVersion": true,
|
|
783
|
+
"preferProjectMapping": true,
|
|
784
|
+
"reportMode": "compact",
|
|
785
|
+
"warningMode": "aggregated",
|
|
786
|
+
"includeIssues": false
|
|
718
787
|
}
|
|
719
788
|
}
|
|
720
789
|
```
|
|
@@ -735,7 +804,10 @@ Run the same validation settings against multiple Mixin source files:
|
|
|
735
804
|
]
|
|
736
805
|
},
|
|
737
806
|
"version": "1.21.10",
|
|
738
|
-
"mapping": "yarn"
|
|
807
|
+
"mapping": "yarn",
|
|
808
|
+
"reportMode": "compact",
|
|
809
|
+
"warningMode": "aggregated",
|
|
810
|
+
"includeIssues": false
|
|
739
811
|
}
|
|
740
812
|
}
|
|
741
813
|
```
|
|
@@ -765,7 +837,8 @@ Retrieve the full set of generated registries (blocks, items, entities, etc.) fo
|
|
|
765
837
|
{
|
|
766
838
|
"tool": "get-registry-data",
|
|
767
839
|
"arguments": {
|
|
768
|
-
"version": "1.21.10"
|
|
840
|
+
"version": "1.21.10",
|
|
841
|
+
"includeData": false
|
|
769
842
|
}
|
|
770
843
|
}
|
|
771
844
|
```
|
|
@@ -779,7 +852,8 @@ Fetch only a specific registry type:
|
|
|
779
852
|
"tool": "get-registry-data",
|
|
780
853
|
"arguments": {
|
|
781
854
|
"version": "1.21.10",
|
|
782
|
-
"registry": "minecraft:block"
|
|
855
|
+
"registry": "minecraft:block",
|
|
856
|
+
"maxEntriesPerRegistry": 50
|
|
783
857
|
}
|
|
784
858
|
}
|
|
785
859
|
```
|
|
@@ -809,6 +883,9 @@ Check server performance counters, cache sizes, and latency snapshots:
|
|
|
809
883
|
}
|
|
810
884
|
```
|
|
811
885
|
|
|
886
|
+
Cache entry counts and byte accounting are maintained incrementally during `resolve-artifact`, `index-artifact`, cache hits, and eviction, so `get-runtime-metrics` remains cheap even after repeated artifact loads.
|
|
887
|
+
Repeated mapping-heavy workflows such as `find-mapping`, `get-class-api-matrix`, `resolve-workspace-symbol`, `check-symbol-exists`, and `validate-mixin` also reuse hot-path resolution work to keep large batches responsive.
|
|
888
|
+
|
|
812
889
|
## Mapping Policy
|
|
813
890
|
|
|
814
891
|
### Namespace Definitions
|
|
@@ -838,6 +915,9 @@ Symbol query inputs use `kind` + `name` + optional `owner`/`descriptor`:
|
|
|
838
915
|
- for unobfuscated versions (for example 26.1+), requesting `intermediary` / `yarn` falls back to `obfuscated` with a warning.
|
|
839
916
|
- `mojang` requires source-backed artifacts; decompile-only paths are rejected with `ERR_MAPPING_NOT_APPLIED`.
|
|
840
917
|
|
|
918
|
+
When `trace-symbol-lifecycle` omits `descriptor`, the server resolves methods by owner+name and warns if overload ambiguity prevents a unique answer.
|
|
919
|
+
For decompile-only `ERR_MAPPING_NOT_APPLIED` failures, error details include `artifactOrigin`, `nextAction`, and `suggestedCall` so clients can recover without guessing.
|
|
920
|
+
|
|
841
921
|
If `find-class` or `get-class-source` returns no hit on an `obfuscated` artifact for names like `net.minecraft.world.item.Item`, the tool now warns that `obfuscated` means Mojang's obfuscated runtime names and recommends retrying with `mapping="mojang"` or translating via `find-mapping`.
|
|
842
922
|
|
|
843
923
|
Method descriptor precision is best on Tiny-backed paths (`intermediary`/`yarn`). For `obfuscated <-> mojang`, Mojang `client_mappings` do not carry JVM descriptors, so descriptor queries may fallback to name matching and emit a warning.
|
package/dist/cli.js
CHANGED
|
@@ -1,9 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { writeFileSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
2
4
|
import { startServer } from "./index.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
import { log } from "./logger.js";
|
|
6
|
+
import { STDIO_WORKER_MODE_ENV, StdioSupervisor } from "./stdio-supervisor.js";
|
|
7
|
+
const CHILD_PID_FILE_ENV = "MCP_SUPERVISOR_CHILD_PID_FILE";
|
|
8
|
+
const WORKER_READY_MARKER = "__MCP_STDIO_WORKER_READY__";
|
|
9
|
+
async function main() {
|
|
10
|
+
if (process.env[STDIO_WORKER_MODE_ENV] === "1") {
|
|
11
|
+
const pidFile = process.env[CHILD_PID_FILE_ENV];
|
|
12
|
+
if (pidFile) {
|
|
13
|
+
writeFileSync(pidFile, `${process.pid}\n`, "utf8");
|
|
14
|
+
}
|
|
15
|
+
// Worker mode runs behind the stdio supervisor; keep the process alive
|
|
16
|
+
// until the parent explicitly closes stdin or sends a signal.
|
|
17
|
+
const keepAliveTimer = setInterval(() => undefined, 60_000);
|
|
18
|
+
process.once("exit", () => clearInterval(keepAliveTimer));
|
|
19
|
+
await startServer();
|
|
20
|
+
process.stderr.write(`${WORKER_READY_MARKER}\n`);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const supervisor = new StdioSupervisor({
|
|
24
|
+
entryFile: fileURLToPath(import.meta.url)
|
|
25
|
+
});
|
|
26
|
+
await supervisor.start();
|
|
27
|
+
}
|
|
28
|
+
main().catch((err) => {
|
|
29
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
30
|
+
log("error", "cli.fatal", {
|
|
31
|
+
message: error.message,
|
|
32
|
+
stack: error.stack
|
|
33
|
+
});
|
|
7
34
|
process.exit(1);
|
|
8
35
|
});
|
|
9
36
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { JSONRPCMessage } from "@modelcontextprotocol/sdk/types.js";
|
|
2
2
|
type StdioReadable = NodeJS.ReadStream;
|
|
3
3
|
type StdioWritable = NodeJS.WriteStream;
|
|
4
4
|
export declare class CompatStdioServerTransport {
|
|
5
5
|
private readonly stdin;
|
|
6
6
|
private readonly stdout;
|
|
7
|
+
private readonly frameReader;
|
|
7
8
|
private started;
|
|
8
9
|
private closed;
|
|
9
|
-
private mode;
|
|
10
|
-
private buffer;
|
|
11
10
|
onclose?: () => void;
|
|
12
11
|
onerror?: (error: Error) => void;
|
|
13
12
|
onmessage?: (message: JSONRPCMessage) => void;
|
|
@@ -19,9 +18,5 @@ export declare class CompatStdioServerTransport {
|
|
|
19
18
|
private readonly handleStreamError;
|
|
20
19
|
private readonly handleStreamClosed;
|
|
21
20
|
private emitCloseOnce;
|
|
22
|
-
private processReadBuffer;
|
|
23
|
-
private detectMode;
|
|
24
|
-
private readLineDelimitedMessage;
|
|
25
|
-
private readContentLengthMessage;
|
|
26
21
|
}
|
|
27
22
|
export {};
|