@lzimul/minecraft-mcp 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -2
- package/SECURITY.md +21 -0
- package/build/app/server.js +10 -0
- package/build/config/dimensions.js +27 -0
- package/build/config/server-info.js +25 -0
- package/build/config/world-limits.js +6 -0
- package/build/data/blocks.js +17532 -0
- package/build/data/items.js +11194 -0
- package/build/data/version.js +1 -0
- package/build/enums/bounding-box.enum.js +5 -0
- package/build/enums/dimension-type.enum.js +6 -0
- package/build/enums/icon-theme.enum.js +5 -0
- package/build/index.js +4 -0
- package/build/interfaces/block.interface.js +1 -0
- package/build/interfaces/data-entry.interface.js +1 -0
- package/build/interfaces/dimension.interface.js +1 -0
- package/build/interfaces/item.interface.js +1 -0
- package/build/interfaces/placed-block.interface.js +1 -0
- package/build/resources/block-resources.js +17 -0
- package/build/resources/data-resources.js +40 -0
- package/build/resources/dimension-resources.js +54 -0
- package/build/resources/index.js +9 -0
- package/build/resources/item-resources.js +17 -0
- package/build/schemas/block-schema.js +27 -0
- package/build/schemas/coordinate-schema.js +12 -0
- package/build/schemas/dimension-schema.js +6 -0
- package/build/schemas/item-schema.js +28 -0
- package/build/tools/block-tools.js +108 -0
- package/build/tools/index.js +6 -0
- package/build/tools/item-tools.js +43 -0
- package/build/tools/result.js +11 -0
- package/build/world/simulated-dimension.js +36 -0
- package/build/world/world-state.js +16 -0
- package/lib/app/server.d.ts +3 -0
- package/lib/app/server.d.ts.map +1 -0
- package/lib/config/dimensions.d.ts +3 -0
- package/lib/config/dimensions.d.ts.map +1 -0
- package/lib/config/server-info.d.ts +15 -0
- package/lib/config/server-info.d.ts.map +1 -0
- package/lib/config/world-limits.d.ts +7 -0
- package/lib/config/world-limits.d.ts.map +1 -0
- package/lib/data/blocks.d.ts +5 -0
- package/lib/data/blocks.d.ts.map +1 -0
- package/lib/data/items.d.ts +5 -0
- package/lib/data/items.d.ts.map +1 -0
- package/lib/data/version.d.ts +2 -0
- package/lib/data/version.d.ts.map +1 -0
- package/lib/enums/bounding-box.enum.d.ts +5 -0
- package/lib/enums/bounding-box.enum.d.ts.map +1 -0
- package/lib/enums/dimension-type.enum.d.ts +6 -0
- package/lib/enums/dimension-type.enum.d.ts.map +1 -0
- package/lib/enums/icon-theme.enum.d.ts +5 -0
- package/lib/enums/icon-theme.enum.d.ts.map +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/interfaces/block.interface.d.ts +14 -0
- package/lib/interfaces/block.interface.d.ts.map +1 -0
- package/lib/interfaces/data-entry.interface.d.ts +7 -0
- package/lib/interfaces/data-entry.interface.d.ts.map +1 -0
- package/lib/interfaces/dimension.interface.d.ts +10 -0
- package/lib/interfaces/dimension.interface.d.ts.map +1 -0
- package/lib/interfaces/item.interface.d.ts +8 -0
- package/lib/interfaces/item.interface.d.ts.map +1 -0
- package/lib/interfaces/placed-block.interface.d.ts +8 -0
- package/lib/interfaces/placed-block.interface.d.ts.map +1 -0
- package/lib/resources/block-resources.d.ts +3 -0
- package/lib/resources/block-resources.d.ts.map +1 -0
- package/lib/resources/data-resources.d.ts +21 -0
- package/lib/resources/data-resources.d.ts.map +1 -0
- package/lib/resources/dimension-resources.d.ts +4 -0
- package/lib/resources/dimension-resources.d.ts.map +1 -0
- package/lib/resources/index.d.ts +3 -0
- package/lib/resources/index.d.ts.map +1 -0
- package/lib/resources/item-resources.d.ts +3 -0
- package/lib/resources/item-resources.d.ts.map +1 -0
- package/lib/schemas/block-schema.d.ts +20 -0
- package/lib/schemas/block-schema.d.ts.map +1 -0
- package/lib/schemas/coordinate-schema.d.ts +4 -0
- package/lib/schemas/coordinate-schema.d.ts.map +1 -0
- package/lib/schemas/dimension-schema.d.ts +7 -0
- package/lib/schemas/dimension-schema.d.ts.map +1 -0
- package/lib/schemas/item-schema.d.ts +17 -0
- package/lib/schemas/item-schema.d.ts.map +1 -0
- package/lib/tools/block-tools.d.ts +3 -0
- package/lib/tools/block-tools.d.ts.map +1 -0
- package/lib/tools/index.d.ts +3 -0
- package/lib/tools/index.d.ts.map +1 -0
- package/lib/tools/item-tools.d.ts +3 -0
- package/lib/tools/item-tools.d.ts.map +1 -0
- package/lib/tools/result.d.ts +18 -0
- package/lib/tools/result.d.ts.map +1 -0
- package/lib/world/simulated-dimension.d.ts +14 -0
- package/lib/world/simulated-dimension.d.ts.map +1 -0
- package/lib/world/world-state.d.ts +6 -0
- package/lib/world/world-state.d.ts.map +1 -0
- package/package.json +103 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2020-2030] [lZiMUl]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,75 @@
|
|
|
1
|
-
#
|
|
1
|
+
# lZiMUl Minecraft MCP
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Minecraft Model Context Protocol (MCP) server. It exposes the complete Minecraft registry (Java Edition data) as MCP resources and provides tools to read and write blocks in simulated dimensions.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- All Minecraft blocks and items exposed as MCP resources with full properties (name, hardness, blast resistance, durability, enchantment categories, light level, collision box, and more)
|
|
8
|
+
- Block lookup and placement tools backed by simulated dimensions (Overworld, The Nether, The End), each with its own isolated world state and height range
|
|
9
|
+
- Structured tool output (`outputSchema` / `structuredContent`) plus human readable text
|
|
10
|
+
- Tool annotations for safe client automation
|
|
11
|
+
|
|
12
|
+
## Tools
|
|
13
|
+
|
|
14
|
+
| Tool | Description |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| `getBlock` | Get the block at coordinates in a dimension (defaults to `overworld`) |
|
|
17
|
+
| `setBlock` | Place a block at coordinates in a dimension and return the replaced block |
|
|
18
|
+
| `getItem` | Look up item properties by id (`minecraft:diamond_sword` or `diamond_sword`) |
|
|
19
|
+
|
|
20
|
+
## Resources
|
|
21
|
+
|
|
22
|
+
| URI | Description |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `lzimul://minecraft/blocks` | Block index |
|
|
25
|
+
| `lzimul://minecraft/blocks/{name}` | Single block properties |
|
|
26
|
+
| `lzimul://minecraft/items` | Item index |
|
|
27
|
+
| `lzimul://minecraft/items/{name}` | Single item properties |
|
|
28
|
+
| `lzimul://minecraft/dimensions` | Simulated dimension index with world state |
|
|
29
|
+
| `lzimul://minecraft/dimensions/{type}` | Single dimension state including placed blocks |
|
|
30
|
+
|
|
31
|
+
## Project Structure
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
src/
|
|
35
|
+
index.ts Entry point
|
|
36
|
+
app/ Server assembly
|
|
37
|
+
config/ Server metadata, dimensions, world limits
|
|
38
|
+
data/ Generated registry data (blocks, items, version)
|
|
39
|
+
enums/ Enumerations (EBoundingBox, EIconTheme, EDimensionType)
|
|
40
|
+
interfaces/ Interfaces (IBlock, IItem, IDimension, IPlacedBlock, IDataEntry)
|
|
41
|
+
resources/ Resource registration
|
|
42
|
+
schemas/ Zod schemas and converters
|
|
43
|
+
tools/ Tool registration
|
|
44
|
+
world/ Simulated dimension world state
|
|
45
|
+
scripts/
|
|
46
|
+
generate-data.mjs Regenerates src/data from minecraft-data
|
|
47
|
+
smoke-test.mjs End-to-end smoke test
|
|
48
|
+
clean.mjs Removes build output
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Scripts
|
|
52
|
+
|
|
53
|
+
| Command | Description |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `npm run build` | Lint, compile and generate API docs |
|
|
56
|
+
| `npm run dev` | Build then start the server |
|
|
57
|
+
| `npm start` | Start the server (stdio) |
|
|
58
|
+
| `npm test` | Run the end-to-end smoke test |
|
|
59
|
+
| `npm run generate-data` | Regenerate registry data (see below) |
|
|
60
|
+
| `npm run clean` | Remove build output |
|
|
61
|
+
| `npm run lint` | Lint and auto-fix |
|
|
62
|
+
|
|
63
|
+
## Data
|
|
64
|
+
|
|
65
|
+
Registry data is generated from [PrismarineJS/minecraft-data](https://github.com/PrismarineJS/minecraft-data). To regenerate for a specific version:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
node scripts/generate-data.mjs <version> [blocks.json] [items.json]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
When local JSON files are provided they are used directly, otherwise the data is fetched from GitHub. The data version is exported as `MINECRAFT_DATA_VERSION` and used in all descriptions.
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
MIT
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
Use this section to tell people about which versions of your project are
|
|
6
|
+
currently being supported with security updates.
|
|
7
|
+
|
|
8
|
+
| Version | Supported |
|
|
9
|
+
|---------|--------------------|
|
|
10
|
+
| 5.1.x | :white_check_mark: |
|
|
11
|
+
| 5.0.x | :x: |
|
|
12
|
+
| 4.0.x | :white_check_mark: |
|
|
13
|
+
| < 4.0 | :x: |
|
|
14
|
+
|
|
15
|
+
## Reporting a Vulnerability
|
|
16
|
+
|
|
17
|
+
Use this section to tell people how to report a vulnerability.
|
|
18
|
+
|
|
19
|
+
Tell them where to go, how often they can expect to get an update on a
|
|
20
|
+
reported vulnerability, what to expect if the vulnerability is accepted or
|
|
21
|
+
declined, etc.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import { SERVER_INFO } from '../config/server-info.js';
|
|
3
|
+
import { registerResources } from '../resources/index.js';
|
|
4
|
+
import { registerTools } from '../tools/index.js';
|
|
5
|
+
export function createServer() {
|
|
6
|
+
const server = new McpServer(SERVER_INFO);
|
|
7
|
+
registerTools(server);
|
|
8
|
+
registerResources(server);
|
|
9
|
+
return server;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EDimensionType } from '../enums/dimension-type.enum.js';
|
|
2
|
+
export const DIMENSIONS = [
|
|
3
|
+
{
|
|
4
|
+
key: 'minecraft:overworld',
|
|
5
|
+
type: EDimensionType.Overworld,
|
|
6
|
+
displayName: 'Overworld',
|
|
7
|
+
minY: -64,
|
|
8
|
+
maxY: 320,
|
|
9
|
+
hasSkylight: true
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
key: 'minecraft:the_nether',
|
|
13
|
+
type: EDimensionType.TheNether,
|
|
14
|
+
displayName: 'The Nether',
|
|
15
|
+
minY: 0,
|
|
16
|
+
maxY: 256,
|
|
17
|
+
hasSkylight: false
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
key: 'minecraft:the_end',
|
|
21
|
+
type: EDimensionType.TheEnd,
|
|
22
|
+
displayName: 'The End',
|
|
23
|
+
minY: 0,
|
|
24
|
+
maxY: 256,
|
|
25
|
+
hasSkylight: false
|
|
26
|
+
}
|
|
27
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { MINECRAFT_BLOCK_COUNT } from '../data/blocks.js';
|
|
2
|
+
import { MINECRAFT_ITEM_COUNT } from '../data/items.js';
|
|
3
|
+
import { MINECRAFT_DATA_VERSION } from '../data/version.js';
|
|
4
|
+
import { EIconTheme } from '../enums/icon-theme.enum.js';
|
|
5
|
+
export const SERVER_INFO = {
|
|
6
|
+
name: 'lzimul',
|
|
7
|
+
title: 'lZiMUl Minecraft MCP',
|
|
8
|
+
description: `Minecraft Model Context Protocol server (Java Edition ${MINECRAFT_DATA_VERSION}): exposes all ${MINECRAFT_BLOCK_COUNT} blocks and ${MINECRAFT_ITEM_COUNT} items with their properties (name, hardness, blast resistance, durability, enchantment categories, etc.) as resources, plus tools to get and place blocks and look up items.`,
|
|
9
|
+
version: '1.0.0',
|
|
10
|
+
websiteUrl: 'https://mcp.lzimul.com/lZiMUl',
|
|
11
|
+
icons: [
|
|
12
|
+
{
|
|
13
|
+
src: 'https://i1.hdslb.com/bfs/face/79fbb5635ff6e50fe2699c518af82162523e5f08.jpg',
|
|
14
|
+
mimeType: 'image/jpeg',
|
|
15
|
+
sizes: ['48x48', '96x96', '192x192'],
|
|
16
|
+
theme: EIconTheme.Light
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
src: 'https://i1.hdslb.com/bfs/face/79fbb5635ff6e50fe2699c518af82162523e5f08.jpg',
|
|
20
|
+
mimeType: 'image/jpeg',
|
|
21
|
+
sizes: ['48x48', '96x96', '192x192'],
|
|
22
|
+
theme: EIconTheme.Dark
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
};
|