@adhisang/minecraft-modding-mcp 3.1.0 → 3.1.1

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 CHANGED
@@ -5,6 +5,31 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.1.1] - 2026-03-21
9
+
10
+ ### Fixed
11
+ - `analyze-symbol task="api-overview"` now inherits `sourceMapping` as the default `classNameMapping`, avoiding unintended fallback to `obfuscated` when callers omit `classNameMapping`.
12
+ - `get-class-api-matrix` now builds rows from the explicitly requested `classNameMapping` instead of silently pivoting to `obfuscated` when both identities are available.
13
+ - `find-mapping` now accepts short obfuscated class ids such as `dhl` when `sourceMapping="obfuscated"` instead of rejecting them at input validation.
14
+ - `find-mapping` now restores `mojang -> intermediary`, `mojang -> yarn`, and `intermediary -> mojang` conversions on mappings builds where those paths previously failed.
15
+ - `trace-symbol-lifecycle` now strips an accidental inline signature suffix from `symbol` before splitting `Class.method`, preventing misparsed lifecycle lookups while keeping the separate `descriptor` field as the exact-match path.
16
+ - `trace-symbol-lifecycle` now rejects class-like `symbol` inputs such as `net.minecraft.world.item.Item` with `ERR_INVALID_INPUT` instead of scanning versions until lookup work fails elsewhere.
17
+ - `analyze-symbol task="lifecycle"` now applies its required `version` as the lifecycle scan upper bound instead of ignoring that input and always scanning the default full range, and the high-level helper now keeps that scan to a recent 5-version window for predictable runtime.
18
+ - `trace-symbol-lifecycle` now completes broad lifecycle scans more reliably without long stalls.
19
+ - `analyze-mod` and `validate-project` now return retryable `suggestedCall` guidance when older string-subject or domain-include payloads fail with `ERR_INVALID_INPUT`.
20
+ - `validate-mixin` and `validate-project task="project-summary"` now treat empty mixin configs as warning-only discovery results with zero validated classes instead of `ERR_INVALID_INPUT`.
21
+ - `inspect-minecraft` now keeps workspace `class-overview`, class-like `search`, and `list-files` usable when source coverage is partial, with partial-status guidance where needed.
22
+ - `inspect-minecraft` invalid task/subject combinations now return retryable `suggestedCall` guidance instead of dead-end `ERR_INVALID_INPUT` messages, preserving the requested task when artifact context is the only missing input and otherwise pointing to the subject-compatible retry path.
23
+ - Path-based environment overrides now treat blank values and the literal strings `undefined` and `null` as unset, preventing accidental `./undefined` and `./null` cache roots and invalid JAR override paths when clients serialize missing values incorrectly.
24
+
25
+ ### Performance
26
+ - `trace-symbol-lifecycle`, `check-symbol-exists`, and `find-mapping` now respond faster on Mojang/obfuscated-only workflows, especially on cold lookups.
27
+
28
+ ### Documentation
29
+ - Shortened the English and Japanese READMEs so onboarding guidance, workflow notes, and detailed reference material no longer repeat the same content across multiple sections.
30
+ - Simplified the generated tool-surface tables in both READMEs to compact purpose-only summaries and pointed exact input/output details to `docs/tool-reference.md`.
31
+ - Rewrote the Japanese workflow guidance in more natural Japanese and clarified that the detailed examples and full reference remain English-first for now.
32
+
8
33
  ## [3.1.0] - 2026-03-15
9
34
 
10
35
  ### Changed
@@ -16,15 +41,11 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
16
41
  - Error recovery payloads (`suggestedCall`) now omit parameters when the supplied value matches the tool's default behavior, keeping retryable calls smaller without changing their semantics.
17
42
 
18
43
  ### Performance
19
- - Explicit text/path scan fallbacks no longer materialize the full scoped file-path list before scanning, reducing heap growth and keeping full-scan cost more predictable on large artifacts.
20
- - Runtime metrics now keep cache LRU byte-accounting rows by reference and only materialize `cache_artifact_bytes_lru` during snapshot reads, removing per-publish array copies from the cache hit path.
44
+ - Explicit text and path scan fallbacks in `search-class-source` now use less memory and stay more predictable on large artifacts.
21
45
 
22
46
  ### Documentation
23
- - README tool tables are now validated from a shared contract manifest in code, correcting the documented `compare-minecraft` class-only `subject.kind="class".sourcePriority` input and aligning the published `inspect-minecraft` / `validate-project` output summaries with the implementation.
24
- - Clarified the updated `search-class-source` `queryMode` behavior and the summary-first follow-up contract for the top-level workflow tools in both READMEs.
47
+ - Corrected the published `compare-minecraft` class-only `subject.kind="class".sourcePriority` input and aligned the documented `inspect-minecraft` / `validate-project` outputs with current behavior.
25
48
  - Documented that safe fixed defaults now appear in `tools/list` schema output and that `suggestedCall` omits default-valued parameters.
26
- - Reorganized the English README around package-user quick start, start-here examples, and linked reference docs so setup guidance is easier to scan without losing detailed contract notes.
27
- - Synchronized the Japanese README with the current English README structure, examples, quick-start guidance, and tool-surface summary.
28
49
 
29
50
  ## [3.0.0] - 2026-03-09
30
51
 
