mcmodding-mcp 0.1.0 → 0.2.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/README.md CHANGED
@@ -1,324 +1,334 @@
1
- # mcmodding-mcp
2
-
3
- [![npm version](https://img.shields.io/npm/v/mcmodding-mcp.svg)](https://www.npmjs.com/package/mcmodding-mcp)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
- [![CI](https://github.com/OGMatrix/mcmodding-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/OGMatrix/mcmodding-mcp/actions/workflows/ci.yml)
6
-
7
- > MCP server providing AI assistants with comprehensive, up-to-date Minecraft modding documentation for Fabric and NeoForge.
8
-
9
- ## What is this?
10
-
11
- **mcmodding-mcp** is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that gives AI assistants like Claude direct access to Minecraft modding documentation. Instead of relying on potentially outdated training data, your AI assistant can search real documentation, find code examples, and explain concepts accurately.
12
-
13
- ### Key Benefits
14
-
15
- - **Always Current** - Documentation is indexed weekly from official sources
16
- - **Accurate Answers** - AI responses backed by real documentation, not hallucinations
17
- - **Code Examples** - Searchable code blocks with proper context
18
- - **Semantic Search** - Understands what you mean, not just keywords
19
- - **Zero Config** - Works immediately after installation
20
-
21
- ---
22
-
23
- ## Quick Start
24
-
25
- ### Installation
26
-
27
- ```bash
28
- # Install globally
29
- npm install -g mcmodding-mcp
30
- ```
31
-
32
- ### Configure Your AI Client
33
-
34
- Add to your MCP client configuration (e.g., Claude Desktop):
35
-
36
- ```json
37
- {
38
- "mcpServers": {
39
- "mcmodding": {
40
- "command": "mcmodding-mcp"
41
- }
42
- }
43
- }
44
- ```
45
-
46
- That's it! Your AI assistant now has access to Minecraft modding documentation.
47
-
48
- ---
49
-
50
- ## Available Tools
51
-
52
- The MCP server provides four powerful tools:
53
-
54
- ### `search_fabric_docs`
55
-
56
- Search documentation with smart filtering.
57
-
58
- ```typescript
59
- // Example: Find information about item registration
60
- {
61
- query: "how to register custom items",
62
- category: "items", // Optional filter
63
- loader: "fabric", // fabric | neoforge
64
- minecraft_version: "1.21.4" // Optional version filter
65
- }
66
- ```
67
-
68
- ### `get_example`
69
-
70
- Get working code examples for any topic.
71
-
72
- ```typescript
73
- // Example: Get block registration code
74
- {
75
- topic: "custom block with block entity",
76
- language: "java",
77
- loader: "fabric"
78
- }
79
- ```
80
-
81
- ### `explain_fabric_concept`
82
-
83
- Get detailed explanations of modding concepts with related resources.
84
-
85
- ```typescript
86
- // Example: Understand mixins
87
- {
88
- concept: "mixins"
89
- }
90
- ```
91
-
92
- ### `get_minecraft_version`
93
-
94
- Get current Minecraft version information.
95
-
96
- ```typescript
97
- // Get latest version
98
- { type: "latest" }
99
-
100
- // Get all indexed versions
101
- { type: "all" }
102
- ```
103
-
104
- ---
105
-
106
- ## Features
107
-
108
- ### Hybrid Search Engine
109
-
110
- Combines multiple search strategies for best results:
111
-
112
- | Strategy | Purpose |
113
- |----------|---------|
114
- | **FTS5 Full-Text** | Fast keyword matching with ranking |
115
- | **Semantic Embeddings** | Understanding meaning and context |
116
- | **Section Search** | Finding relevant documentation sections |
117
- | **Code Search** | Locating specific code patterns |
118
-
119
- ### Auto-Updates
120
-
121
- The database automatically checks for updates on startup:
122
- - Compares local version with GitHub releases
123
- - Downloads new versions with hash verification
124
- - Creates backups before updating
125
- - Non-blocking - server starts immediately
126
-
127
- ### Documentation Sources
128
-
129
- Currently indexes:
130
- - [wiki.fabricmc.net](https://wiki.fabricmc.net) - Fabric Wiki (226+ pages)
131
- - [docs.fabricmc.net](https://docs.fabricmc.net) - Official Fabric Docs (266+ pages)
132
-
133
- ---
134
-
135
- ## For Developers
136
-
137
- ### Development Setup
138
-
139
- ```bash
140
- # Clone repository
141
- git clone https://github.com/OGMatrix/mcmodding-mcp.git
142
- cd mcmodding-mcp
143
-
144
- # Install dependencies
145
- npm install
146
-
147
- # Run in development mode
148
- npm run dev
149
- ```
150
-
151
- ### Build Commands
152
-
153
- ```bash
154
- # Development
155
- npm run dev # Watch mode with hot reload
156
- npm run typecheck # TypeScript type checking
157
- npm run lint # ESLint
158
- npm run test # Run tests
159
- npm run format # Prettier formatting
160
-
161
- # Production
162
- npm run build # Build TypeScript
163
- npm run build:prod # Build with fresh documentation index
164
- npm run index-docs # Index documentation with embeddings
165
- ```
166
-
167
- ### Project Structure
168
-
169
- ```
170
- mcmodding-mcp/
171
- ├── src/
172
- │ ├── index.ts # MCP server entry point
173
- │ ├── db-versioning.ts # Auto-update system
174
- │ ├── indexer/
175
- │ │ ├── crawler.ts # Documentation crawler
176
- │ │ ├── chunker.ts # Text chunking
177
- │ │ ├── embeddings.ts # Semantic embeddings
178
- │ │ ├── store.ts # SQLite database
179
- │ │ └── sitemap.ts # Sitemap parsing
180
- │ ├── services/
181
- │ │ ├── search-service.ts # Search logic
182
- │ │ └── concept-service.ts # Concept explanations
183
- │ └── tools/
184
- │ ├── searchDocs.ts # search_fabric_docs handler
185
- │ ├── getExample.ts # get_example handler
186
- │ └── explainConcept.ts # explain_fabric_concept handler
187
- ├── scripts/
188
- │ └── index-docs.ts # Documentation indexing script
189
- ├── data/
190
- │ ├── mcmodding-docs.db # SQLite database
191
- │ └── manifest.json # Version manifest
192
- └── dist/ # Compiled JavaScript
193
- ```
194
-
195
- ### Database Schema
196
-
197
- ```sql
198
- -- Documents: Full documentation pages
199
- CREATE TABLE documents (
200
- id INTEGER PRIMARY KEY,
201
- url TEXT UNIQUE NOT NULL,
202
- title TEXT NOT NULL,
203
- content TEXT NOT NULL,
204
- category TEXT NOT NULL,
205
- loader TEXT NOT NULL, -- fabric | neoforge | shared
206
- minecraft_version TEXT,
207
- hash TEXT NOT NULL -- For change detection
208
- );
209
-
210
- -- Chunks: Searchable content units
211
- CREATE TABLE chunks (
212
- id TEXT PRIMARY KEY,
213
- document_id INTEGER NOT NULL,
214
- chunk_type TEXT NOT NULL, -- title | section | code | full
215
- content TEXT NOT NULL,
216
- section_heading TEXT,
217
- code_language TEXT,
218
- word_count INTEGER,
219
- has_code BOOLEAN
220
- );
221
-
222
- -- Embeddings: Semantic search vectors
223
- CREATE TABLE embeddings (
224
- chunk_id TEXT PRIMARY KEY,
225
- embedding BLOB NOT NULL, -- 384-dim Float32Array
226
- dimension INTEGER NOT NULL,
227
- model TEXT NOT NULL -- Xenova/all-MiniLM-L6-v2
228
- );
229
-
230
- -- FTS5 indexes for fast text search
231
- CREATE VIRTUAL TABLE documents_fts USING fts5(...);
232
- CREATE VIRTUAL TABLE chunks_fts USING fts5(...);
233
- ```
234
-
235
- ---
236
-
237
- ## Release Workflow
238
-
239
- This project uses [release-please](https://github.com/googleapis/release-please) for automated releases.
240
-
241
- ### Branch Strategy
242
-
243
- | Branch | Purpose |
244
- |--------|---------|
245
- | `dev` | Active development |
246
- | `prod` | Production releases |
247
-
248
- ### How It Works
249
-
250
- 1. Push commits to `dev` using [conventional commits](https://www.conventionalcommits.org/)
251
- 2. Release-please maintains a Release PR (`dev` → `prod`)
252
- 3. When merged, automatic release: npm publish + GitHub release + database upload
253
- 4. Changes sync back to `dev`
254
-
255
- See [RELEASE_WORKFLOW.md](RELEASE_WORKFLOW.md) for complete details.
256
-
257
- ---
258
-
259
- ## Configuration
260
-
261
- ### Environment Variables
262
-
263
- | Variable | Description | Default |
264
- |----------|-------------|---------|
265
- | `DB_PATH` | Custom database path | `./data/mcmodding-docs.db` |
266
- | `GITHUB_REPO_URL` | Custom repo for updates | Auto-detected |
267
- | `MCP_DEBUG` | Enable debug logging | `false` |
268
-
269
- ### Disabling Auto-Updates
270
-
271
- Set `DB_PATH` to a custom location to manage updates manually:
272
-
273
- ```bash
274
- DB_PATH=/path/to/my/database.db mcmodding-mcp
275
- ```
276
-
277
- ---
278
-
279
- ## Statistics
280
-
281
- Typical index contains:
282
-
283
- | Metric | Count |
284
- |--------|-------|
285
- | Documentation pages | 490+ |
286
- | Searchable sections | 2,000+ |
287
- | Code examples | 500+ |
288
- | Semantic embeddings | 5,000+ |
289
- | Database size | ~50 MB |
290
-
291
- ---
292
-
293
- ## Contributing
294
-
295
- We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
296
-
297
- ### Quick Contribution Guide
298
-
299
- 1. Fork the repository
300
- 2. Create a feature branch from `dev`
301
- 3. Make changes with conventional commits
302
- 4. Submit a PR to `dev`
303
-
304
- ---
305
-
306
- ## License
307
-
308
- MIT License - see [LICENSE](LICENSE) for details.
309
-
310
- ---
311
-
312
- ## Acknowledgments
313
-
314
- - [Fabric Documentation](https://docs.fabricmc.net/) - Official Fabric documentation
315
- - [Fabric Wiki](https://wiki.fabricmc.net/) - Community wiki
316
- - [Model Context Protocol](https://modelcontextprotocol.io/) - MCP specification
317
- - [Transformers.js](https://huggingface.co/docs/transformers.js) - Local ML embeddings
318
- - [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Fast SQLite bindings
319
-
320
- ---
321
-
322
- <p align="center">
323
- <strong>Built with care for the Minecraft modding community</strong>
324
- </p>
1
+ # mcmodding-mcp
2
+
3
+ [![npm version](https://img.shields.io/npm/v/mcmodding-mcp.svg)](https://www.npmjs.com/package/mcmodding-mcp)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![CI](https://github.com/OGMatrix/mcmodding-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/OGMatrix/mcmodding-mcp/actions/workflows/ci.yml)
6
+
7
+ > MCP server providing AI assistants with comprehensive, up-to-date Minecraft modding documentation for Fabric and NeoForge.
8
+
9
+ ## What is this?
10
+
11
+ **mcmodding-mcp** is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that gives AI assistants like Claude direct access to Minecraft modding documentation. Instead of relying on potentially outdated training data, your AI assistant can search real documentation, find code examples, and explain concepts accurately.
12
+
13
+ ### Key Benefits
14
+
15
+ - **Always Current** - Documentation is indexed weekly from official sources
16
+ - **Accurate Answers** - AI responses backed by real documentation, not hallucinations
17
+ - **Code Examples** - Searchable code blocks with proper context
18
+ - **Semantic Search** - Understands what you mean, not just keywords
19
+ - **Zero Config** - Works immediately after installation
20
+
21
+ ### 📚 Knowledge Base Stats
22
+
23
+ Our documentation database (`mcmodding-docs.db`) is comprehensive and constantly updated:
24
+
25
+ - **1,000+** Documentation Pages
26
+ - **185,000+** Searchable Chunks
27
+ - **8,500+** Logical Sections
28
+ - **185,000+** Vector Embeddings for Semantic Search
29
+
30
+ This ensures that even obscure API details can be found via semantic search.
31
+
32
+ ---
33
+
34
+ ## Quick Start
35
+
36
+ ### Installation
37
+
38
+ ```bash
39
+ # Install globally
40
+ npm install -g mcmodding-mcp
41
+ ```
42
+
43
+ ### Configure Your AI Client
44
+
45
+ Add to your MCP client configuration (e.g., Claude Desktop):
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "mcmodding": {
51
+ "command": "mcmodding-mcp"
52
+ }
53
+ }
54
+ }
55
+ ```
56
+
57
+ ### 🧠 Optimized System Prompt
58
+
59
+ To get the best results, we recommend adding this to your AI's system prompt or custom instructions:
60
+
61
+ > You are an expert Minecraft Modding Assistant connected to `mcmodding-mcp`. **DO NOT rely on your internal knowledge** for modding APIs (Fabric/NeoForge) as they change frequently. **ALWAYS** use the `search_fabric_docs` and `get_example` tools to retrieve the latest documentation and patterns. Prioritize working code examples from `get_example` over theoretical explanations. If the user specifies a Minecraft version, ensure all retrieved information matches that version.
62
+
63
+ That's it! Your AI assistant now has access to Minecraft modding documentation.
64
+
65
+ ---
66
+
67
+ ## Available Tools
68
+
69
+ The MCP server provides four powerful tools:
70
+
71
+ ### `search_fabric_docs`
72
+
73
+ Search documentation with smart filtering.
74
+
75
+ ```typescript
76
+ // Example: Find information about item registration
77
+ {
78
+ query: "how to register custom items",
79
+ category: "items", // Optional filter
80
+ loader: "fabric", // fabric | neoforge
81
+ minecraft_version: "1.21.4" // Optional version filter
82
+ }
83
+ ```
84
+
85
+ ### `get_example`
86
+
87
+ Get working code examples for any topic.
88
+
89
+ ```typescript
90
+ // Example: Get block registration code
91
+ {
92
+ topic: "custom block with block entity",
93
+ language: "java",
94
+ loader: "fabric"
95
+ }
96
+ ```
97
+
98
+ ### `explain_fabric_concept`
99
+
100
+ Get detailed explanations of modding concepts with related resources.
101
+
102
+ ```typescript
103
+ // Example: Understand mixins
104
+ {
105
+ concept: 'mixins';
106
+ }
107
+ ```
108
+
109
+ ### `get_minecraft_version`
110
+
111
+ Get current Minecraft version information.
112
+
113
+ ```typescript
114
+ // Get latest version
115
+ {
116
+ type: 'latest';
117
+ }
118
+
119
+ // Get all indexed versions
120
+ {
121
+ type: 'all';
122
+ }
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Features
128
+
129
+ ### Hybrid Search Engine
130
+
131
+ Combines multiple search strategies for best results:
132
+
133
+ | Strategy | Purpose |
134
+ | ----------------------- | --------------------------------------- |
135
+ | **FTS5 Full-Text** | Fast keyword matching with ranking |
136
+ | **Semantic Embeddings** | Understanding meaning and context |
137
+ | **Section Search** | Finding relevant documentation sections |
138
+ | **Code Search** | Locating specific code patterns |
139
+
140
+ ### Auto-Updates
141
+
142
+ The database automatically checks for updates on startup:
143
+
144
+ - Compares local version with GitHub releases
145
+ - Downloads new versions with hash verification
146
+ - Creates backups before updating
147
+ - Non-blocking - server starts immediately
148
+
149
+ ### Documentation Sources
150
+
151
+ Currently indexes:
152
+
153
+ - [wiki.fabricmc.net](https://wiki.fabricmc.net) - Fabric Wiki (226+ pages)
154
+ - [docs.fabricmc.net](https://docs.fabricmc.net) - Official Fabric Docs (266+ pages)
155
+ - [docs.neoforged.net](https://docs.neoforged.net) - NeoForge Docs (512+ pages)
156
+
157
+ ---
158
+
159
+ ## For Developers
160
+
161
+ ### Development Setup
162
+
163
+ ```bash
164
+ # Clone repository
165
+ git clone https://github.com/OGMatrix/mcmodding-mcp.git
166
+ cd mcmodding-mcp
167
+
168
+ # Install dependencies
169
+ npm install
170
+
171
+ # Run in development mode
172
+ npm run dev
173
+ ```
174
+
175
+ ### Build Commands
176
+
177
+ ```bash
178
+ # Development
179
+ npm run dev # Watch mode with hot reload
180
+ npm run typecheck # TypeScript type checking
181
+ npm run lint # ESLint
182
+ npm run test # Run tests
183
+ npm run format # Prettier formatting
184
+
185
+ # Production
186
+ npm run build # Build TypeScript
187
+ npm run build:prod # Build with fresh documentation index
188
+ npm run index-docs # Index documentation with embeddings
189
+ ```
190
+
191
+ ### Project Structure
192
+
193
+ ```
194
+ mcmodding-mcp/
195
+ ├── src/
196
+ │ ├── index.ts # MCP server entry point
197
+ │ ├── db-versioning.ts # Auto-update system
198
+ │ ├── indexer/
199
+ │ │ ├── crawler.ts # Documentation crawler
200
+ │ │ ├── chunker.ts # Text chunking
201
+ │ │ ├── embeddings.ts # Semantic embeddings
202
+ │ │ ├── store.ts # SQLite database
203
+ │ │ └── sitemap.ts # Sitemap parsing
204
+ │ ├── services/
205
+ │ │ ├── search-service.ts # Search logic
206
+ │ │ └── concept-service.ts # Concept explanations
207
+ │ └── tools/
208
+ │ ├── searchDocs.ts # search_fabric_docs handler
209
+ │ ├── getExample.ts # get_example handler
210
+ │ └── explainConcept.ts # explain_fabric_concept handler
211
+ ├── scripts/
212
+ │ └── index-docs.ts # Documentation indexing script
213
+ ├── data/
214
+ │ ├── mcmodding-docs.db # SQLite database
215
+ │ └── db-manifest.json # Version manifest
216
+ └── dist/ # Compiled JavaScript
217
+ ```
218
+
219
+ ### Database Schema
220
+
221
+ ```sql
222
+ -- Documents: Full documentation pages
223
+ CREATE TABLE documents (
224
+ id INTEGER PRIMARY KEY,
225
+ url TEXT UNIQUE NOT NULL,
226
+ title TEXT NOT NULL,
227
+ content TEXT NOT NULL,
228
+ category TEXT NOT NULL,
229
+ loader TEXT NOT NULL, -- fabric | neoforge | shared
230
+ minecraft_version TEXT,
231
+ hash TEXT NOT NULL -- For change detection
232
+ );
233
+
234
+ -- Chunks: Searchable content units
235
+ CREATE TABLE chunks (
236
+ id TEXT PRIMARY KEY,
237
+ document_id INTEGER NOT NULL,
238
+ chunk_type TEXT NOT NULL, -- title | section | code | full
239
+ content TEXT NOT NULL,
240
+ section_heading TEXT,
241
+ code_language TEXT,
242
+ word_count INTEGER,
243
+ has_code BOOLEAN
244
+ );
245
+
246
+ -- Embeddings: Semantic search vectors
247
+ CREATE TABLE embeddings (
248
+ chunk_id TEXT PRIMARY KEY,
249
+ embedding BLOB NOT NULL, -- 384-dim Float32Array
250
+ dimension INTEGER NOT NULL,
251
+ model TEXT NOT NULL -- Xenova/all-MiniLM-L6-v2
252
+ );
253
+
254
+ -- FTS5 indexes for fast text search
255
+ CREATE VIRTUAL TABLE documents_fts USING fts5(...);
256
+ CREATE VIRTUAL TABLE chunks_fts USING fts5(...);
257
+ ```
258
+
259
+ ---
260
+
261
+ ## Release Workflow
262
+
263
+ This project uses [release-please](https://github.com/googleapis/release-please) for automated releases.
264
+
265
+ ### Branch Strategy
266
+
267
+ | Branch | Purpose |
268
+ | ------ | ------------------- |
269
+ | `dev` | Active development |
270
+ | `prod` | Production releases |
271
+
272
+ ### How It Works
273
+
274
+ 1. Push commits to `dev` using [conventional commits](https://www.conventionalcommits.org/)
275
+ 2. Release-please maintains a Release PR (`dev` → `prod`)
276
+ 3. When merged, automatic release: npm publish + GitHub release + database upload
277
+ 4. Changes sync back to `dev`
278
+
279
+ See [RELEASE_WORKFLOW.md](RELEASE_WORKFLOW.md) for complete details.
280
+
281
+ ---
282
+
283
+ ## Configuration
284
+
285
+ ### Environment Variables
286
+
287
+ | Variable | Description | Default |
288
+ | ----------------- | ----------------------- | -------------------------- |
289
+ | `DB_PATH` | Custom database path | `./data/mcmodding-docs.db` |
290
+ | `GITHUB_REPO_URL` | Custom repo for updates | Auto-detected |
291
+ | `MCP_DEBUG` | Enable debug logging | `false` |
292
+
293
+ ### Disabling Auto-Updates
294
+
295
+ Set `DB_PATH` to a custom location to manage updates manually:
296
+
297
+ ```bash
298
+ DB_PATH=/path/to/my/database.db mcmodding-mcp
299
+ ```
300
+
301
+ ---
302
+
303
+ ## Contributing
304
+
305
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
306
+
307
+ ### Quick Contribution Guide
308
+
309
+ 1. Fork the repository
310
+ 2. Create a feature branch from `dev`
311
+ 3. Make changes with conventional commits
312
+ 4. Submit a PR to `dev`
313
+
314
+ ---
315
+
316
+ ## License
317
+
318
+ MIT License - see [LICENSE](LICENSE) for details.
319
+
320
+ ---
321
+
322
+ ## Acknowledgments
323
+
324
+ - [Fabric Documentation](https://docs.fabricmc.net/) - Official Fabric documentation
325
+ - [Fabric Wiki](https://wiki.fabricmc.net/) - Community wiki
326
+ - [Model Context Protocol](https://modelcontextprotocol.io/) - MCP specification
327
+ - [Transformers.js](https://huggingface.co/docs/transformers.js) - Local ML embeddings
328
+ - [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - Fast SQLite bindings
329
+
330
+ ---
331
+
332
+ <p align="center">
333
+ <strong>Built with care for the Minecraft modding community</strong>
334
+ </p>