@adhisang/minecraft-modding-mcp 3.0.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 +52 -29
- package/README.md +209 -849
- package/dist/config.js +19 -11
- package/dist/entry-tools/analyze-mod-service.d.ts +16 -16
- package/dist/entry-tools/analyze-mod-service.js +69 -13
- package/dist/entry-tools/analyze-symbol-service.d.ts +14 -12
- package/dist/entry-tools/analyze-symbol-service.js +64 -6
- package/dist/entry-tools/compare-minecraft-service.d.ts +6 -6
- package/dist/entry-tools/compare-minecraft-service.js +58 -26
- package/dist/entry-tools/inspect-minecraft-service.d.ts +37 -19
- package/dist/entry-tools/inspect-minecraft-service.js +468 -51
- package/dist/entry-tools/manage-cache-service.d.ts +6 -6
- package/dist/entry-tools/manage-cache-service.js +40 -5
- package/dist/entry-tools/response-contract.d.ts +1 -0
- package/dist/entry-tools/response-contract.js +3 -0
- package/dist/entry-tools/validate-project-service.d.ts +24 -24
- package/dist/entry-tools/validate-project-service.js +40 -7
- package/dist/index.js +290 -51
- package/dist/mapping-service.d.ts +1 -0
- package/dist/mapping-service.js +55 -34
- package/dist/observability.d.ts +18 -2
- package/dist/observability.js +47 -10
- package/dist/source-service.d.ts +2 -1
- package/dist/source-service.js +206 -112
- package/dist/storage/files-repo.d.ts +1 -0
- package/dist/storage/files-repo.js +29 -5
- package/dist/tool-contract-manifest.d.ts +4 -0
- package/dist/tool-contract-manifest.js +137 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,60 +9,54 @@
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
`@adhisang/minecraft-modding-mcp` is an [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that gives AI assistants
|
|
12
|
+
`@adhisang/minecraft-modding-mcp` is an [MCP (Model Context Protocol)](https://modelcontextprotocol.io/) server that gives AI assistants structured access to Minecraft source code, mappings, mod JARs, registry data, and validation workflows.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
[MCP](https://modelcontextprotocol.io/) is an open protocol that lets AI assistants call external tools through a structured interface. This server works with Claude Desktop, Claude Code, VS Code, Codex CLI, Gemini CLI, and other MCP-capable clients.
|
|
15
15
|
|
|
16
16
|
**35 tools** (6 entry + 29 expert) | **7 resources** | **4 namespace mappings** | **SQLite-backed cache**
|
|
17
17
|
|
|
18
18
|
## Features
|
|
19
19
|
|
|
20
|
-
- **Source Exploration
|
|
21
|
-
- **Multi-Mapping Conversion
|
|
22
|
-
- **
|
|
23
|
-
- **Mod JAR Analysis
|
|
24
|
-
- **Mixin
|
|
25
|
-
- **NBT Round-Trip
|
|
26
|
-
- **Registry Data
|
|
27
|
-
- **
|
|
28
|
-
- **JAR Remapping** — Remap Fabric mod JARs from `intermediary` to `yarn` or `mojang` namespaces
|
|
29
|
-
- **MCP Resources** — Access version lists, class source, artifact metadata, and mappings through URI-based resources
|
|
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 `obfuscated`, `mojang`, `intermediary`, and `yarn`
|
|
22
|
+
- **Version Comparison**: diff class signatures and registry entries between Minecraft versions
|
|
23
|
+
- **Mod JAR Analysis**: extract metadata, dependencies, entrypoints, and Mixin configs from Fabric, Forge, and NeoForge mod JARs
|
|
24
|
+
- **Mixin and Access Widener Validation**: validate source and `.accesswidener` files against a target Minecraft version
|
|
25
|
+
- **NBT Round-Trip**: decode NBT binary to typed JSON, apply RFC 6902 patches, and encode it back to NBT
|
|
26
|
+
- **Registry Data and Runtime Metrics**: query generated registry snapshots and inspect cache and latency counters
|
|
27
|
+
- **MCP Resources**: expose versions, class source, artifact metadata, and mappings through URI-based resources
|
|
30
28
|
|
|
31
29
|
## Quick Start
|
|
32
30
|
|
|
33
|
-
###
|
|
34
|
-
- Node.js 22+
|
|
35
|
-
- pnpm
|
|
31
|
+
### Package Users
|
|
36
32
|
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
npx @adhisang/minecraft-modding-mcp
|
|
40
|
-
```
|
|
33
|
+
Requirements:
|
|
41
34
|
|
|
42
|
-
|
|
35
|
+
- Node.js 22+
|
|
36
|
+
- Java is only required for `remap-mod-jar` and decompile or remap flows that need Vineflower or tiny-remapper
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
Start the server locally:
|
|
45
39
|
|
|
46
40
|
```bash
|
|
47
|
-
|
|
48
|
-
claude mcp list
|
|
41
|
+
npx -y @adhisang/minecraft-modding-mcp
|
|
49
42
|
```
|
|
50
43
|
|
|
51
|
-
|
|
44
|
+
If automatic JAR downloads are blocked in your environment, set `MCP_VINEFLOWER_JAR_PATH` and `MCP_TINY_REMAPPER_JAR_PATH` in the client configuration.
|
|
52
45
|
|
|
53
|
-
|
|
54
|
-
codex mcp add minecraft-modding -- npx -y @adhisang/minecraft-modding-mcp
|
|
55
|
-
codex mcp list
|
|
56
|
-
```
|
|
46
|
+
### Client Setup
|
|
57
47
|
|
|
58
|
-
|
|
48
|
+
CLI clients:
|
|
59
49
|
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
- `Claude Code`: `claude mcp add minecraft-modding -- npx -y @adhisang/minecraft-modding-mcp`
|
|
51
|
+
- `OpenAI Codex CLI`: `codex mcp add minecraft-modding -- npx -y @adhisang/minecraft-modding-mcp`
|
|
62
52
|
|
|
63
|
-
|
|
53
|
+
Run `claude mcp list` or `codex mcp list` after registration to verify the server is available.
|
|
64
54
|
|
|
65
|
-
|
|
55
|
+
The stdio transport auto-detects both newline-delimited and `Content-Length` framing, so the same server command works across Codex and standard MCP clients.
|
|
56
|
+
|
|
57
|
+
#### Claude Desktop
|
|
58
|
+
|
|
59
|
+
Add the following to your `claude_desktop_config.json`:
|
|
66
60
|
|
|
67
61
|
```json
|
|
68
62
|
{
|
|
@@ -75,59 +69,13 @@ Add the following to `~/.gemini/settings.json`:
|
|
|
75
69
|
}
|
|
76
70
|
```
|
|
77
71
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
```text
|
|
81
|
-
/mcp list
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### For Developers (Repository)
|
|
85
|
-
```bash
|
|
86
|
-
pnpm install
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Run (development)
|
|
90
|
-
```bash
|
|
91
|
-
pnpm dev
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Build + Run (distribution shape)
|
|
95
|
-
```bash
|
|
96
|
-
pnpm build
|
|
97
|
-
pnpm start
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Validate
|
|
101
|
-
```bash
|
|
102
|
-
pnpm check
|
|
103
|
-
pnpm test
|
|
104
|
-
pnpm test:coverage
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### Coverage
|
|
108
|
-
```bash
|
|
109
|
-
pnpm test:coverage
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
Coverage thresholds: `lines=80`, `branches=70`, `functions=80`.
|
|
113
|
-
|
|
114
|
-
Generate LCOV output for Codecov upload:
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
pnpm test:coverage:lcov
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
GitHub Actions upload workflow: `.github/workflows/codecov.yml` (temporarily disabled; when enabled, it runs on `v*` tags and manual dispatch).
|
|
121
|
-
|
|
122
|
-
### MCP Client Configuration
|
|
123
|
-
|
|
124
|
-
#### Claude Desktop
|
|
72
|
+
#### VS Code
|
|
125
73
|
|
|
126
|
-
Add the following to your
|
|
74
|
+
Add the following to `.vscode/mcp.json` in your workspace:
|
|
127
75
|
|
|
128
76
|
```json
|
|
129
77
|
{
|
|
130
|
-
"
|
|
78
|
+
"servers": {
|
|
131
79
|
"minecraft-modding": {
|
|
132
80
|
"command": "npx",
|
|
133
81
|
"args": ["-y", "@adhisang/minecraft-modding-mcp"]
|
|
@@ -136,13 +84,13 @@ Add the following to your `claude_desktop_config.json`:
|
|
|
136
84
|
}
|
|
137
85
|
```
|
|
138
86
|
|
|
139
|
-
####
|
|
87
|
+
#### Gemini CLI
|
|
140
88
|
|
|
141
|
-
Add the following to
|
|
89
|
+
Add the following to `~/.gemini/settings.json`:
|
|
142
90
|
|
|
143
91
|
```json
|
|
144
92
|
{
|
|
145
|
-
"
|
|
93
|
+
"mcpServers": {
|
|
146
94
|
"minecraft-modding": {
|
|
147
95
|
"command": "npx",
|
|
148
96
|
"args": ["-y", "@adhisang/minecraft-modding-mcp"]
|
|
@@ -151,6 +99,12 @@ Add the following to `.vscode/mcp.json` in your workspace:
|
|
|
151
99
|
}
|
|
152
100
|
```
|
|
153
101
|
|
|
102
|
+
Then run:
|
|
103
|
+
|
|
104
|
+
```text
|
|
105
|
+
/mcp list
|
|
106
|
+
```
|
|
107
|
+
|
|
154
108
|
#### Custom Environment
|
|
155
109
|
|
|
156
110
|
Pass environment variables to override defaults:
|
|
@@ -170,853 +124,259 @@ Pass environment variables to override defaults:
|
|
|
170
124
|
}
|
|
171
125
|
```
|
|
172
126
|
|
|
173
|
-
##
|
|
174
|
-
|
|
175
|
-
### v3 Entry Tools
|
|
176
|
-
|
|
177
|
-
These are the default starting points for v3 workflows. They keep the public `{ result?, error?, meta }` envelope, always return `result.summary`, and share `detail: "summary" | "standard" | "full"` plus opt-in `include[]` groups. Mutating entry tools use `executionMode: "preview" | "apply"` so preview is explicit in the public contract.
|
|
178
|
-
|
|
179
|
-
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
180
|
-
| --- | --- | --- | --- |
|
|
181
|
-
| `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`, `subject`, `artifact?`, `class?`, `search?`, `file?`, `files?` |
|
|
182
|
-
| `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?` |
|
|
183
|
-
| `compare-minecraft` | Compare version pairs, class signatures, registries, or produce a migration-oriented overview | `task?`, `subject`, `detail?`, `include?`, `sourcePriority?`, `maxClassResults?`, `maxEntriesPerRegistry?`, `includeFullDiff?`, `limit?` | `result.summary`, `comparison`, `classes?`, `classDiff?`, `registry?`, `migration?` |
|
|
184
|
-
| `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?` |
|
|
185
|
-
| `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?`, `recovery?` |
|
|
186
|
-
| `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?` |
|
|
187
|
-
|
|
188
|
-
`compare-minecraft` forwards `sourcePriority` for class-diff flows, matching `diff-class-signatures`.
|
|
189
|
-
`inspect-minecraft` also accepts `subject.kind="workspace"` with `focus.kind="class"` for `task="class-overview" | "class-source" | "class-members"` without requiring an explicit `artifact`; it resolves the artifact from the workspace version first.
|
|
190
|
-
`compare-minecraft` summary-mode version comparisons now expose clipped class and registry samples through `meta.truncated`, including mixed `include=["classes"]` / `["registry"]` requests where the other summary-side group was clipped.
|
|
191
|
-
When `registry-diff` can only load one side of detailed registry data, it returns `summary.status="partial"` plus recovery-oriented `nextActions` instead of failing the whole call.
|
|
192
|
-
|
|
193
|
-
`manage-cache` list pagination returns `meta.pagination.nextCursor`.
|
|
194
|
-
`selector.olderThan` accepts ISO-8601 durations such as `P30D`, `selector.status` uses the shared `healthy | partial | stale | orphaned | corrupt | in_use` vocabulary, and `jarPath` / `projectPath` matching normalizes WSL and Windows path forms before filtering.
|
|
195
|
-
|
|
196
|
-
If you already know the exact low-level operation you want, the retained expert tools below are still available and remain the fastest way to do narrow follow-up work.
|
|
127
|
+
## Start Here
|
|
197
128
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
Tools for browsing Minecraft versions, resolving source artifacts, and reading/searching decompiled source code.
|
|
201
|
-
|
|
202
|
-
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
203
|
-
| --- | --- | --- | --- |
|
|
204
|
-
| `list-versions` | List available Minecraft versions from Mojang manifest + local cache | `includeSnapshots?`, `limit?` | `result.latest`, `result.releases[]`, `meta.warnings[]` |
|
|
205
|
-
| `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[]` |
|
|
206
|
-
| `find-class` | Resolve simple or fully-qualified class names inside an artifact | `className`, `artifactId`, `limit?` | `matches[]`, `total`, `warnings[]` |
|
|
207
|
-
| `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 |
|
|
208
|
-
| `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[]` |
|
|
209
|
-
| `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` |
|
|
210
|
-
| `get-artifact-file` | Read full source file with byte guard | `artifactId`, `filePath`, `maxBytes?` | `content`, `contentBytes`, `truncated`, `mappingApplied`, `returnedNamespace`, `artifactContents` |
|
|
211
|
-
| `list-artifact-files` | List indexed source file paths with cursor pagination | `artifactId`, `prefix?`, `limit?`, `cursor?` | `items[]`, `nextCursor?`, `mappingApplied`, `artifactContents`, `warnings[]` |
|
|
212
|
-
| `index-artifact` | Rebuild index metadata for an existing artifact | `artifactId`, `force?` | `reindexed`, `reason`, `counts`, `indexedAt`, `durationMs` |
|
|
213
|
-
|
|
214
|
-
### Version Comparison & Symbol Tracking
|
|
215
|
-
|
|
216
|
-
Tools for comparing class/registry changes across Minecraft versions and tracing symbol existence over time.
|
|
217
|
-
|
|
218
|
-
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
219
|
-
| --- | --- | --- | --- |
|
|
220
|
-
| `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[]` |
|
|
221
|
-
| `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[]` |
|
|
222
|
-
| `compare-versions` | Compare class/registry changes between two versions | `fromVersion`, `toVersion`, `category?`, `packageFilter?`, `maxClassResults?` | `classes`, `registry`, `summary`, `warnings[]` |
|
|
223
|
-
|
|
224
|
-
### Mapping & Symbols
|
|
225
|
-
|
|
226
|
-
Tools for converting symbol names between namespaces and checking symbol existence.
|
|
227
|
-
|
|
228
|
-
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
229
|
-
| --- | --- | --- | --- |
|
|
230
|
-
| `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[]` |
|
|
231
|
-
| `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[]` |
|
|
232
|
-
| `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[]` |
|
|
233
|
-
| `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[]` |
|
|
234
|
-
| `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[]` |
|
|
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.
|
|
235
130
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
Tools for decoding, patching, and encoding Java Edition NBT binary data using a typed JSON representation.
|
|
239
|
-
|
|
240
|
-
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
241
|
-
| --- | --- | --- | --- |
|
|
242
|
-
| `nbt-to-json` | Decode Java Edition NBT binary (`base64`) to typed JSON | `nbtBase64`, `compression?` (`none`, `gzip`, `auto`) | `typedJson`, `meta.compressionDetected`, `meta.inputBytes` |
|
|
243
|
-
| `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` |
|
|
244
|
-
| `json-to-nbt` | Encode typed JSON back to Java Edition NBT binary (`base64`) | `typedJson`, `compression?` (`none`, `gzip`) | `nbtBase64`, `meta.outputBytes`, `meta.compressionApplied` |
|
|
245
|
-
|
|
246
|
-
### Mod Analysis
|
|
247
|
-
|
|
248
|
-
Tools for extracting metadata from mod JARs, decompiling mod source, searching mod code, and remapping mod namespaces.
|
|
249
|
-
|
|
250
|
-
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
251
|
-
| --- | --- | --- | --- |
|
|
252
|
-
| `analyze-mod-jar` | Extract mod metadata/dependencies/entrypoints from mod JAR | `jarPath`, `includeClasses?` | `modId`, `loader`, `jarKind`, `dependencies`, `entrypoints`, `mixinConfigs`, class stats |
|
|
253
|
-
| `decompile-mod-jar` | Decompile mod JAR and optionally return one class source | `jarPath`, `className?`, `includeFiles?`, `maxFiles?` | `outputDir`, `fileCount`, `files?`, `returnedFileCount?`, `filesTruncated?`, `filesOmitted?`, `source?`, `warnings[]` |
|
|
254
|
-
| `get-mod-class-source` | Read one class source from decompiled mod cache | `jarPath`, `className`, `maxLines?`, `maxChars?`, `outputFile?` | `className`, `content`, `totalLines`, `truncated?`, `charsTruncated?`, `outputFilePath?`, `warnings[]` |
|
|
255
|
-
| `search-mod-source` | Search decompiled mod source by class/method/field/content | `jarPath`, `query`, `searchType?`, `limit?` | `hits[]`, `totalHits`, `truncated`, `warnings[]` |
|
|
256
|
-
| `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[]` |
|
|
257
|
-
|
|
258
|
-
### Validation
|
|
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.
|
|
259
132
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
|
263
|
-
|
|
|
264
|
-
| `
|
|
265
|
-
| `
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
Tools for querying generated registry data and inspecting server runtime state.
|
|
270
|
-
|
|
271
|
-
| Tool | Purpose | Key Inputs | Key Outputs |
|
|
272
|
-
| --- | --- | --- | --- |
|
|
273
|
-
| `get-registry-data` | Get generated registry snapshots (blocks/items/entities etc.) | `version`, `registry?`, `includeData?`, `maxEntriesPerRegistry?` | `registries`, `data?`, `entryCount`, `returnedEntryCount?`, `registryEntryCounts?`, `dataTruncated?`, `warnings[]` |
|
|
274
|
-
| `get-runtime-metrics` | Inspect runtime counters and latency snapshots | none | `result.*` runtime metrics, `meta` envelope |
|
|
275
|
-
|
|
276
|
-
### Tool Constraints
|
|
277
|
-
|
|
278
|
-
`resolve-artifact` now takes `target: { kind, value }`.
|
|
279
|
-
`get-class-source` requires `target`, where `target.type="artifact"` selects a previously resolved `artifactId` and `target.type="resolve"` supplies `{ kind, value }` directly.
|
|
280
|
-
`get-class-members` requires the same `target` object shape and still needs a binary jar (`binaryJarPath`) to read `.class` entries.
|
|
281
|
-
`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.
|
|
282
|
-
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.
|
|
283
|
-
Error `suggestedCall` payloads now use the same `target` object schema instead of legacy `targetKind` / `targetValue` fields.
|
|
284
|
-
Positive integer tool parameters accept numeric strings such as `"10"` in addition to JSON numbers.
|
|
285
|
-
This numeric-string coercion only applies to documented top-level tool arguments; nested `typedJson` payloads and JSON Patch `value` objects are preserved verbatim.
|
|
286
|
-
`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`.
|
|
287
|
-
`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.
|
|
288
|
-
`list-artifact-files` warns when you probe `assets/` or `data/` prefixes because the current index stores Java source only, not non-Java resources.
|
|
289
|
-
`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.
|
|
290
|
-
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`.
|
|
291
|
-
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.
|
|
292
|
-
`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.
|
|
293
|
-
`get-class-api-matrix` accepts `maxRows`; `rowCount` reports the full pre-truncation row total and `rowsTruncated=true` signals clipping.
|
|
294
|
-
`diff-class-signatures` supports `includeFullDiff=false` to omit `from`/`to` snapshots from `modified[]` entries and keep only `key` plus `changed`.
|
|
295
|
-
`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.
|
|
296
|
-
`validate-mixin` always returns `mode`, `results[]`, and `summary`; single-input modes still use a one-element `results[]` array.
|
|
297
|
-
`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.
|
|
298
|
-
`reportMode=summary-first` hoists shared provenance, warnings, and incomplete-reason summaries to the top level while trimming duplicate per-result metadata.
|
|
299
|
-
`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.
|
|
300
|
-
`validate-mixin` batch `summary` now includes `partial` so callers can distinguish fully clean results from tool-limited-but-non-failing results.
|
|
301
|
-
`validate-mixin` now reports `validation-incomplete` when target metadata cannot be loaded reliably, instead of misclassifying those tool-limited cases as confirmed missing classes.
|
|
302
|
-
`validate-mixin` responses now include `confidenceBreakdown` alongside `confidenceScore`, exposing the base score plus the penalties that lowered confidence.
|
|
303
|
-
`validate-mixin` per-result responses include `provenance.resolutionNotes?` when mapping fallback occurs.
|
|
304
|
-
`validate-mixin` provenance now exposes `requestedScope` / `appliedScope` and `requestedSourcePriority` / `appliedSourcePriority` so fallback and retry behavior is explicit.
|
|
305
|
-
`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.
|
|
306
|
-
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.
|
|
307
|
-
`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.
|
|
308
|
-
`validate-mixin` validates `@Invoker` targets against methods only and `@Accessor` targets against fields only.
|
|
309
|
-
`validate-mixin` parser supports both `.class` literal targets and `targets = "..."` / `targets = {"a", "b"}` string forms.
|
|
310
|
-
`validate-mixin` parser handles multi-line annotations between `@Shadow`/`@Accessor` and declarations, and strips inline annotations from declaration lines.
|
|
311
|
-
`validate-mixin` distinguishes `target-mapping-failed` (warning, uncertain) from `target-not-found` (error) when class mapping fails.
|
|
312
|
-
`validate-mixin` issues and `structuredWarnings` include `category` (`mapping`, `configuration`, `validation`, `resolution`, or `parse`) to distinguish setup/tooling/parser limits from real validation errors.
|
|
313
|
-
`validate-mixin` supports post-filtering with `minSeverity`, `hideUncertain`, and `warningCategoryFilter`; `treatInfoAsWarning=false` suppresses info-level entries in `structuredWarnings`.
|
|
314
|
-
`validate-mixin` per-result responses include `resolvedMembers?` tracking each member's resolution status (`resolved` or `not-found`).
|
|
315
|
-
`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.
|
|
316
|
-
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`.
|
|
317
|
-
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`.
|
|
318
|
-
`validate-mixin` summary uses `processingErrors`, `totalValidationErrors`, and `totalValidationWarnings`; the deprecated `summary.errors` field was removed.
|
|
319
|
-
`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.
|
|
320
|
-
`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.
|
|
321
|
-
`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`.
|
|
322
|
-
`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`.
|
|
323
|
-
`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.
|
|
324
|
-
`resolve-artifact` includes `sampleEntries` only when a source JAR is resolved; decompile-only paths leave it unset.
|
|
325
|
-
`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.
|
|
326
|
-
`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.
|
|
327
|
-
`find-class` returns an explanatory warning when an `obfuscated` artifact is queried with names that look like deobfuscated Mojang classes.
|
|
328
|
-
`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.
|
|
329
|
-
`search-class-source` uses `limit: 20` by default.
|
|
330
|
-
`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.
|
|
331
|
-
`search-class-source` with `match=regex` enforces `query.length <= 200` and a strict result cap of `100`.
|
|
332
|
-
`search-class-source` now returns compact file hits without snippets, line windows, relation expansion, or `totalApprox`.
|
|
333
|
-
Use `get-artifact-file` or `get-class-source` to inspect returned files after search.
|
|
334
|
-
`search-class-source` `symbolKind` is only supported when `intent=symbol`.
|
|
335
|
-
`get-artifact-file` byte truncation now preserves UTF-8 character boundaries, preventing replacement-character (`�`) corruption when `maxBytes` cuts through multibyte text.
|
|
336
|
-
`search-class-source` `fileGlob` supports `*`, `**`, and `?`; recursive patterns such as `net/minecraft/**/*.java` are supported.
|
|
337
|
-
`get-class-source` fallback matching enforces package compatibility and returns `ERR_CLASS_NOT_FOUND` when only name-colliding classes from other packages exist.
|
|
338
|
-
`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`.
|
|
339
|
-
`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.
|
|
340
|
-
`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`.
|
|
341
|
-
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.
|
|
342
|
-
`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.
|
|
343
|
-
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.
|
|
344
|
-
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`.
|
|
345
|
-
Mod tool `jarPath` inputs are normalized to a canonical local `.jar` file path before existence checks, cache keying, and processing.
|
|
346
|
-
`search-mod-source` enforces `query.length <= 200` and `limit <= 200`.
|
|
347
|
-
`search-mod-source` detects source-only jars and searches `.java` entries directly without decompilation.
|
|
348
|
-
`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.
|
|
349
|
-
`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.
|
|
350
|
-
`find-mapping` returns `ambiguityReasons` when `status=ambiguous` to explain why candidates could not be uniquely resolved.
|
|
351
|
-
`get-class-api-matrix` returns `ambiguousRowCount` when one or more rows required ambiguity fallback.
|
|
352
|
-
`check-symbol-exists` defaults to strict FQCN class inputs; set `nameMode=auto` to allow short class names (ambiguous matches return `status=ambiguous`).
|
|
353
|
-
`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.
|
|
354
|
-
`check-symbol-exists` always validates input shape first and returns `ERR_INVALID_INPUT` for invalid symbol combinations, even when mapping data is unavailable.
|
|
355
|
-
`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.
|
|
356
|
-
`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`.
|
|
357
|
-
Migration notes:
|
|
358
|
-
- Start with `inspect-minecraft` for version/artifact/class/file/search workflows before dropping to `list-versions`, `resolve-artifact`, `get-class-source`, `get-class-members`, `search-class-source`, `get-artifact-file`, or `list-artifact-files`.
|
|
359
|
-
- Start with `analyze-symbol` for symbol mapping/existence/lifecycle/workspace questions before using `find-mapping`, `resolve-method-mapping-exact`, `check-symbol-exists`, `trace-symbol-lifecycle`, `resolve-workspace-symbol`, or `get-class-api-matrix` directly.
|
|
360
|
-
- Start with `compare-minecraft` for version-pair, class diff, registry diff, and migration-summary flows before using `compare-versions`, `diff-class-signatures`, or `get-registry-data` directly.
|
|
361
|
-
- Start with `analyze-mod` for metadata-first mod inspection and safe remap previews/applies before using `analyze-mod-jar`, `decompile-mod-jar`, `get-mod-class-source`, `search-mod-source`, or `remap-mod-jar` directly.
|
|
362
|
-
- Start with `validate-project` for workspace summaries and direct Mixin / Access Widener validation before using `validate-mixin` or `validate-access-widener` directly.
|
|
363
|
-
- Start with `manage-cache` for cache inventory and safe cleanup; use `executionMode="preview"` to inspect deletion/prune/rebuild impact before `executionMode="apply"`.
|
|
364
|
-
- Replace `resolve-artifact` `targetKind` + `targetValue` with `target: { kind, value }`.
|
|
365
|
-
- Replace `get-class-source` / `get-class-members` top-level `artifactId` / `targetKind` / `targetValue` with `target: { type: "artifact", artifactId }` or `target: { type: "resolve", kind, value }`.
|
|
366
|
-
- `resolve-method-mapping-exact` is method-only and no longer accepts `kind`.
|
|
367
|
-
- 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`.
|
|
368
|
-
- `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`.
|
|
369
|
-
`remap-mod-jar` requires Java to be installed and only supports Fabric/Quilt mods.
|
|
370
|
-
Mojang-mapped inputs can be returned as-is for `targetMapping="mojang"`. `targetMapping="yarn"` still expects an intermediary-built input jar.
|
|
371
|
-
|
|
372
|
-
## Resources
|
|
373
|
-
|
|
374
|
-
MCP resources provide URI-based access to Minecraft data, usable by any MCP client that supports the resource protocol.
|
|
375
|
-
|
|
376
|
-
### Fixed Resources
|
|
377
|
-
|
|
378
|
-
| Resource | URI | Description |
|
|
379
|
-
| --- | --- | --- |
|
|
380
|
-
| `versions-list` | `mc://versions/list` | List all available Minecraft versions with their metadata |
|
|
381
|
-
| `runtime-metrics` | `mc://metrics` | Runtime metrics and performance counters for the MCP server |
|
|
382
|
-
|
|
383
|
-
### Template Resources
|
|
384
|
-
|
|
385
|
-
| Resource | URI Template | Description |
|
|
386
|
-
| --- | --- | --- |
|
|
387
|
-
| `class-source` | `mc://source/{artifactId}/{className}` | Java source code for a class within a resolved artifact |
|
|
388
|
-
| `artifact-file` | `mc://artifact/{artifactId}/files/{filePath}` | Raw content of a file within a resolved artifact |
|
|
389
|
-
| `find-mapping` | `mc://mappings/{version}/{sourceMapping}/{targetMapping}/{kind}/{name}` | Look up a mapping between two naming namespaces |
|
|
390
|
-
| `class-members` | `mc://artifact/{artifactId}/members/{className}` | List constructors, methods, and fields for a class |
|
|
391
|
-
| `artifact-metadata` | `mc://artifact/{artifactId}` | Metadata for a previously resolved artifact |
|
|
392
|
-
|
|
393
|
-
`versions-list`, `runtime-metrics`, `find-mapping`, `class-members`, and `artifact-metadata` return structured JSON envelopes on success (`{ result, meta }`) and failure (`{ error, meta }`).
|
|
394
|
-
`class-source` and `artifact-file` keep raw text responses on success, but still return structured JSON errors on failure.
|
|
395
|
-
|
|
396
|
-
## Response Envelope
|
|
397
|
-
|
|
398
|
-
All tools return exactly one of:
|
|
399
|
-
|
|
400
|
-
- Success: `{ result: { ... }, meta: { requestId, tool, durationMs, warnings[] } }`
|
|
401
|
-
- Failure: `{ error: { type, title, detail, status, code, instance, fieldErrors?, hints? }, meta: { requestId, tool, durationMs, warnings[] } }`
|
|
402
|
-
|
|
403
|
-
JSON resources follow the same `result/error/meta` pattern. Text resources return plain text on success.
|
|
404
|
-
The same JSON envelope is mirrored in MCP `structuredContent` for SDK-aware clients, and failures also set `isError=true`.
|
|
405
|
-
|
|
406
|
-
## Examples
|
|
407
|
-
|
|
408
|
-
### Source Exploration
|
|
409
|
-
|
|
410
|
-
#### Resolve from Minecraft version
|
|
411
|
-
```json
|
|
412
|
-
{
|
|
413
|
-
"tool": "resolve-artifact",
|
|
414
|
-
"arguments": {
|
|
415
|
-
"target": {
|
|
416
|
-
"kind": "version",
|
|
417
|
-
"value": "1.21.10"
|
|
418
|
-
},
|
|
419
|
-
"mapping": "obfuscated",
|
|
420
|
-
"allowDecompile": true,
|
|
421
|
-
"projectPath": "/path/to/mod/workspace"
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
#### Get class source with line window
|
|
427
|
-
```json
|
|
428
|
-
{
|
|
429
|
-
"tool": "get-class-source",
|
|
430
|
-
"arguments": {
|
|
431
|
-
"target": {
|
|
432
|
-
"type": "artifact",
|
|
433
|
-
"artifactId": "<artifact-id>"
|
|
434
|
-
},
|
|
435
|
-
"className": "net.minecraft.server.Main",
|
|
436
|
-
"startLine": 50,
|
|
437
|
-
"endLine": 180,
|
|
438
|
-
"maxLines": 80
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
#### Search by method symbol
|
|
444
|
-
```json
|
|
445
|
-
{
|
|
446
|
-
"tool": "search-class-source",
|
|
447
|
-
"arguments": {
|
|
448
|
-
"artifactId": "<artifact-id>",
|
|
449
|
-
"query": "tickServer",
|
|
450
|
-
"intent": "symbol",
|
|
451
|
-
"match": "exact"
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
#### Get class member list
|
|
457
|
-
```json
|
|
458
|
-
{
|
|
459
|
-
"tool": "get-class-members",
|
|
460
|
-
"arguments": {
|
|
461
|
-
"artifactId": "<artifact-id>",
|
|
462
|
-
"className": "net.minecraft.server.Main",
|
|
463
|
-
"mapping": "obfuscated",
|
|
464
|
-
"access": "all",
|
|
465
|
-
"includeInherited": true,
|
|
466
|
-
"maxMembers": 300
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
```
|
|
470
|
-
|
|
471
|
-
#### List artifact files with prefix filter
|
|
472
|
-
|
|
473
|
-
List source files under a specific package to understand project structure:
|
|
474
|
-
|
|
475
|
-
```json
|
|
476
|
-
{
|
|
477
|
-
"tool": "list-artifact-files",
|
|
478
|
-
"arguments": {
|
|
479
|
-
"artifactId": "<artifact-id>",
|
|
480
|
-
"prefix": "net/minecraft/world/level/",
|
|
481
|
-
"limit": 50
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
```
|
|
133
|
+
| Tool | Start here for |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| `inspect-minecraft` | versions, artifacts, classes, files, and source search |
|
|
136
|
+
| `analyze-symbol` | symbol existence checks, mapping conversion, lifecycle tracing, and workspace symbol resolution |
|
|
137
|
+
| `compare-minecraft` | version-pair diffs, class diffs, registry diffs, and migration-oriented overviews |
|
|
138
|
+
| `analyze-mod` | mod metadata, decompile/search flows, class source, and safe remap preview/apply |
|
|
139
|
+
| `validate-project` | workspace summaries plus direct Mixin and Access Widener validation |
|
|
140
|
+
| `manage-cache` | cache inventory, verification, and preview/apply cleanup workflows |
|
|
485
141
|
|
|
486
|
-
###
|
|
142
|
+
### Workflow Notes
|
|
487
143
|
|
|
488
|
-
|
|
489
|
-
```json
|
|
490
|
-
{
|
|
491
|
-
"tool": "trace-symbol-lifecycle",
|
|
492
|
-
"arguments": {
|
|
493
|
-
"symbol": "net.minecraft.server.Main.tickServer",
|
|
494
|
-
"descriptor": "()V",
|
|
495
|
-
"fromVersion": "1.20.1",
|
|
496
|
-
"toVersion": "1.21.10",
|
|
497
|
-
"includeTimeline": true
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
```
|
|
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).
|
|
501
145
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
"className": "net.minecraft.server.Main",
|
|
508
|
-
"fromVersion": "1.20.1",
|
|
509
|
-
"toVersion": "1.21.10",
|
|
510
|
-
"mapping": "obfuscated",
|
|
511
|
-
"includeFullDiff": false
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
```
|
|
515
|
-
|
|
516
|
-
#### Compare two Minecraft versions
|
|
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.
|
|
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`.
|
|
517
151
|
|
|
518
|
-
|
|
152
|
+
### Inspect Minecraft source from a version
|
|
519
153
|
|
|
520
154
|
```json
|
|
521
155
|
{
|
|
522
|
-
"tool": "
|
|
156
|
+
"tool": "inspect-minecraft",
|
|
523
157
|
"arguments": {
|
|
524
|
-
"
|
|
525
|
-
"
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
are all scoped to that filtered package set.
|
|
536
|
-
|
|
537
|
-
### Mapping & Symbols
|
|
538
|
-
|
|
539
|
-
#### Lookup mapping candidates
|
|
540
|
-
```json
|
|
541
|
-
{
|
|
542
|
-
"tool": "find-mapping",
|
|
543
|
-
"arguments": {
|
|
544
|
-
"version": "1.21.10",
|
|
545
|
-
"kind": "class",
|
|
546
|
-
"name": "a.b.C",
|
|
547
|
-
"sourceMapping": "obfuscated",
|
|
548
|
-
"targetMapping": "mojang",
|
|
549
|
-
"sourcePriority": "loom-first",
|
|
550
|
-
"maxCandidates": 10,
|
|
551
|
-
"disambiguation": {
|
|
552
|
-
"ownerHint": "net.minecraft"
|
|
158
|
+
"task": "class-source",
|
|
159
|
+
"subject": {
|
|
160
|
+
"kind": "class",
|
|
161
|
+
"className": "net.minecraft.server.Main",
|
|
162
|
+
"artifact": {
|
|
163
|
+
"type": "resolve-target",
|
|
164
|
+
"target": {
|
|
165
|
+
"kind": "version",
|
|
166
|
+
"value": "1.21.10"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
553
169
|
}
|
|
554
170
|
}
|
|
555
171
|
}
|
|
556
172
|
```
|
|
557
173
|
|
|
558
|
-
|
|
559
|
-
```json
|
|
560
|
-
{
|
|
561
|
-
"tool": "find-mapping",
|
|
562
|
-
"arguments": {
|
|
563
|
-
"version": "1.21.10",
|
|
564
|
-
"kind": "method",
|
|
565
|
-
"name": "tick",
|
|
566
|
-
"owner": "a.b.C",
|
|
567
|
-
"descriptor": "(I)V",
|
|
568
|
-
"sourceMapping": "obfuscated",
|
|
569
|
-
"targetMapping": "intermediary"
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
```
|
|
573
|
-
|
|
574
|
-
#### Resolve exact method mapping
|
|
575
|
-
```json
|
|
576
|
-
{
|
|
577
|
-
"tool": "resolve-method-mapping-exact",
|
|
578
|
-
"arguments": {
|
|
579
|
-
"version": "1.21.10",
|
|
580
|
-
"name": "f",
|
|
581
|
-
"owner": "a.b.C",
|
|
582
|
-
"descriptor": "(Ljava/lang/String;)V",
|
|
583
|
-
"sourceMapping": "obfuscated",
|
|
584
|
-
"targetMapping": "mojang"
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
```
|
|
588
|
-
|
|
589
|
-
#### Show class API mapping matrix
|
|
590
|
-
```json
|
|
591
|
-
{
|
|
592
|
-
"tool": "get-class-api-matrix",
|
|
593
|
-
"arguments": {
|
|
594
|
-
"version": "1.21.10",
|
|
595
|
-
"className": "a.b.C",
|
|
596
|
-
"classNameMapping": "obfuscated",
|
|
597
|
-
"includeKinds": "class,field,method",
|
|
598
|
-
"maxRows": 100
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
```
|
|
602
|
-
|
|
603
|
-
Add `maxCandidates` or `maxRows` when you only need the top matches or a bounded API slice.
|
|
604
|
-
|
|
605
|
-
#### Resolve workspace compile-visible symbol
|
|
606
|
-
```json
|
|
607
|
-
{
|
|
608
|
-
"tool": "resolve-workspace-symbol",
|
|
609
|
-
"arguments": {
|
|
610
|
-
"projectPath": "/path/to/mod/workspace",
|
|
611
|
-
"version": "1.21.10",
|
|
612
|
-
"kind": "method",
|
|
613
|
-
"name": "f",
|
|
614
|
-
"owner": "a.b.C",
|
|
615
|
-
"descriptor": "(Ljava/lang/String;)V",
|
|
616
|
-
"sourceMapping": "obfuscated"
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
```
|
|
620
|
-
|
|
621
|
-
#### Check symbol existence
|
|
622
|
-
```json
|
|
623
|
-
{
|
|
624
|
-
"tool": "check-symbol-exists",
|
|
625
|
-
"arguments": {
|
|
626
|
-
"version": "1.21.10",
|
|
627
|
-
"kind": "method",
|
|
628
|
-
"name": "f",
|
|
629
|
-
"owner": "a.b.C",
|
|
630
|
-
"descriptor": "(I)V",
|
|
631
|
-
"sourceMapping": "obfuscated"
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
```
|
|
174
|
+
### Map or check a symbol
|
|
635
175
|
|
|
636
|
-
#### Check class existence by short name (`nameMode=auto`)
|
|
637
176
|
```json
|
|
638
177
|
{
|
|
639
|
-
"tool": "
|
|
178
|
+
"tool": "analyze-symbol",
|
|
640
179
|
"arguments": {
|
|
180
|
+
"task": "map",
|
|
181
|
+
"subject": {
|
|
182
|
+
"kind": "method",
|
|
183
|
+
"owner": "net.minecraft.server.Main",
|
|
184
|
+
"name": "tickServer"
|
|
185
|
+
},
|
|
641
186
|
"version": "1.21.10",
|
|
642
|
-
"
|
|
643
|
-
"
|
|
644
|
-
"
|
|
645
|
-
"sourceMapping": "mojang"
|
|
187
|
+
"sourceMapping": "mojang",
|
|
188
|
+
"targetMapping": "intermediary",
|
|
189
|
+
"signatureMode": "name-only"
|
|
646
190
|
}
|
|
647
191
|
}
|
|
648
192
|
```
|
|
649
193
|
|
|
650
|
-
###
|
|
194
|
+
### Summarize a mod JAR
|
|
651
195
|
|
|
652
|
-
#### Decode Java NBT base64 to typed JSON
|
|
653
196
|
```json
|
|
654
197
|
{
|
|
655
|
-
"tool": "
|
|
198
|
+
"tool": "analyze-mod",
|
|
656
199
|
"arguments": {
|
|
657
|
-
"
|
|
658
|
-
"
|
|
200
|
+
"task": "summary",
|
|
201
|
+
"subject": {
|
|
202
|
+
"kind": "jar",
|
|
203
|
+
"jarPath": "/path/to/mymod-1.0.0.jar"
|
|
204
|
+
}
|
|
659
205
|
}
|
|
660
206
|
}
|
|
661
207
|
```
|
|
662
208
|
|
|
663
|
-
|
|
664
|
-
```json
|
|
665
|
-
{
|
|
666
|
-
"tool": "nbt-apply-json-patch",
|
|
667
|
-
"arguments": {
|
|
668
|
-
"typedJson": {
|
|
669
|
-
"rootName": "Level",
|
|
670
|
-
"root": { "type": "compound", "value": {} }
|
|
671
|
-
},
|
|
672
|
-
"patch": [
|
|
673
|
-
{ "op": "add", "path": "/root/value/name", "value": { "type": "string", "value": "Alex" } }
|
|
674
|
-
]
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
```
|
|
209
|
+
### Validate a workspace
|
|
678
210
|
|
|
679
|
-
#### Encode typed JSON back to NBT base64
|
|
680
211
|
```json
|
|
681
212
|
{
|
|
682
|
-
"tool": "
|
|
213
|
+
"tool": "validate-project",
|
|
683
214
|
"arguments": {
|
|
684
|
-
"
|
|
685
|
-
|
|
686
|
-
"
|
|
215
|
+
"task": "project-summary",
|
|
216
|
+
"subject": {
|
|
217
|
+
"kind": "workspace",
|
|
218
|
+
"projectPath": "/workspace/modid",
|
|
219
|
+
"discover": ["mixins", "access-wideners"]
|
|
687
220
|
},
|
|
688
|
-
"
|
|
689
|
-
|
|
690
|
-
}
|
|
691
|
-
```
|
|
692
|
-
|
|
693
|
-
### Mod Analysis Workflow
|
|
694
|
-
|
|
695
|
-
A typical mod analysis workflow progresses through metadata extraction, decompilation, source reading, and search:
|
|
696
|
-
|
|
697
|
-
#### 1. Analyze mod metadata
|
|
698
|
-
|
|
699
|
-
Extract loader type, mod ID, dependencies, and Mixin configurations from a mod JAR:
|
|
700
|
-
|
|
701
|
-
```json
|
|
702
|
-
{
|
|
703
|
-
"tool": "analyze-mod-jar",
|
|
704
|
-
"arguments": {
|
|
705
|
-
"jarPath": "/path/to/mymod-1.0.0.jar",
|
|
706
|
-
"includeClasses": true
|
|
221
|
+
"preferProjectVersion": true,
|
|
222
|
+
"preferProjectMapping": true
|
|
707
223
|
}
|
|
708
224
|
}
|
|
709
225
|
```
|
|
710
226
|
|
|
711
|
-
|
|
227
|
+
## Documentation
|
|
712
228
|
|
|
713
|
-
|
|
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
|
|
714
232
|
|
|
715
|
-
|
|
716
|
-
{
|
|
717
|
-
"tool": "decompile-mod-jar",
|
|
718
|
-
"arguments": {
|
|
719
|
-
"jarPath": "/path/to/mymod-1.0.0.jar",
|
|
720
|
-
"includeFiles": false,
|
|
721
|
-
"className": "com.example.mymod.MyMod"
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
```
|
|
233
|
+
## Tool Surface
|
|
725
234
|
|
|
726
|
-
|
|
235
|
+
Start with these top-level workflow tools unless you already know the exact specialized operation you want. The lower-level tools remain available for narrow follow-up work and automation.
|
|
727
236
|
|
|
728
|
-
|
|
237
|
+
### Top-Level Workflow Tools
|
|
729
238
|
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
#### 4. Search across decompiled mod source
|
|
742
|
-
|
|
743
|
-
Find method references, field usages, or text patterns across the entire decompiled mod:
|
|
239
|
+
<!-- BEGIN GENERATED TOOL TABLE: v3-entry-tools -->
|
|
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 |
|
|
248
|
+
<!-- END GENERATED TOOL TABLE: v3-entry-tools -->
|
|
744
249
|
|
|
745
|
-
|
|
746
|
-
{
|
|
747
|
-
"tool": "search-mod-source",
|
|
748
|
-
"arguments": {
|
|
749
|
-
"jarPath": "/path/to/mymod-1.0.0.jar",
|
|
750
|
-
"query": "onPlayerTick",
|
|
751
|
-
"searchType": "method",
|
|
752
|
-
"limit": 50
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
```
|
|
250
|
+
### Source Exploration
|
|
756
251
|
|
|
757
|
-
|
|
252
|
+
Tools for browsing Minecraft versions, resolving source artifacts, and reading or searching decompiled source code.
|
|
758
253
|
|
|
759
|
-
|
|
254
|
+
<!-- BEGIN GENERATED TOOL TABLE: source-exploration -->
|
|
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 |
|
|
266
|
+
<!-- END GENERATED TOOL TABLE: source-exploration -->
|
|
760
267
|
|
|
761
|
-
|
|
762
|
-
{
|
|
763
|
-
"tool": "remap-mod-jar",
|
|
764
|
-
"arguments": {
|
|
765
|
-
"inputJar": "/path/to/mymod-1.0.0.jar",
|
|
766
|
-
"targetMapping": "yarn",
|
|
767
|
-
"mcVersion": "1.21.10"
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
```
|
|
268
|
+
### Version Comparison & Symbol Tracking
|
|
771
269
|
|
|
772
|
-
|
|
270
|
+
Tools for comparing class and registry changes across Minecraft versions and tracing symbol existence over time.
|
|
773
271
|
|
|
774
|
-
|
|
272
|
+
<!-- BEGIN GENERATED TOOL TABLE: version-comparison-symbol-tracking -->
|
|
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 |
|
|
278
|
+
<!-- END GENERATED TOOL TABLE: version-comparison-symbol-tracking -->
|
|
775
279
|
|
|
776
|
-
|
|
280
|
+
### Mapping & Symbols
|
|
777
281
|
|
|
778
|
-
|
|
282
|
+
Tools for converting symbol names between namespaces and checking symbol existence.
|
|
779
283
|
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
"mapping": "yarn",
|
|
790
|
-
"reportMode": "compact",
|
|
791
|
-
"warningMode": "aggregated",
|
|
792
|
-
"includeIssues": false
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
```
|
|
284
|
+
<!-- BEGIN GENERATED TOOL TABLE: mapping-symbols -->
|
|
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 |
|
|
292
|
+
<!-- END GENERATED TOOL TABLE: mapping-symbols -->
|
|
796
293
|
|
|
797
|
-
|
|
294
|
+
### NBT Utilities
|
|
798
295
|
|
|
799
|
-
|
|
296
|
+
Tools for decoding, patching, and encoding Java Edition NBT binary data using a typed JSON representation.
|
|
800
297
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
},
|
|
809
|
-
"version": "1.21.10",
|
|
810
|
-
"projectPath": "/workspace/modid",
|
|
811
|
-
"preferProjectVersion": true,
|
|
812
|
-
"preferProjectMapping": true,
|
|
813
|
-
"reportMode": "compact",
|
|
814
|
-
"warningMode": "aggregated",
|
|
815
|
-
"includeIssues": false
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
```
|
|
298
|
+
<!-- BEGIN GENERATED TOOL TABLE: nbt-utilities -->
|
|
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 |
|
|
304
|
+
<!-- END GENERATED TOOL TABLE: nbt-utilities -->
|
|
819
305
|
|
|
820
|
-
|
|
306
|
+
### Mod Analysis
|
|
821
307
|
|
|
822
|
-
|
|
308
|
+
Tools for extracting metadata from mod JARs, decompiling mod source, searching mod code, and remapping mod namespaces.
|
|
823
309
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
]
|
|
834
|
-
},
|
|
835
|
-
"version": "1.21.10",
|
|
836
|
-
"mapping": "yarn",
|
|
837
|
-
"reportMode": "compact",
|
|
838
|
-
"warningMode": "aggregated",
|
|
839
|
-
"includeIssues": false
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
```
|
|
310
|
+
<!-- BEGIN GENERATED TOOL TABLE: mod-analysis -->
|
|
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 |
|
|
318
|
+
<!-- END GENERATED TOOL TABLE: mod-analysis -->
|
|
843
319
|
|
|
844
|
-
|
|
320
|
+
### Validation
|
|
845
321
|
|
|
846
|
-
|
|
322
|
+
Tools for validating Mixin source and Access Widener files against a target Minecraft version.
|
|
847
323
|
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
"mapping": "yarn"
|
|
855
|
-
}
|
|
856
|
-
}
|
|
857
|
-
```
|
|
324
|
+
<!-- BEGIN GENERATED TOOL TABLE: validation -->
|
|
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 |
|
|
329
|
+
<!-- END GENERATED TOOL TABLE: validation -->
|
|
858
330
|
|
|
859
331
|
### Registry & Diagnostics
|
|
860
332
|
|
|
861
|
-
|
|
333
|
+
Tools for querying generated registry data and inspecting server runtime state.
|
|
862
334
|
|
|
863
|
-
|
|
335
|
+
<!-- BEGIN GENERATED TOOL TABLE: registry-diagnostics -->
|
|
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 |
|
|
340
|
+
<!-- END GENERATED TOOL TABLE: registry-diagnostics -->
|
|
864
341
|
|
|
865
|
-
|
|
866
|
-
{
|
|
867
|
-
"tool": "get-registry-data",
|
|
868
|
-
"arguments": {
|
|
869
|
-
"version": "1.21.10",
|
|
870
|
-
"includeData": false
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
```
|
|
342
|
+
Detailed parameter constraints, migration notes, resource behavior, and the full environment-variable matrix live in [docs/tool-reference.md](docs/tool-reference.md).
|
|
874
343
|
|
|
875
|
-
|
|
344
|
+
## Development
|
|
876
345
|
|
|
877
|
-
|
|
346
|
+
Repository requirements:
|
|
878
347
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
"arguments": {
|
|
883
|
-
"version": "1.21.10",
|
|
884
|
-
"registry": "minecraft:block",
|
|
885
|
-
"maxEntriesPerRegistry": 50
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
```
|
|
889
|
-
|
|
890
|
-
#### Force reindex an artifact
|
|
348
|
+
- Node.js 22+
|
|
349
|
+
- `pnpm`
|
|
350
|
+
- Java when running remap or decompile flows locally
|
|
891
351
|
|
|
892
|
-
|
|
352
|
+
Setup and run the repository:
|
|
893
353
|
|
|
894
|
-
```
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
"arguments": {
|
|
898
|
-
"artifactId": "<artifact-id>",
|
|
899
|
-
"force": true
|
|
900
|
-
}
|
|
901
|
-
}
|
|
354
|
+
```bash
|
|
355
|
+
pnpm install
|
|
356
|
+
pnpm dev
|
|
902
357
|
```
|
|
903
358
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
Check server performance counters, cache sizes, and latency snapshots:
|
|
359
|
+
Build the packaged shape:
|
|
907
360
|
|
|
908
|
-
```
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
"arguments": {}
|
|
912
|
-
}
|
|
361
|
+
```bash
|
|
362
|
+
pnpm build
|
|
363
|
+
pnpm start
|
|
913
364
|
```
|
|
914
365
|
|
|
915
|
-
|
|
916
|
-
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.
|
|
917
|
-
|
|
918
|
-
## Mapping Policy
|
|
919
|
-
|
|
920
|
-
### Namespace Definitions
|
|
921
|
-
|
|
922
|
-
| Namespace | Description |
|
|
923
|
-
| --- | --- |
|
|
924
|
-
| `obfuscated` | Mojang obfuscated names (e.g. `a`, `b`, `c`) |
|
|
925
|
-
| `mojang` | Mojang deobfuscated names from `client_mappings.txt` (e.g. `net.minecraft.server.Main`) |
|
|
926
|
-
| `intermediary` | Fabric stable intermediary names (e.g. `net.minecraft.class_1234`, `method_5678`) |
|
|
927
|
-
| `yarn` | Fabric community human-readable names (e.g. `net.minecraft.server.MinecraftServer`, `tick`) |
|
|
928
|
-
|
|
929
|
-
The legacy public namespace name `official` was removed. Requests that still send `official` now fail validation and should be updated to `obfuscated`.
|
|
366
|
+
Always run:
|
|
930
367
|
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
Symbol query inputs use `kind` + `name` + optional `owner`/`descriptor`:
|
|
936
|
-
- class: `kind=class`, `name=a.b.C` (default FQCN). For existence checks only, `nameMode=auto` allows short names like `C`.
|
|
937
|
-
- field: `kind=field`, `owner=a.b.C`, `name=fieldName`
|
|
938
|
-
- method: `kind=method`, `owner=a.b.C`, `name=methodName`, `descriptor=(I)V`
|
|
939
|
-
|
|
940
|
-
`mapping: "mojang"` requires a source-backed artifact. If only decompile path is available, the server returns `ERR_MAPPING_NOT_APPLIED`.
|
|
941
|
-
|
|
942
|
-
`resolve-artifact`, `get-class-members`, `trace-symbol-lifecycle`, and `diff-class-signatures` accept `obfuscated | mojang | intermediary | yarn` with constraints:
|
|
943
|
-
- `intermediary` / `yarn` require a resolvable Minecraft version context (for example `target.kind=version` or a versioned coordinate).
|
|
944
|
-
- for unobfuscated versions (for example 26.1+), requesting `intermediary` / `yarn` falls back to `obfuscated` with a warning.
|
|
945
|
-
- `mojang` requires source-backed artifacts; decompile-only paths are rejected with `ERR_MAPPING_NOT_APPLIED`.
|
|
946
|
-
|
|
947
|
-
When `trace-symbol-lifecycle` omits `descriptor`, the server resolves methods by owner+name and warns if overload ambiguity prevents a unique answer.
|
|
948
|
-
For decompile-only `ERR_MAPPING_NOT_APPLIED` failures, error details include `artifactOrigin`, `nextAction`, and `suggestedCall` so clients can recover without guessing.
|
|
949
|
-
|
|
950
|
-
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`.
|
|
951
|
-
|
|
952
|
-
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.
|
|
953
|
-
|
|
954
|
-
Use `resolve-method-mapping-exact` when candidate ranking is not enough and the workflow needs strict `owner+name+descriptor` certainty.
|
|
955
|
-
Use `find-mapping` `disambiguation.ownerHint` / `disambiguation.descriptorHint` to narrow ambiguous candidate sets.
|
|
956
|
-
Use `resolve-workspace-symbol` when you need compile-visible names from actual Gradle Loom mappings in a workspace.
|
|
957
|
-
|
|
958
|
-
## Environment Variables
|
|
959
|
-
|
|
960
|
-
### Core
|
|
961
|
-
|
|
962
|
-
| Variable | Default | Description |
|
|
963
|
-
| --- | --- | --- |
|
|
964
|
-
| `MCP_CACHE_DIR` | `~/.cache/minecraft-modding-mcp` | Cache root for downloads and SQLite |
|
|
965
|
-
| `MCP_SQLITE_PATH` | `<cacheDir>/source-cache.db` | SQLite database path |
|
|
966
|
-
| `MCP_SOURCE_REPOS` | Maven Central + Fabric + Forge + NeoForge | Comma-separated Maven repository URLs |
|
|
967
|
-
| `MCP_LOCAL_M2` | `~/.m2/repository` | Local Maven repository path |
|
|
968
|
-
| `MCP_ENABLE_INDEXED_SEARCH` | `true` | Enable indexed query path for `search-class-source` |
|
|
969
|
-
| `MCP_MAPPING_SOURCE_PRIORITY` | `loom-first` | Mapping source priority (`loom-first` or `maven-first`) |
|
|
970
|
-
| `MCP_VERSION_MANIFEST_URL` | Mojang manifest URL | Override manifest endpoint for testing/private mirrors |
|
|
971
|
-
|
|
972
|
-
### Limits & Tuning
|
|
973
|
-
|
|
974
|
-
| Variable | Default | Description |
|
|
975
|
-
| --- | --- | --- |
|
|
976
|
-
| `MCP_MAX_CONTENT_BYTES` | `1000000` | Maximum bytes for file read operations |
|
|
977
|
-
| `MCP_MAX_SEARCH_HITS` | `200` | Maximum search result count |
|
|
978
|
-
| `MCP_MAX_ARTIFACTS` | `200` | Maximum cached artifacts |
|
|
979
|
-
| `MCP_MAX_CACHE_BYTES` | `2147483648` | Maximum total cache size in bytes |
|
|
980
|
-
| `MCP_FETCH_TIMEOUT_MS` | `15000` | HTTP request timeout in milliseconds |
|
|
981
|
-
| `MCP_FETCH_RETRIES` | `2` | HTTP request retry count |
|
|
982
|
-
|
|
983
|
-
### Decompilation & Remapping
|
|
984
|
-
|
|
985
|
-
| Variable | Default | Description |
|
|
986
|
-
| --- | --- | --- |
|
|
987
|
-
| `MCP_VINEFLOWER_JAR_PATH` | unset | External Vineflower JAR path (auto-downloaded if unset) |
|
|
988
|
-
| `MCP_TINY_REMAPPER_JAR_PATH` | unset | External tiny-remapper JAR path (auto-downloaded if unset) |
|
|
989
|
-
| `MCP_REMAP_TIMEOUT_MS` | `600000` | Remap operation timeout in milliseconds |
|
|
990
|
-
| `MCP_REMAP_MAX_MEMORY_MB` | `4096` | Maximum JVM heap for remap operations |
|
|
991
|
-
|
|
992
|
-
### NBT
|
|
993
|
-
|
|
994
|
-
| Variable | Default | Description |
|
|
995
|
-
| --- | --- | --- |
|
|
996
|
-
| `MCP_MAX_NBT_INPUT_BYTES` | `4194304` | Maximum decoded NBT input bytes accepted by `nbt-to-json` |
|
|
997
|
-
| `MCP_MAX_NBT_INFLATED_BYTES` | `16777216` | Maximum gzip-inflated bytes accepted by `nbt-to-json` |
|
|
998
|
-
| `MCP_MAX_NBT_RESPONSE_BYTES` | `8388608` | Maximum response payload bytes for NBT tools |
|
|
368
|
+
```bash
|
|
369
|
+
pnpm check
|
|
370
|
+
pnpm test
|
|
371
|
+
```
|
|
999
372
|
|
|
1000
|
-
|
|
373
|
+
Run these when relevant:
|
|
1001
374
|
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
| Decompilation | [Vineflower](https://github.com/Vineflower/vineflower) (auto-downloaded) |
|
|
1008
|
-
| Remapping | [tiny-remapper](https://github.com/FabricMC/tiny-remapper) (requires Java) |
|
|
1009
|
-
| Mapping Sources | Mojang `client_mappings.txt`, Fabric Loom workspace, Maven Tiny v2 |
|
|
1010
|
-
|
|
1011
|
-
The server runs as a single long-lived process communicating over stdio. Artifacts (source JARs, binary JARs, mapping files) are downloaded on demand and cached in SQLite. The search index is built lazily on first query and persisted for subsequent calls.
|
|
1012
|
-
|
|
1013
|
-
## Development Notes
|
|
1014
|
-
|
|
1015
|
-
- `SourceService` is the canonical implementation for artifact resolution, ingestion, and source querying.
|
|
1016
|
-
- `version` resolution downloads Mojang client JARs into cache and routes them through the same ingestion flow as `jar` and `coordinate` targets.
|
|
1017
|
-
- Tool responses are always wrapped as `{ result?, error?, meta }`.
|
|
1018
|
-
- Tool responses also mirror that envelope into MCP `structuredContent`, and failures set `isError=true`.
|
|
1019
|
-
- `meta` includes `requestId`, `tool`, `durationMs`, and `warnings[]`.
|
|
375
|
+
- `pnpm test:manual:stdio-smoke` for MCP transport, registration, or manual workflow changes
|
|
376
|
+
- `pnpm test:manual:package-smoke` when checking packaged install and distribution behavior
|
|
377
|
+
- `pnpm test:perf` for search, index, or performance-sensitive changes
|
|
378
|
+
- `pnpm test:coverage` or `pnpm test:coverage:lcov` for coverage checks (`lines=80`, `branches=70`, `functions=80`)
|
|
379
|
+
- `pnpm validate` for the full local validation suite
|
|
1020
380
|
|
|
1021
381
|
## License
|
|
1022
382
|
|