@@ -33,9 +54,6 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
33
54
  - The new v3 entry tools share `detail` / `include` response shaping and always return `result.summary` inside the standard `{ result?, error?, meta }` envelope, reducing default payload size and making next actions explicit.
34
55
  - `analyze-mod` now exposes `executionMode="preview" | "apply"` for safe remap planning and execution, and `manage-cache` now exposes the same preview/apply model for cache deletion, pruning, and rebuild workflows.
35
56
 
36
- ### Documentation
37
- - Added v3 entry-tool usage guidance, shared response-shaping notes, and entry-tool-first migration guidance to both READMEs.
38
-
39
57
  ### Fixed
40
58
  - `inspect-minecraft` now routes `subject.kind="workspace"` requests with `focus.kind="class" | "file" | "search"` through the matching task for `task=auto`, while preserving workspace-aware artifact resolution for focused file and search follow-up flows.
41
59
  - `inspect-minecraft task=class-overview | class-source | class-members` now accepts `subject.kind="workspace"` with `focus.kind="class"` even when the focus omits an explicit artifact reference, reusing workspace version detection to resolve artifact context first.
@@ -56,8 +74,8 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
56
74
 
57
75
  ### Fixed
58
76
  - `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.
59
- - 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.
60
- - 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.
77
+ - Heavy analysis tools now fail fast with `ERR_LIMIT_EXCEEDED` when too many expensive requests arrive at once, instead of letting the whole MCP session degrade under load.
78
+ - The stdio CLI now recovers more cleanly from unexpected internal exits, reducing full-session disconnects during live use.
61
79
  - `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.
62
80
  - `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.
63
81
  - Error recovery payloads (`suggestedCall`) now use the current `target` object schema instead of deprecated `targetKind` / `targetValue` fields.
@@ -70,7 +88,7 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
70
88
  - `resolve-workspace-symbol` now recognizes NeoForge ModDevGradle workspaces as `mojang` compile mappings instead of returning `mapping_unavailable`.
71
89
  - `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.
72
90
  - `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.
73
- - `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.
91
+ - `validate-mixin` now retries with Maven mapping data after Loom-only partial results when that can complete validation, reducing false warnings.
74
92
  - `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.
75
93
  - `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.
76
94
  - `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.
@@ -80,13 +98,11 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
80
98
  - `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.
81
99
 
82
100
  ### Documentation
83
- - Corrected the `compare-versions` README contract to document registry results under `result.registry`.
84
- - Documented the new compact-response options, `summary-first` validate-mixin mode, bare-string `target` recovery guidance, and updated token-efficient examples in both READMEs.
101
+ - Corrected the published `compare-versions` response docs to show registry results under `result.registry`.
85
102
 
86
103
  ### Performance
87
- - `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.
88
- - `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.
89
- - 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.
104
+ - Cache-heavy artifact loading and runtime metric reads now stay faster after repeated operations instead of rescanning cache state each time.
105
+ - `find-mapping`, `get-class-api-matrix`, `resolve-workspace-symbol`, `check-symbol-exists`, and `validate-mixin` now respond faster on repeated mapping-heavy workflows.
90
106
 
91
107
  ## [2.0.0] - 2026-03-07
92
108
 
@@ -102,7 +118,7 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
102
118
 
103
119
  ### Fixed
104
120
  - `resolve-artifact`: `targetKind=coordinate` now reuses the local Gradle `modules-2` cache in addition to the local Maven repository and configured source repos, so cached third-party libraries such as Architectury can resolve without manual cache spelunking.
105
- - `resolve-artifact`: `mapping=mojang` + Loom merged source discovery now flags partial source coverage with `qualityFlags=["partial-source-no-net-minecraft"]` and a warning when the selected source jar does not actually contain `net.minecraft` entries.
121
+ - `resolve-artifact`: `mapping=mojang` + Loom merged source discovery now warns when the selected source jar only provides partial Minecraft source coverage.
106
122
  - `get-class-source` / `get-class-members`: when an artifact is resolved from a `*-sources.jar`, the server now keeps the sibling binary jar and automatically falls back to it when source coverage is incomplete instead of treating the source jar as bytecode.
107
123
  - `get-class-source`: partial-source binary fallback now bypasses the same sibling `*-sources.jar` that triggered the miss, and fallback failures for vanilla classes point to `get-class-api-matrix` instead of misleading `find-class` recovery.
108
124
  - `get-class-members`: bytecode lookup now follows the resolved artifact namespace (`mappingApplied`) before remapping members back to the requested namespace, fixing merged Mojang artifacts that were incorrectly forced through obfuscated class names.
@@ -112,18 +128,14 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
112
128
  - Tool input parsing now leaves nested `typedJson` and JSON Patch `value` payload fields untouched, even when their keys happen to match top-level numeric option names such as `limit` or `maxLines`.
113
129
 
114
130
  ### Performance
115
- - `search-class-source`: reduce search latency, heap growth, and DB round-trips by returning compact hits only and skipping snippet hydration, relation expansion, and `totalApprox` count queries.
116
- - Tool input preprocessing now stays shallow, avoiding recursive scans through large nested payloads such as NBT typed JSON and patch bodies.
131
+ - `search-class-source` now returns compact hits more efficiently, reducing latency and memory use on larger artifacts.
117
132
 
118
133
  ## [1.2.1] - 2026-03-05
119
134
 
120
135
  ### Fixed
