@adhisang/minecraft-modding-mcp 1.2.1 → 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 +73 -0
- package/README.md +184 -64
- 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 +537 -202
- package/dist/json-rpc-framing.d.ts +22 -0
- package/dist/json-rpc-framing.js +168 -0
- package/dist/mapping-pipeline-service.d.ts +1 -1
- package/dist/mapping-pipeline-service.js +13 -5
- package/dist/mapping-service.d.ts +12 -4
- package/dist/mapping-service.js +222 -105
- package/dist/mcp-helpers.d.ts +10 -2
- package/dist/mcp-helpers.js +59 -5
- package/dist/minecraft-explorer-service.d.ts +1 -2
- package/dist/minecraft-explorer-service.js +120 -24
- package/dist/mixin-validator.d.ts +24 -2
- package/dist/mixin-validator.js +228 -103
- 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/mojang-tiny-mapping-service.js +26 -26
- package/dist/path-resolver.js +41 -4
- package/dist/registry-service.d.ts +10 -1
- package/dist/registry-service.js +154 -22
- package/dist/resources.js +7 -7
- package/dist/search-hit-accumulator.d.ts +0 -3
- package/dist/search-hit-accumulator.js +27 -6
- package/dist/source-jar-reader.js +16 -2
- package/dist/source-resolver.d.ts +1 -0
- package/dist/source-resolver.js +93 -2
- package/dist/source-service.d.ts +76 -47
- package/dist/source-service.js +1344 -763
- package/dist/stdio-supervisor.d.ts +46 -0
- package/dist/stdio-supervisor.js +349 -0
- package/dist/storage/files-repo.d.ts +3 -0
- package/dist/storage/files-repo.js +66 -1
- package/dist/storage/migrations.d.ts +1 -1
- package/dist/storage/migrations.js +6 -2
- package/dist/storage/schema.d.ts +1 -0
- package/dist/storage/schema.js +7 -0
- 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/tool-input.d.ts +6 -0
- package/dist/tool-input.js +64 -0
- package/dist/types.d.ts +1 -1
- 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 +4 -1
package/README.md
CHANGED
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
|
|
12
12
|
`@adhisang/minecraft-modding-mcp` is an [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that gives AI assistants deep access to Minecraft's source code, mappings, and mod tooling.
|
|
13
13
|
|
|
14
|
-
It lets you explore decompiled Minecraft source, convert symbol names across four naming namespaces (`
|
|
14
|
+
It lets you explore decompiled Minecraft source, convert symbol names across four naming namespaces (`obfuscated`, `mojang`, `intermediary`, `yarn`), analyze and decompile Fabric/Forge/NeoForge mod JARs, validate Mixin and Access Widener files, read and patch NBT data, and query generated registry snapshots — all through a structured tool and resource interface designed for Claude Desktop, VS Code, and other MCP-capable clients.
|
|
15
15
|
|
|
16
16
|
**29 tools** | **7 resources** | **4 namespace mappings** | **SQLite-backed cache**
|
|
17
17
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
20
|
- **Source Exploration** — Browse and search decompiled Minecraft source code with line-level precision and cursor-paginated file listing
|
|
21
|
-
- **Multi-Mapping Conversion** — Translate class, field, and method names between `
|
|
21
|
+
- **Multi-Mapping Conversion** — Translate class, field, and method names between `obfuscated`, `mojang`, `intermediary`, and `yarn` namespaces
|
|
22
22
|
- **Symbol Lifecycle Tracking** — Trace when a method or field first appeared, disappeared, or changed across Minecraft versions
|
|
23
23
|
- **Mod JAR Analysis** — Extract metadata, dependencies, entrypoints, and Mixin configs from Fabric/Forge/NeoForge mod JARs
|
|
24
24
|
- **Mixin & Access Widener Validation** — Parse and validate Mixin source and `.accesswidener` files against a target Minecraft version
|
|
@@ -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` | `
|
|
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
|
|
185
|
-
| `get-class-members` | Get class fields/methods/constructors from bytecode | `className`, `
|
|
186
|
-
| `search-class-source` | Search indexed class source for symbols/text/path | `artifactId`, `query`, `intent?`, `match?`, `packagePrefix?`, `fileGlob?`, `symbolKind?`, `
|
|
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`, `
|
|
209
|
-
| `get-class-api-matrix` | Show one class API as a mapping matrix (`
|
|
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 | `
|
|
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,48 +247,98 @@ 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
|
|
254
254
|
|
|
255
|
-
`
|
|
256
|
-
`get-class-
|
|
257
|
-
`
|
|
258
|
-
`
|
|
255
|
+
`resolve-artifact` now takes `target: { kind, value }`.
|
|
256
|
+
`get-class-source` requires `target`, where `target.type="artifact"` selects a previously resolved `artifactId` and `target.type="resolve"` supplies `{ kind, value }` directly.
|
|
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.
|
|
261
|
+
Positive integer tool parameters accept numeric strings such as `"10"` in addition to JSON numbers.
|
|
262
|
+
This numeric-string coercion only applies to documented top-level tool arguments; nested `typedJson` payloads and JSON Patch `value` objects are preserved verbatim.
|
|
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.
|
|
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.
|
|
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.
|
|
259
285
|
`validate-mixin` validates `@Invoker` targets against methods only and `@Accessor` targets against fields only.
|
|
260
286
|
`validate-mixin` parser supports both `.class` literal targets and `targets = "..."` / `targets = {"a", "b"}` string forms.
|
|
261
287
|
`validate-mixin` parser handles multi-line annotations between `@Shadow`/`@Accessor` and declarations, and strips inline annotations from declaration lines.
|
|
262
288
|
`validate-mixin` distinguishes `target-mapping-failed` (warning, uncertain) from `target-not-found` (error) when class mapping fails.
|
|
263
289
|
`validate-mixin` issues and `structuredWarnings` include `category` (`mapping`, `configuration`, `validation`, `resolution`, or `parse`) to distinguish setup/tooling/parser limits from real validation errors.
|
|
264
290
|
`validate-mixin` supports post-filtering with `minSeverity`, `hideUncertain`, and `warningCategoryFilter`; `treatInfoAsWarning=false` suppresses info-level entries in `structuredWarnings`.
|
|
265
|
-
`validate-mixin`
|
|
266
|
-
`validate-mixin` with `explain=true` enriches each issue with `explanation` and `suggestedCall` (tool + params) for agent-driven recovery.
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
`
|
|
291
|
+
`validate-mixin` per-result responses include `resolvedMembers?` tracking each member's resolution status (`resolved` or `not-found`).
|
|
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`.
|
|
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.
|
|
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.
|
|
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`.
|
|
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.
|
|
270
301
|
`resolve-artifact` includes `sampleEntries` only when a source JAR is resolved; decompile-only paths leave it unset.
|
|
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.
|
|
271
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.
|
|
272
|
-
`
|
|
304
|
+
`find-class` returns an explanatory warning when an `obfuscated` artifact is queried with names that look like deobfuscated Mojang classes.
|
|
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.
|
|
306
|
+
`search-class-source` uses `limit: 20` by default.
|
|
273
307
|
`search-class-source` `queryMode` controls text search strategy: `auto` (default) uses indexed token search with literal fallback for separator queries, `token` keeps indexed token behavior only, and `literal` uses substring scan only.
|
|
274
308
|
`search-class-source` with `match=regex` enforces `query.length <= 200` and a strict result cap of `100`.
|
|
309
|
+
`search-class-source` now returns compact file hits without snippets, line windows, relation expansion, or `totalApprox`.
|
|
310
|
+
Use `get-artifact-file` or `get-class-source` to inspect returned files after search.
|
|
311
|
+
`search-class-source` `symbolKind` is only supported when `intent=symbol`.
|
|
275
312
|
`get-artifact-file` byte truncation now preserves UTF-8 character boundaries, preventing replacement-character (`�`) corruption when `maxBytes` cuts through multibyte text.
|
|
276
313
|
`search-class-source` `fileGlob` supports `*`, `**`, and `?`; recursive patterns such as `net/minecraft/**/*.java` are supported.
|
|
277
314
|
`get-class-source` fallback matching enforces package compatibility and returns `ERR_CLASS_NOT_FOUND` when only name-colliding classes from other packages exist.
|
|
315
|
+
`get-class-source` now falls back to the sibling binary artifact when a source-backed artifact is only partial (for example, merged Loom sources without `net.minecraft` entries); if that fallback still cannot produce source, the error now carries the partial-source context and suggests `get-class-api-matrix` instead of `find-class`.
|
|
316
|
+
`get-class-source` warns when fallback source text is returned in a different namespace than the requested mapping; the source text itself is not remapped.
|
|
278
317
|
`get-class-source` mode defaults to `metadata` (symbol outline only); `mode=snippet` auto-sets `maxLines=200` when no line range/max is provided; `mode=full` returns the entire source. `outputFile` writes the selected text and returns the file path in `outputFile`.
|
|
279
318
|
Decompile fallback for `resolve-artifact`/`get-class-source` now invokes Vineflower with flags before positional `<input-jar> <output-dir>` arguments to avoid false `ERR_DECOMPILER_FAILED` outcomes on valid jars.
|
|
280
|
-
`resolve-artifact` with `
|
|
281
|
-
|
|
319
|
+
`resolve-artifact` with `target.kind=jar` only auto-adopts the exact sibling `"<jar-basename>-sources.jar"`. Other adjacent `*-sources.jar` files are returned as `adjacentSourceCandidates` info only and are never auto-selected.
|
|
320
|
+
When a resolved artifact comes from a `*-sources.jar`, `get-class-members` now keeps the sibling binary jar (for example `minecraft-merged-<version>.jar`) instead of treating the source jar as bytecode, and it now looks up the class in the resolved artifact namespace before remapping member names back to the requested mapping.
|
|
321
|
+
For `target.kind=coordinate` with a classifier (`group:artifact:version:classifier`), local Maven source lookup checks `<artifact>-<version>-<classifier>-sources.jar` first and then `<artifact>-<version>-sources.jar`.
|
|
282
322
|
Mod tool `jarPath` inputs are normalized to a canonical local `.jar` file path before existence checks, cache keying, and processing.
|
|
283
323
|
`search-mod-source` enforces `query.length <= 200` and `limit <= 200`.
|
|
284
324
|
`search-mod-source` detects source-only jars and searches `.java` entries directly without decompilation.
|
|
285
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.
|
|
286
327
|
`find-mapping` returns `ambiguityReasons` when `status=ambiguous` to explain why candidates could not be uniquely resolved.
|
|
287
328
|
`get-class-api-matrix` returns `ambiguousRowCount` when one or more rows required ambiguity fallback.
|
|
288
329
|
`check-symbol-exists` defaults to strict FQCN class inputs; set `nameMode=auto` to allow short class names (ambiguous matches return `status=ambiguous`).
|
|
289
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.
|
|
290
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`.
|
|
334
|
+
Migration notes:
|
|
335
|
+
- Replace `resolve-artifact` `targetKind` + `targetValue` with `target: { kind, value }`.
|
|
336
|
+
- Replace `get-class-source` / `get-class-members` top-level `artifactId` / `targetKind` / `targetValue` with `target: { type: "artifact", artifactId }` or `target: { type: "resolve", kind, value }`.
|
|
337
|
+
- `resolve-method-mapping-exact` is method-only and no longer accepts `kind`.
|
|
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`.
|
|
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`.
|
|
291
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.
|
|
292
342
|
|
|
293
343
|
## Resources
|
|
294
344
|
|
|
@@ -311,6 +361,9 @@ MCP resources provide URI-based access to Minecraft data, usable by any MCP clie
|
|
|
311
361
|
| `class-members` | `mc://artifact/{artifactId}/members/{className}` | List constructors, methods, and fields for a class |
|
|
312
362
|
| `artifact-metadata` | `mc://artifact/{artifactId}` | Metadata for a previously resolved artifact |
|
|
313
363
|
|
|
364
|
+
`versions-list`, `runtime-metrics`, `find-mapping`, `class-members`, and `artifact-metadata` return structured JSON envelopes on success (`{ result, meta }`) and failure (`{ error, meta }`).
|
|
365
|
+
`class-source` and `artifact-file` keep raw text responses on success, but still return structured JSON errors on failure.
|
|
366
|
+
|
|
314
367
|
## Response Envelope
|
|
315
368
|
|
|
316
369
|
All tools return exactly one of:
|
|
@@ -318,6 +371,9 @@ All tools return exactly one of:
|
|
|
318
371
|
- Success: `{ result: { ... }, meta: { requestId, tool, durationMs, warnings[] } }`
|
|
319
372
|
- Failure: `{ error: { type, title, detail, status, code, instance, fieldErrors?, hints? }, meta: { requestId, tool, durationMs, warnings[] } }`
|
|
320
373
|
|
|
374
|
+
JSON resources follow the same `result/error/meta` pattern. Text resources return plain text on success.
|
|
375
|
+
The same JSON envelope is mirrored in MCP `structuredContent` for SDK-aware clients, and failures also set `isError=true`.
|
|
376
|
+
|
|
321
377
|
## Examples
|
|
322
378
|
|
|
323
379
|
### Source Exploration
|
|
@@ -327,9 +383,11 @@ All tools return exactly one of:
|
|
|
327
383
|
{
|
|
328
384
|
"tool": "resolve-artifact",
|
|
329
385
|
"arguments": {
|
|
330
|
-
"
|
|
331
|
-
|
|
332
|
-
|
|
386
|
+
"target": {
|
|
387
|
+
"kind": "version",
|
|
388
|
+
"value": "1.21.10"
|
|
389
|
+
},
|
|
390
|
+
"mapping": "obfuscated",
|
|
333
391
|
"allowDecompile": true,
|
|
334
392
|
"projectPath": "/path/to/mod/workspace"
|
|
335
393
|
}
|
|
@@ -341,7 +399,10 @@ All tools return exactly one of:
|
|
|
341
399
|
{
|
|
342
400
|
"tool": "get-class-source",
|
|
343
401
|
"arguments": {
|
|
344
|
-
"
|
|
402
|
+
"target": {
|
|
403
|
+
"type": "artifact",
|
|
404
|
+
"artifactId": "<artifact-id>"
|
|
405
|
+
},
|
|
345
406
|
"className": "net.minecraft.server.Main",
|
|
346
407
|
"startLine": 50,
|
|
347
408
|
"endLine": 180,
|
|
@@ -358,8 +419,7 @@ All tools return exactly one of:
|
|
|
358
419
|
"artifactId": "<artifact-id>",
|
|
359
420
|
"query": "tickServer",
|
|
360
421
|
"intent": "symbol",
|
|
361
|
-
"match": "exact"
|
|
362
|
-
"includeOneHop": true
|
|
422
|
+
"match": "exact"
|
|
363
423
|
}
|
|
364
424
|
}
|
|
365
425
|
```
|
|
@@ -371,7 +431,7 @@ All tools return exactly one of:
|
|
|
371
431
|
"arguments": {
|
|
372
432
|
"artifactId": "<artifact-id>",
|
|
373
433
|
"className": "net.minecraft.server.Main",
|
|
374
|
-
"mapping": "
|
|
434
|
+
"mapping": "obfuscated",
|
|
375
435
|
"access": "all",
|
|
376
436
|
"includeInherited": true,
|
|
377
437
|
"maxMembers": 300
|
|
@@ -418,7 +478,8 @@ List source files under a specific package to understand project structure:
|
|
|
418
478
|
"className": "net.minecraft.server.Main",
|
|
419
479
|
"fromVersion": "1.20.1",
|
|
420
480
|
"toVersion": "1.21.10",
|
|
421
|
-
"mapping": "
|
|
481
|
+
"mapping": "obfuscated",
|
|
482
|
+
"includeFullDiff": false
|
|
422
483
|
}
|
|
423
484
|
}
|
|
424
485
|
```
|
|
@@ -440,6 +501,10 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
440
501
|
}
|
|
441
502
|
```
|
|
442
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
|
+
|
|
443
508
|
### Mapping & Symbols
|
|
444
509
|
|
|
445
510
|
#### Lookup mapping candidates
|
|
@@ -450,9 +515,10 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
450
515
|
"version": "1.21.10",
|
|
451
516
|
"kind": "class",
|
|
452
517
|
"name": "a.b.C",
|
|
453
|
-
"sourceMapping": "
|
|
518
|
+
"sourceMapping": "obfuscated",
|
|
454
519
|
"targetMapping": "mojang",
|
|
455
520
|
"sourcePriority": "loom-first",
|
|
521
|
+
"maxCandidates": 10,
|
|
456
522
|
"disambiguation": {
|
|
457
523
|
"ownerHint": "net.minecraft"
|
|
458
524
|
}
|
|
@@ -470,7 +536,7 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
470
536
|
"name": "tick",
|
|
471
537
|
"owner": "a.b.C",
|
|
472
538
|
"descriptor": "(I)V",
|
|
473
|
-
"sourceMapping": "
|
|
539
|
+
"sourceMapping": "obfuscated",
|
|
474
540
|
"targetMapping": "intermediary"
|
|
475
541
|
}
|
|
476
542
|
}
|
|
@@ -482,11 +548,10 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
482
548
|
"tool": "resolve-method-mapping-exact",
|
|
483
549
|
"arguments": {
|
|
484
550
|
"version": "1.21.10",
|
|
485
|
-
"kind": "method",
|
|
486
551
|
"name": "f",
|
|
487
552
|
"owner": "a.b.C",
|
|
488
553
|
"descriptor": "(Ljava/lang/String;)V",
|
|
489
|
-
"sourceMapping": "
|
|
554
|
+
"sourceMapping": "obfuscated",
|
|
490
555
|
"targetMapping": "mojang"
|
|
491
556
|
}
|
|
492
557
|
}
|
|
@@ -499,12 +564,15 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
499
564
|
"arguments": {
|
|
500
565
|
"version": "1.21.10",
|
|
501
566
|
"className": "a.b.C",
|
|
502
|
-
"classNameMapping": "
|
|
503
|
-
"includeKinds": "class,field,method"
|
|
567
|
+
"classNameMapping": "obfuscated",
|
|
568
|
+
"includeKinds": "class,field,method",
|
|
569
|
+
"maxRows": 100
|
|
504
570
|
}
|
|
505
571
|
}
|
|
506
572
|
```
|
|
507
573
|
|
|
574
|
+
Add `maxCandidates` or `maxRows` when you only need the top matches or a bounded API slice.
|
|
575
|
+
|
|
508
576
|
#### Resolve workspace compile-visible symbol
|
|
509
577
|
```json
|
|
510
578
|
{
|
|
@@ -516,7 +584,7 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
516
584
|
"name": "f",
|
|
517
585
|
"owner": "a.b.C",
|
|
518
586
|
"descriptor": "(Ljava/lang/String;)V",
|
|
519
|
-
"sourceMapping": "
|
|
587
|
+
"sourceMapping": "obfuscated"
|
|
520
588
|
}
|
|
521
589
|
}
|
|
522
590
|
```
|
|
@@ -531,7 +599,7 @@ Get a high-level summary of what changed between two releases, including class a
|
|
|
531
599
|
"name": "f",
|
|
532
600
|
"owner": "a.b.C",
|
|
533
601
|
"descriptor": "(I)V",
|
|
534
|
-
"sourceMapping": "
|
|
602
|
+
"sourceMapping": "obfuscated"
|
|
535
603
|
}
|
|
536
604
|
}
|
|
537
605
|
```
|
|
@@ -620,6 +688,7 @@ Decompile all classes and optionally retrieve a specific class inline:
|
|
|
620
688
|
"tool": "decompile-mod-jar",
|
|
621
689
|
"arguments": {
|
|
622
690
|
"jarPath": "/path/to/mymod-1.0.0.jar",
|
|
691
|
+
"includeFiles": false,
|
|
623
692
|
"className": "com.example.mymod.MyMod"
|
|
624
693
|
}
|
|
625
694
|
}
|
|
@@ -634,7 +703,8 @@ After decompilation, read any class without re-decompiling:
|
|
|
634
703
|
"tool": "get-mod-class-source",
|
|
635
704
|
"arguments": {
|
|
636
705
|
"jarPath": "/path/to/mymod-1.0.0.jar",
|
|
637
|
-
"className": "com.example.mymod.mixin.PlayerMixin"
|
|
706
|
+
"className": "com.example.mymod.mixin.PlayerMixin",
|
|
707
|
+
"maxLines": 120
|
|
638
708
|
}
|
|
639
709
|
}
|
|
640
710
|
```
|
|
@@ -670,6 +740,8 @@ Remap a Fabric mod from `intermediary` to `yarn` names for easier reading:
|
|
|
670
740
|
}
|
|
671
741
|
```
|
|
672
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
|
+
|
|
673
745
|
### Validation
|
|
674
746
|
|
|
675
747
|
#### Validate Mixin source
|
|
@@ -680,9 +752,38 @@ Check a Mixin class source for correctness against a target Minecraft version:
|
|
|
680
752
|
{
|
|
681
753
|
"tool": "validate-mixin",
|
|
682
754
|
"arguments": {
|
|
683
|
-
"
|
|
755
|
+
"input": {
|
|
756
|
+
"mode": "inline",
|
|
757
|
+
"source": "@Mixin(PlayerEntity.class)\npublic abstract class PlayerMixin {\n @Inject(method = \"tick\", at = @At(\"HEAD\"))\n private void onTick(CallbackInfo ci) {}\n}"
|
|
758
|
+
},
|
|
684
759
|
"version": "1.21.10",
|
|
685
|
-
"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
|
|
686
787
|
}
|
|
687
788
|
}
|
|
688
789
|
```
|
|
@@ -695,12 +796,18 @@ Run the same validation settings against multiple Mixin source files:
|
|
|
695
796
|
{
|
|
696
797
|
"tool": "validate-mixin",
|
|
697
798
|
"arguments": {
|
|
698
|
-
"
|
|
699
|
-
"
|
|
700
|
-
"
|
|
701
|
-
|
|
799
|
+
"input": {
|
|
800
|
+
"mode": "paths",
|
|
801
|
+
"paths": [
|
|
802
|
+
"/path/to/PlayerMixin.java",
|
|
803
|
+
"/path/to/WorldMixin.java"
|
|
804
|
+
]
|
|
805
|
+
},
|
|
702
806
|
"version": "1.21.10",
|
|
703
|
-
"mapping": "yarn"
|
|
807
|
+
"mapping": "yarn",
|
|
808
|
+
"reportMode": "compact",
|
|
809
|
+
"warningMode": "aggregated",
|
|
810
|
+
"includeIssues": false
|
|
704
811
|
}
|
|
705
812
|
}
|
|
706
813
|
```
|
|
@@ -730,7 +837,8 @@ Retrieve the full set of generated registries (blocks, items, entities, etc.) fo
|
|
|
730
837
|
{
|
|
731
838
|
"tool": "get-registry-data",
|
|
732
839
|
"arguments": {
|
|
733
|
-
"version": "1.21.10"
|
|
840
|
+
"version": "1.21.10",
|
|
841
|
+
"includeData": false
|
|
734
842
|
}
|
|
735
843
|
}
|
|
736
844
|
```
|
|
@@ -744,7 +852,8 @@ Fetch only a specific registry type:
|
|
|
744
852
|
"tool": "get-registry-data",
|
|
745
853
|
"arguments": {
|
|
746
854
|
"version": "1.21.10",
|
|
747
|
-
"registry": "minecraft:block"
|
|
855
|
+
"registry": "minecraft:block",
|
|
856
|
+
"maxEntriesPerRegistry": 50
|
|
748
857
|
}
|
|
749
858
|
}
|
|
750
859
|
```
|
|
@@ -774,20 +883,25 @@ Check server performance counters, cache sizes, and latency snapshots:
|
|
|
774
883
|
}
|
|
775
884
|
```
|
|
776
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
|
+
|
|
777
889
|
## Mapping Policy
|
|
778
890
|
|
|
779
891
|
### Namespace Definitions
|
|
780
892
|
|
|
781
893
|
| Namespace | Description |
|
|
782
894
|
| --- | --- |
|
|
783
|
-
| `
|
|
895
|
+
| `obfuscated` | Mojang obfuscated names (e.g. `a`, `b`, `c`) |
|
|
784
896
|
| `mojang` | Mojang deobfuscated names from `client_mappings.txt` (e.g. `net.minecraft.server.Main`) |
|
|
785
897
|
| `intermediary` | Fabric stable intermediary names (e.g. `net.minecraft.class_1234`, `method_5678`) |
|
|
786
898
|
| `yarn` | Fabric community human-readable names (e.g. `net.minecraft.server.MinecraftServer`, `tick`) |
|
|
787
899
|
|
|
900
|
+
The legacy public namespace name `official` was removed. Requests that still send `official` now fail validation and should be updated to `obfuscated`.
|
|
901
|
+
|
|
788
902
|
### Lookup Rules
|
|
789
903
|
|
|
790
|
-
`find-mapping` supports lookup across `
|
|
904
|
+
`find-mapping` supports lookup across `obfuscated`, `mojang`, `intermediary`, and `yarn`.
|
|
791
905
|
|
|
792
906
|
Symbol query inputs use `kind` + `name` + optional `owner`/`descriptor`:
|
|
793
907
|
- class: `kind=class`, `name=a.b.C` (default FQCN). For existence checks only, `nameMode=auto` allows short names like `C`.
|
|
@@ -796,12 +910,17 @@ Symbol query inputs use `kind` + `name` + optional `owner`/`descriptor`:
|
|
|
796
910
|
|
|
797
911
|
`mapping: "mojang"` requires a source-backed artifact. If only decompile path is available, the server returns `ERR_MAPPING_NOT_APPLIED`.
|
|
798
912
|
|
|
799
|
-
`resolve-artifact`, `get-class-members`, `trace-symbol-lifecycle`, and `diff-class-signatures` accept `
|
|
800
|
-
- `intermediary` / `yarn` require a resolvable Minecraft version context (for example `
|
|
801
|
-
- for unobfuscated versions (for example 26.1+), requesting `intermediary` / `yarn` falls back to `
|
|
913
|
+
`resolve-artifact`, `get-class-members`, `trace-symbol-lifecycle`, and `diff-class-signatures` accept `obfuscated | mojang | intermediary | yarn` with constraints:
|
|
914
|
+
- `intermediary` / `yarn` require a resolvable Minecraft version context (for example `target.kind=version` or a versioned coordinate).
|
|
915
|
+
- for unobfuscated versions (for example 26.1+), requesting `intermediary` / `yarn` falls back to `obfuscated` with a warning.
|
|
802
916
|
- `mojang` requires source-backed artifacts; decompile-only paths are rejected with `ERR_MAPPING_NOT_APPLIED`.
|
|
803
917
|
|
|
804
|
-
|
|
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
|
+
|
|
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`.
|
|
922
|
+
|
|
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.
|
|
805
924
|
|
|
806
925
|
Use `resolve-method-mapping-exact` when candidate ranking is not enough and the workflow needs strict `owner+name+descriptor` certainty.
|
|
807
926
|
Use `find-mapping` `disambiguation.ownerHint` / `disambiguation.descriptorHint` to narrow ambiguous candidate sets.
|
|
@@ -867,6 +986,7 @@ The server runs as a single long-lived process communicating over stdio. Artifac
|
|
|
867
986
|
- `SourceService` is the canonical implementation for artifact resolution, ingestion, and source querying.
|
|
868
987
|
- `version` resolution downloads Mojang client JARs into cache and routes them through the same ingestion flow as `jar` and `coordinate` targets.
|
|
869
988
|
- Tool responses are always wrapped as `{ result?, error?, meta }`.
|
|
989
|
+
- Tool responses also mirror that envelope into MCP `structuredContent`, and failures set `isError=true`.
|
|
870
990
|
- `meta` includes `requestId`, `tool`, `durationMs`, and `warnings[]`.
|
|
871
991
|
|
|
872
992
|
## License
|
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 {};
|