121
- - MCP startup regression: removed eager `SourceService` pre-initialization during server startup so `tools/list` handshakes are not blocked by SQLite initialization on slower environments.
136
+ - MCP startup regression: `tools/list` handshakes no longer stall on SQLite initialization in slower environments.
122
137
  - Decompiler: skip Java/Vineflower availability checks when decompiled source is already cached, avoiding unnecessary startup errors on systems without Java.
123
138
 
124
- ### Documentation
125
- - Clarified startup behavior in README (`SourceService` remains lazy and is not pre-initialized before tool discovery).
126
-
127
139
  ## [1.2.0] - 2026-03-05
128
140
 
129
141
  ### Added
@@ -165,12 +177,7 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
165
177
  - Mojang proguard mapping: JVM descriptor parsing fixes.
166
178
 
167
179
  ### Changed
168
- - Lazy `SourceService` initialization deferred until first tool/resource access, reducing cold-start latency during MCP handshake.
169
- - Eagerly init `SourceService` during MCP handshake idle time for faster first-request response.
170
-
171
- ### Performance
172
- - Avoid duplicate UTF-8 decode during truncation.
173
- - Eager `SourceService` init during handshake idle time.
180
+ - `SourceService` startup work now avoids slowing the MCP handshake while still using idle time to reduce the wait before the first source-heavy request.
174
181
 
175
182
  ## [1.1.1] - 2026-03-02
176
183
 
@@ -180,11 +187,8 @@ and this project aims to follow [Semantic Versioning](https://semver.org/spec/v2
180
187
 
181
188
  ## [1.1.0] - 2026-03-01
182
189
 
183
- ### Changed
184
- - Migrate stdio transport from mcp-use to @modelcontextprotocol/sdk.
185
-
186
190
  ### Fixed
187
- - Restore Codex startup handshake compatibility by accepting both newline-delimited and `Content-Length` stdio framing.
191
+ - Restore Codex startup handshake compatibility by accepting both newline-delimited and `Content-Length` stdio framing on stdio connections.
188
192
 
189
193
  ### Documentation
190
194
  - Add Quick Start setup for Claude Code, OpenAI Codex CLI, and Gemini CLI.
package/README.md CHANGED
@@ -128,6 +128,8 @@ Pass environment variables to override defaults:
128
128
 
129
129
  These six top-level workflow tools cover the common workflows and return summary-first results, so they are the best default starting points for agents and MCP clients.
130
130
 
131
+ All six return `result.summary` first, and can include `summary.nextActions` when there is a clear follow-up step. Use the table for tool selection, then use the examples and reference docs for exact payloads.
132
+
131
133
  | Tool | Start here for |
132
134
  | --- | --- |
133
135
  | `inspect-minecraft` | versions, artifacts, classes, files, and source search |
@@ -139,10 +141,13 @@ These six top-level workflow tools cover the common workflows and return summary
139
141
 
140
142
  ### Workflow Notes
141
143
 
142
- - These top-level workflow tools return `result.summary` first and include `summary.nextActions` when there is a clear follow-up step.
144
+ Keep only the high-frequency notes here. For the full pitfall list, exact contract details, migration notes, and environment variables, see [docs/tool-reference.md](docs/tool-reference.md).
145
+
143
146
  - `search-class-source` defaults to `queryMode="auto"` and keeps separator queries such as `foo.bar`, `foo_bar`, and `foo$bar` on the indexed path. Use `queryMode="literal"` for an explicit full substring scan.
144
- - When a public parameter has a fixed safe default, `tools/list` exposes it through the JSON Schema `default` field.
145
- - Error recovery `suggestedCall` payloads omit parameters when the supplied value already matches the tool default, keeping retry calls smaller without changing behavior.
147
+ - If you do not already have an artifact, prefer `subject.kind="workspace"` for `inspect-minecraft` instead of guessing artifact details. When artifact context is the only missing input, a retryable `suggestedCall` preserves the requested task.
148
+ - `trace-symbol-lifecycle` expects `Class.method` in `symbol`. Keep exact overload matching in the separate `descriptor` field.
149
+ - Workspace inspection can still confirm vanilla classes when source coverage is partial, and `inspect-minecraft task="list-files"` reports a partial result with follow-up guidance when that happens.
150
+ - `analyze-mod` and `validate-project` still require structured `subject` objects and canonical `include` groups, but stale string-subject or domain-include payloads now return `ERR_INVALID_INPUT` with a retryable `suggestedCall`.
146
151
 
147
152
  ### Inspect Minecraft source from a version
148
153
 
@@ -221,9 +226,9 @@ These six top-level workflow tools cover the common workflows and return summary
221
226
 
222
227
  ## Documentation
223
228
 
224
- - [Detailed example requests](docs/examples.md)
225
- - [Tool and configuration reference](docs/tool-reference.md)
226
- - [日本語 README](docs/README-ja.md)
229
+ - [Detailed example requests](docs/examples.md) for copyable payloads and common workflows
230
+ - [Tool and configuration reference](docs/tool-reference.md) for exact inputs, outputs, resource behavior, environment variables, and migration notes
231
+ - [日本語 README](docs/README-ja.md) for a Japanese onboarding overview
227
232
 
228
233
  ## Tool Surface
229
234
 
@@ -232,14 +237,14 @@ Start with these top-level workflow tools unless you already know the exact spec
232
237
  ### Top-Level Workflow Tools
233
238
 
234
239
  <!-- BEGIN GENERATED TOOL TABLE: v3-entry-tools -->
235
- | Tool | Purpose | Key Inputs | Key Outputs |
236
- | --- | --- | --- | --- |
237
- | `inspect-minecraft` | Start from a version, artifact, class, file, search query, or workspace and route to the most relevant Minecraft inspection flow | `task?`, `subject?`, `detail?`, `include?`, `limit?`, `cursor?`, `includeSnapshots?` | `result.summary`, `versions?`, `subject`, `artifact?`, `class?`, `source?`, `members?`, `search?`, `file?`, `files?` |
238
- | `analyze-symbol` | One entry point for symbol existence checks, namespace mapping, lifecycle tracing, workspace symbol analysis, and API overview | `task`, `subject`, `version?`, `sourceMapping?`, `targetMapping?`, `projectPath?`, `classNameMapping?`, `signatureMode?`, `nameMode?`, `includeKinds?`, `maxRows?`, `maxCandidates?`, `detail?`, `include?` | `result.summary`, `match?`, `candidates?`, `ambiguity?`, `matrix?`, `workspace?` |
239
- | `compare-minecraft` | Compare version pairs, class signatures, registries, or produce a migration-oriented overview | `task?`, `subject`, `detail?`, `include?`, `subject.kind="class".sourcePriority?`, `maxClassResults?`, `maxEntriesPerRegistry?`, `includeFullDiff?`, `limit?` | `result.summary`, `comparison`, `classes?`, `classDiff?`, `registry?`, `migration?` |
240
- | `analyze-mod` | Metadata-first entry point for mod summary, decompile/search flows, class source, and safe remap previews/applies | `task`, `subject`, `query?`, `searchType?`, `targetMapping?`, `outputJar?`, `executionMode?`, `includeFiles?`, `maxFiles?`, `maxLines?`, `maxChars?`, `limit?`, `detail?`, `include?` | `result.summary`, `metadata?`, `decompile?`, `hits?`, `source?`, `operation?` |
241
- | `validate-project` | Project-level validation entry for workspace summaries plus direct Mixin and Access Widener validation | `task`, `subject`, `version?`, `mapping?`, `sourcePriority?`, `scope?`, `preferProjectVersion?`, `preferProjectMapping?`, `sourceRoots?`, `configPaths?`, `minSeverity?`, `hideUncertain?`, `explain?`, `warningMode?`, `warningCategoryFilter?`, `treatInfoAsWarning?`, `includeIssues?`, `detail?`, `include?` | `result.summary`, `project`, `workspace?`, `issues?` |
242
- | `manage-cache` | User-facing cache summary, listing, verification, previewed deletion/pruning/rebuild, and explicit apply operations | `action`, `cacheKinds?`, `selector?`, `executionMode?`, `detail?`, `include?`, `limit?`, `cursor?` | `result.summary`, `stats?`, `cacheEntries?`, `operation?`, `meta.pagination.nextCursor?` |
240
+ | Tool | Purpose |
241
+ | --- | --- |
242
+ | `inspect-minecraft` | Inspect versions, artifacts, classes, files, source text, and workspace-aware lookup flows |
243
+ | `analyze-symbol` | Handle symbol existence checks, namespace mapping, lifecycle tracing, workspace symbol resolution, and API overviews |
244
+ | `compare-minecraft` | Compare version pairs, class diffs, registry diffs, and migration-oriented summaries |
245
+ | `analyze-mod` | Summarize mod metadata, decompile and search mod code, inspect class source, and preview or apply remaps |
246
+ | `validate-project` | Summarize workspaces and run direct Mixin or Access Widener validation |
247
+ | `manage-cache` | List, verify, and preview or apply cache cleanup and rebuild operations |
243
248
  <!-- END GENERATED TOOL TABLE: v3-entry-tools -->
244
249
 
245
250
  ### Source Exploration
@@ -247,17 +252,17 @@ Start with these top-level workflow tools unless you already know the exact spec
247
252
  Tools for browsing Minecraft versions, resolving source artifacts, and reading or searching decompiled source code.
248
253
 
249
254
  <!-- BEGIN GENERATED TOOL TABLE: source-exploration -->
250
- | Tool | Purpose | Key Inputs | Key Outputs |
251
- | --- | --- | --- | --- |
252
- | `list-versions` | List available Minecraft versions from Mojang manifest + local cache | `includeSnapshots?`, `limit?` | `result.latest`, `result.releases[]`, `meta.warnings[]` |
253
- | `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[]` |
254
- | `find-class` | Resolve simple or fully-qualified class names inside an artifact | `className`, `artifactId`, `limit?` | `matches[]`, `total`, `warnings[]` |
255
- | `get-class-source` | Get class source by artifact target or resolve target on demand (`mode=metadata` by default) | `className`, `target`, `mode?`, `mapping?`, `sourcePriority?`, `allowDecompile?`, `projectPath?`, `scope?`, `preferProjectVersion?`, `strictVersion?`, `startLine?`, `endLine?`, `maxLines?`, `maxChars?`, `outputFile?` | `mode`, `sourceText`, `returnedRange`, `truncated`, `charsTruncated?`, `outputFile?`, `artifactId`, `returnedNamespace`, `artifactContents`, mapping/provenance metadata |
256
- | `get-class-members` | Get class fields/methods/constructors from bytecode | `className`, `target`, `mapping?`, `sourcePriority?`, `allowDecompile?`, `access?`, `includeSynthetic?`, `includeInherited?`, `memberPattern?`, `maxMembers?`, `projectPath?`, `scope?`, `preferProjectVersion?`, `strictVersion?` | `members.{constructors,fields,methods}`, `counts`, `truncated`, `context`, `returnedNamespace`, `artifactContents`, `warnings[]` |
257
- | `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` |
258
- | `get-artifact-file` | Read full source file with byte guard | `artifactId`, `filePath`, `maxBytes?` | `content`, `contentBytes`, `truncated`, `mappingApplied`, `returnedNamespace`, `artifactContents` |
259
- | `list-artifact-files` | List indexed source file paths with cursor pagination | `artifactId`, `prefix?`, `limit?`, `cursor?` | `items[]`, `nextCursor?`, `mappingApplied`, `artifactContents`, `warnings[]` |
260
- | `index-artifact` | Rebuild index metadata for an existing artifact | `artifactId`, `force?` | `reindexed`, `reason`, `counts`, `indexedAt`, `durationMs` |
255
+ | Tool | Purpose |
256
+ | --- | --- |
257
+ | `list-versions` | List available Minecraft versions from Mojang metadata and local cache |
258
+ | `resolve-artifact` | Resolve source artifacts from versions, JAR paths, or Maven coordinates |
259
+ | `find-class` | Find simple or fully-qualified class names inside an artifact |
260
+ | `get-class-source` | Read class source from an artifact or resolve the backing artifact on demand |
261
+ | `get-class-members` | List constructors, fields, and methods from bytecode |
262
+ | `search-class-source` | Search indexed class source by symbol, text, or path |
263
+ | `get-artifact-file` | Read a full source file with a byte limit |
264
+ | `list-artifact-files` | List indexed source file paths with cursor pagination |
265
+ | `index-artifact` | Rebuild indexed metadata for an existing artifact |
261
266
  <!-- END GENERATED TOOL TABLE: source-exploration -->
262
267
 
263
268
  ### Version Comparison & Symbol Tracking
@@ -265,11 +270,11 @@ Tools for browsing Minecraft versions, resolving source artifacts, and reading o
265
270
  Tools for comparing class and registry changes across Minecraft versions and tracing symbol existence over time.
266
271
 
267
272
  <!-- BEGIN GENERATED TOOL TABLE: version-comparison-symbol-tracking -->
268
- | Tool | Purpose | Key Inputs | Key Outputs |
269
- | --- | --- | --- | --- |
270
- | `trace-symbol-lifecycle` | Trace when `Class.method` exists across Minecraft versions (`descriptor` omitted = name-only lookup) | `symbol`, `descriptor?`, `fromVersion?`, `toVersion?`, `mapping?`, `sourcePriority?`, `includeSnapshots?`, `maxVersions?`, `includeTimeline?` | `presence.firstSeen`, `presence.lastSeen`, `presence.missingBetween[]`, `presence.existsNow`, `timeline?`, `warnings[]` |
271
- | `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[]` |
272
- | `compare-versions` | Compare class/registry changes between two versions | `fromVersion`, `toVersion`, `category?`, `packageFilter?`, `maxClassResults?` | `classes`, `registry`, `summary`, `warnings[]` |
273
+ | Tool | Purpose |
274
+ | --- | --- |
275
+ | `trace-symbol-lifecycle` | Trace when `Class.method` exists across Minecraft versions |
276
+ | `diff-class-signatures` | Compare one class across two versions and return member deltas |
277
+ | `compare-versions` | Compare class and registry changes between two versions |
273
278
  <!-- END GENERATED TOOL TABLE: version-comparison-symbol-tracking -->
274
279
 
275
280
  ### Mapping & Symbols
@@ -277,13 +282,13 @@ Tools for comparing class and registry changes across Minecraft versions and tra
277
282
  Tools for converting symbol names between namespaces and checking symbol existence.
278
283
 
279
284
  <!-- BEGIN GENERATED TOOL TABLE: mapping-symbols -->
280
- | Tool | Purpose | Key Inputs | Key Outputs |
281
- | --- | --- | --- | --- |
282
- | `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[]` |
283
- | `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[]` |
284
- | `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[]` |
285
- | `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[]` |
286
- | `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[]` |
285
+ | Tool | Purpose |
286
+ | --- | --- |
287
+ | `find-mapping` | Look up mapping candidates for class, field, or method symbols |
288
+ | `resolve-method-mapping-exact` | Resolve one method mapping with strict owner, name, and descriptor matching |
289
+ | `get-class-api-matrix` | Show one class API across `obfuscated`, `mojang`, `intermediary`, and `yarn` |
290
+ | `resolve-workspace-symbol` | Resolve compile-visible symbol names from a Gradle workspace |
291
+ | `check-symbol-exists` | Check whether a class, field, or method exists in a namespace |
287
292
  <!-- END GENERATED TOOL TABLE: mapping-symbols -->
288
293
 
289
294
  ### NBT Utilities
@@ -291,11 +296,11 @@ Tools for converting symbol names between namespaces and checking symbol existen
291
296
  Tools for decoding, patching, and encoding Java Edition NBT binary data using a typed JSON representation.
292
297
 
293
298
  <!-- BEGIN GENERATED TOOL TABLE: nbt-utilities -->
294
- | Tool | Purpose | Key Inputs | Key Outputs |
295
- | --- | --- | --- | --- |
296
- | `nbt-to-json` | Decode Java Edition NBT binary (`base64`) to typed JSON | `nbtBase64`, `compression?` (`none`, `gzip`, `auto`) | `typedJson`, `meta.compressionDetected`, `meta.inputBytes` |
297
- | `nbt-apply-json-patch` | Apply RFC 6902 patch (`add/remove/replace/test`) to typed NBT JSON | `typedJson`, `patch` | `typedJson`, `meta.appliedOps`, `meta.testOps`, `meta.changed` |
298
- | `json-to-nbt` | Encode typed JSON back to Java Edition NBT binary (`base64`) | `typedJson`, `compression?` (`none`, `gzip`) | `nbtBase64`, `meta.outputBytes`, `meta.compressionApplied` |
299
+ | Tool | Purpose |
300
+ | --- | --- |
301
+ | `nbt-to-json` | Decode Java Edition NBT binary payloads into typed JSON |
302
+ | `nbt-apply-json-patch` | Apply RFC 6902 patches to typed NBT JSON |
303
+ | `json-to-nbt` | Encode typed JSON back to Java Edition NBT binary |
299
304
  <!-- END GENERATED TOOL TABLE: nbt-utilities -->
300
305
 
301
306
  ### Mod Analysis
@@ -303,13 +308,13 @@ Tools for decoding, patching, and encoding Java Edition NBT binary data using a
303
308
  Tools for extracting metadata from mod JARs, decompiling mod source, searching mod code, and remapping mod namespaces.
304
309
 
305
310
  <!-- BEGIN GENERATED TOOL TABLE: mod-analysis -->
306
- | Tool | Purpose | Key Inputs | Key Outputs |
307
- | --- | --- | --- | --- |
308
- | `analyze-mod-jar` | Extract mod metadata/dependencies/entrypoints from mod JAR | `jarPath`, `includeClasses?` | `modId`, `loader`, `jarKind`, `dependencies`, `entrypoints`, `mixinConfigs`, class stats |
309
- | `decompile-mod-jar` | Decompile mod JAR and optionally return one class source | `jarPath`, `className?`, `includeFiles?`, `maxFiles?` | `outputDir`, `fileCount`, `files?`, `returnedFileCount?`, `filesTruncated?`, `filesOmitted?`, `source?`, `warnings[]` |
310
- | `get-mod-class-source` | Read one class source from decompiled mod cache | `jarPath`, `className`, `maxLines?`, `maxChars?`, `outputFile?` | `className`, `content`, `totalLines`, `truncated?`, `charsTruncated?`, `outputFilePath?`, `warnings[]` |
311
- | `search-mod-source` | Search decompiled mod source by class/method/field/content | `jarPath`, `query`, `searchType?`, `limit?` | `hits[]`, `totalHits`, `truncated`, `warnings[]` |
312
- | `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[]` |
311
+ | Tool | Purpose |
312
+ | --- | --- |
313
+ | `analyze-mod-jar` | Extract mod metadata, dependencies, entrypoints, and mixin config info from a JAR |
314
+ | `decompile-mod-jar` | Decompile a mod JAR and optionally return one class source |
315
+ | `get-mod-class-source` | Read one class source from the decompiled mod cache |
316
+ | `search-mod-source` | Search decompiled mod source by class, method, field, or content |
317
+ | `remap-mod-jar` | Remap a Fabric or Quilt mod JAR to `yarn` or `mojang` names |
313
318
  <!-- END GENERATED TOOL TABLE: mod-analysis -->
314
319
 
315
320
  ### Validation
@@ -317,10 +322,10 @@ Tools for extracting metadata from mod JARs, decompiling mod source, searching m
317
322
  Tools for validating Mixin source and Access Widener files against a target Minecraft version.
318
323
 
319
324
  <!-- BEGIN GENERATED TOOL TABLE: validation -->
320
- | Tool | Purpose | Key Inputs | Key Outputs |
321
- | --- | --- | --- | --- |
322
- | `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?` |
323
- | `validate-access-widener` | Parse/validate Access Widener content against target version | `content`, `version`, `mapping?`, `sourcePriority?` | `valid`, `issues[]`, `warnings[]`, `summary` |
325
+ | Tool | Purpose |
326
+ | --- | --- |
327
+ | `validate-mixin` | Validate Mixin source against a target Minecraft version |
328
+ | `validate-access-widener` | Validate Access Widener content against a target Minecraft version |
324
329
  <!-- END GENERATED TOOL TABLE: validation -->
325
330
 
326
331
  ### Registry & Diagnostics
@@ -328,52 +333,14 @@ Tools for validating Mixin source and Access Widener files against a target Mine
328
333
  Tools for querying generated registry data and inspecting server runtime state.
329
334
 
330
335
  <!-- BEGIN GENERATED TOOL TABLE: registry-diagnostics -->
331
- | Tool | Purpose | Key Inputs | Key Outputs |
332
- | --- | --- | --- | --- |
333
- | `get-registry-data` | Get generated registry snapshots (blocks/items/entities etc.) | `version`, `registry?`, `includeData?`, `maxEntriesPerRegistry?` | `registries`, `data?`, `entryCount`, `returnedEntryCount?`, `registryEntryCounts?`, `dataTruncated?`, `warnings[]` |
334
- | `get-runtime-metrics` | Inspect runtime counters and latency snapshots | none | `result.*` runtime metrics, `meta` envelope |
336
+ | Tool | Purpose |
337
+ | --- | --- |
338
+ | `get-registry-data` | Read generated registry snapshots and optionally include entry data |
339
+ | `get-runtime-metrics` | Inspect runtime metrics and latency snapshots |
335
340
  <!-- END GENERATED TOOL TABLE: registry-diagnostics -->
336
341
 
337
342
  Detailed parameter constraints, migration notes, resource behavior, and the full environment-variable matrix live in [docs/tool-reference.md](docs/tool-reference.md).
338
343
 
339
- ## Resources
340
-
341
- Fixed resources:
342
-
343
- - `mc://versions/list`
344
- - `mc://metrics`
345
-
346
- Template resources:
347
-
348
- - `mc://source/{artifactId}/{className}`
349
- - `mc://artifact/{artifactId}/files/{filePath}`
350
- - `mc://mappings/{version}/{sourceMapping}/{targetMapping}/{kind}/{name}`
351
- - `mc://artifact/{artifactId}/members/{className}`
352
- - `mc://artifact/{artifactId}`
353
-
354
- See [docs/tool-reference.md#resources](docs/tool-reference.md#resources) for the full resource table and response behavior.
355
-
356
- ## Response Model
357
-
358
- Tools and JSON resources return the standard `{ result?, error?, meta }` envelope. Text resources (`class-source` and `artifact-file`) return raw text on success and structured JSON on failure.
359
-
360
- See [docs/tool-reference.md#response-envelope](docs/tool-reference.md#response-envelope) for the exact envelope fields and error shape.
361
-
362
- ## Common Environment Variables
363
-
364
- These are the most commonly changed settings. For the full supported list, see [docs/tool-reference.md#environment-variables](docs/tool-reference.md#environment-variables).
365
-
366
- | Variable | Default | Description |
367
- | --- | --- | --- |
368
- | `MCP_CACHE_DIR` | `~/.cache/minecraft-modding-mcp` | Cache root for downloads and SQLite |
369
- | `MCP_SOURCE_REPOS` | Maven Central + Fabric + Forge + NeoForge | Comma-separated Maven repository URLs |
370
- | `MCP_MAPPING_SOURCE_PRIORITY` | `loom-first` | Mapping source priority (`loom-first` or `maven-first`) |
371
- | `MCP_ENABLE_INDEXED_SEARCH` | `true` | Enable indexed search for `search-class-source` |
372
- | `MCP_VINEFLOWER_JAR_PATH` | unset | Override the Vineflower JAR path |
373
- | `MCP_TINY_REMAPPER_JAR_PATH` | unset | Override the tiny-remapper JAR path |
374
- | `MCP_MAX_SEARCH_HITS` | `200` | Maximum search result count |
375
- | `MCP_MAX_CACHE_BYTES` | `2147483648` | Maximum total cache size in bytes |
376
-
377
344
  ## Development
378
345
 
379
346
  Repository requirements:
package/dist/config.js CHANGED
@@ -52,6 +52,17 @@ function expandHome(pathValue) {
52
52
  const withoutTilde = pathValue.startsWith("~/") ? pathValue.slice(2) : pathValue.slice(1);
53
53
  return resolve(homedir(), withoutTilde);
54
54
  }
55
+ function normalizeOptionalPathEnvValue(pathValue) {
56
+ if (!pathValue) {
57
+ return undefined;
58
+ }
59
+ const trimmed = pathValue.trim();
60
+ if (!trimmed) {
61
+ return undefined;
62
+ }
63
+ const normalized = trimmed.toLowerCase();
64
+ return normalized === "undefined" || normalized === "null" ? undefined : trimmed;
65
+ }
55
66
  function normalizePath(pathValue, field) {
56
67
  const expanded = expandHome(pathValue.trim());
57
68
  const normalizedForHost = normalizePathForHost(expanded, undefined, field);
@@ -120,14 +131,11 @@ function parseMappingSourcePriority(envValue) {
120
131
  return DEFAULTS.mappingSourcePriority;
121
132
  }
122
133
  function parseOptionalJarPath(envValue, field) {
123
- if (!envValue) {
124
- return undefined;
125
- }
126
- const trimmed = envValue.trim();
127
- if (!trimmed) {
128
- return undefined;
129
- }
130
- return normalizePath(trimmed, field);
134
+ const trimmed = normalizeOptionalPathEnvValue(envValue);
135
+ return trimmed ? normalizePath(trimmed, field) : undefined;
136
+ }
137
+ function parseRequiredPath(envValue, fallback, field) {
138
+ return normalizePath(normalizeOptionalPathEnvValue(envValue) ?? fallback, field);
131
139
  }
132
140
  function parseVineflowerPath(envValue) {
133
141
  return parseOptionalJarPath(envValue, "MCP_VINEFLOWER_JAR_PATH");
@@ -137,12 +145,12 @@ function buildArtifactsDirectory(cacheDir) {
137
145
  return normalizePath(input, "MCP_SQLITE_PATH");
138
146
  }
139
147
  export function loadConfig() {
140
- const cacheDir = normalizePath(process.env.MCP_CACHE_DIR ?? DEFAULTS.cacheDir, "MCP_CACHE_DIR");
141
- const localM2Path = normalizePath(process.env.MCP_LOCAL_M2 ?? DEFAULTS.localM2Path, "MCP_LOCAL_M2");
148
+ const cacheDir = parseRequiredPath(process.env.MCP_CACHE_DIR, DEFAULTS.cacheDir, "MCP_CACHE_DIR");
149
+ const localM2Path = parseRequiredPath(process.env.MCP_LOCAL_M2, DEFAULTS.localM2Path, "MCP_LOCAL_M2");
142
150
  const sourceRepos = parseRepos(process.env.MCP_SOURCE_REPOS);
143
151
  return {
144
152
  cacheDir,
145
- sqlitePath: normalizePath(process.env.MCP_SQLITE_PATH ?? buildArtifactsDirectory(cacheDir), "MCP_SQLITE_PATH"),
153
+ sqlitePath: parseRequiredPath(process.env.MCP_SQLITE_PATH, buildArtifactsDirectory(cacheDir), "MCP_SQLITE_PATH"),
146
154
  sourceRepos,
147
155
  localM2Path,
148
156
  vineflowerJarPath: parseVineflowerPath(process.env.MCP_VINEFLOWER_JAR_PATH),
@@ -180,6 +180,8 @@ type AnalyzeSymbolDeps = {
180
180
  symbol: string;
181
181
  descriptor?: string;
182
182
  mapping?: "obfuscated" | "mojang" | "intermediary" | "yarn";
183
+ toVersion?: string;
184
+ maxVersions?: number;
183
185
  }) => Promise<TraceSymbolLifecycleOutput>;
184
186
  resolveWorkspaceSymbol: (input: {
185
187
  projectPath: string;
@@ -231,7 +231,9 @@ export class AnalyzeSymbolService {
231
231
  ? `${input.subject.owner}.${input.subject.name}`
232
232
  : input.subject.name,
233
233
  descriptor: input.subject.descriptor,
234
- mapping: input.sourceMapping
234
+ mapping: input.sourceMapping,
235
+ toVersion: input.version,
236
+ maxVersions: 5
235
237
  });
236
238
  return {
237
239
  ...buildEntryToolResult({
@@ -309,10 +311,11 @@ export class AnalyzeSymbolService {
309
311
  };
310
312
  }
311
313
  case "api-overview": {
314
+ const classNameMapping = input.classNameMapping ?? input.sourceMapping ?? "obfuscated";
312
315
  const output = await this.deps.getClassApiMatrix({
313
316
  version: input.version,
314
317
  className: input.subject.name,
315
- classNameMapping: input.classNameMapping ?? "obfuscated",
318
+ classNameMapping,
316
319
  includeKinds: input.includeKinds,
317
320
  maxRows: input.maxRows
318
321
  });
@@ -329,7 +332,7 @@ export class AnalyzeSymbolService {
329
332
  kind: input.subject.kind,
330
333
  name: input.subject.name,
331
334
  version: input.version,
332
- classNameMapping: input.classNameMapping ?? "obfuscated"
335
+ classNameMapping
333
336
  }),
334
337
  counts: {
335
338
  rows: output.rowCount,
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { FindClassOutput, GetArtifactFileOutput, GetClassMembersOutput, GetClassSourceOutput, ListArtifactFilesOutput, ResolveArtifactOutput, SearchClassSourceOutput } from "../source-service.js";
2
+ import type { CheckSymbolExistsOutput, FindClassOutput, GetArtifactFileOutput, GetClassMembersOutput, GetClassSourceOutput, ListArtifactFilesOutput, ResolveArtifactOutput, SearchClassSourceOutput } from "../source-service.js";
3
3
  import type { ListVersionsOutput } from "../version-service.js";
4
4
  export declare const inspectMinecraftShape: {
5
5
  task: z.ZodOptional<z.ZodEnum<["auto", "versions", "artifact", "class-overview", "class-source", "class-members", "search", "file", "list-files"]>>;
@@ -1869,6 +1869,18 @@ type InspectMinecraftDeps = {
1869
1869
  artifactId: string;
1870
1870
  limit?: number;
1871
1871
  }) => Promise<FindClassOutput>;
1872
+ checkSymbolExists?: (input: {
1873
+ version: string;
1874
+ kind: "class" | "field" | "method";
1875
+ name: string;
1876
+ owner?: string;
1877
+ descriptor?: string;
1878
+ sourceMapping: "obfuscated" | "mojang" | "intermediary" | "yarn";
1879
+ sourcePriority?: "loom-first" | "maven-first";
1880
+ nameMode?: "fqcn" | "auto";
1881
+ signatureMode?: "exact" | "name-only";
1882
+ maxCandidates?: number;
1883
+ }) => Promise<CheckSymbolExistsOutput>;
1872
1884
  getClassSource: (input: {
1873
1885
  className: string;
1874
1886
  artifactId?: string;
@@ -1940,6 +1952,11 @@ export declare class InspectMinecraftService {
1940
1952
  private resolveWorkspaceArtifactReference;
1941
1953
  private resolveTask;
1942
1954
  private summarizeRequestedSubject;
1955
+ private exampleVersionForSubject;
1956
+ private buildArtifactContextSuggestedCall;
1957
+ private taskForSubject;
1958
+ private invalidTaskSubjectError;
1959
+ private resolveBinaryBackedClass;
1943
1960
  private resolveArtifactReference;
1944
1961
  private resolveArtifactRef;
1945
1962
  private handleVersions;