Skip to main content
Glama
ZTUmber

datapack-check-mcp

by ZTUmber

datapack-check-mcp

Spyglass 语言服务器检查 Minecraft Java 版数据包,通过 MCP stdio 把诊断交给任意 MCP 客户端。

工具

工具

作用

check_file

检查单个 .mcfunction / 数据包 JSON / .mcmeta / .snbt / .mcdoc

check_project

检查工作区下全部数据包文件

返回 JSON:pathlinecolumnseveritymessageok 在没有 error 且分析未被取消时为 true

静态检查语法、JSON schema、引用/ID。

Related MCP server: Datapack MCP Server

要求

  • Node.js 20+

  • 第一次检查会下载原版数据包缓存,可能要几分钟

安装

cd D:\c\datapack-check-mcp
npm install
npm run build

任意支持 MCP stdio 的客户端按下面启动即可(配置字段名因客户端而异):

{
  "command": "node",
  "args": ["D:/datapack-check-mcp/dist/index.js"],
  "env": {
    "DATAPACK_WORKSPACE": "D:/path/to/your-datapack-or-workspace"
  }
}

DATAPACK_WORKSPACE 应指向带 pack.mcmeta 的包根,或包含多个包的父目录。不设的话:check_file 会从文件向上找 pack.mcmetacheck_project 用传入的 root 或进程 cwd。

命令行(不经过 MCP)

node dist/index.js --check-file test/fixture-pack/data/demo/function/bad.mcfunction
node dist/index.js --check-project test/fixture-pack

有 error 时退出码为 2

Agent Skill

skills/datapack-check/SKILL.md 规定何时调用本 MCP。把它复制到所用 Agent 的 skills 目录后,写数据包时会走检查流程。

环境变量

变量

默认

含义

DATAPACK_WORKSPACE

(推断)

Spyglass 工作区根

DATAPACK_CHECK_READY_TIMEOUT_MS

180000

等 Spyglass 就绪(含首次缓存)

DATAPACK_CHECK_FILE_TIMEOUT_MS

8000

CLI check_file 等诊断;MCP 的 check_file 在工具预算内等待,超时返回 incomplete 而不是报错

DATAPACK_CHECK_PROJECT_TIMEOUT_MS

600000

check_project 整包分析等待上限(随文件数放大,封顶 10 分钟)

DATAPACK_CHECK_LOCALE

en

Spyglass 诊断语言

Available Tools

2 tools
check_fileCheck datapack fileA

Run Spyglass (Datapack Helper Plus engine) diagnostics on one Minecraft datapack file (.mcfunction, pack JSON, .mcmeta, .snbt, .mcdoc). Returns path/line/severity/message.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or relative path to the datapack file

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full behavioral burden. It conveys that this is a diagnostic/read-only style operation and discloses the result shape (path/line/severity/error message), which is especially valuable since there is no output schema. It does not mention error handling or side-effect caveats, but it is transparent about what the tool does and returns.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with no filler. It front-loads the main action, then compactly specifies target file types and return fields, so every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter tool with no output schema and no annotations, the description covers the essential invocation details: what input is expected, what file types are supported, and what the tool returns. It lacks an explicit comparison to check_project, but the description's single-file scope makes the intended use clear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already fully documents the single path parameter, so the baseline is 3. The description adds meaning beyond the schema by specifying which file types are valid targets, which enriches an otherwise generic 'path' string.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Run Spyglass diagnostics on one Minecraft datapack file') and lists supported file types. The 'one ... file' framing clearly distinguishes it from the sibling project-level check_project.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly scopes the tool to a single file rather than a whole project, giving an agent the key context for when to invoke it. It does not explicitly name check_project as the alternative or state exclusions, so it falls just short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check_projectCheck datapack projectA

Run Spyglass (Datapack Helper Plus engine) on every .mcfunction, pack JSON, .mcmeta, .snbt, and .mcdoc file under a datapack workspace. Pass the pack root (folder with pack.mcmeta) or a parent folder. First run may download the vanilla cache and take a few minutes.

ParametersJSON Schema
NameRequiredDescriptionDefault
rootNoDatapack or workspace root. Defaults to DATAPACK_WORKSPACE or the current working directory.

TDQS

A4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full behavioral burden. It only discloses that the first run may download a cache and take time. It does not state whether the tool is read-only, modifies files, requires specific permissions, or what side effects result. This is a significant gap for an agent deciding whether to invoke it.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with zero waste. The main purpose is front-loaded, followed by specific parameter guidance and a behavioral warning. It is efficient and easy to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

It covers what, how, and a caveat about first-run performance, but lacks information about the output format or what the agent should expect in the response (e.g., a report, exit code). For a tool with no annotations and no output schema, this is a notable omission.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description for 'root' has 100% coverage and is clear ('Datapack or workspace root. Defaults to...'), and the tool description adds extra context ('folder with pack.mcmeta or a parent folder'). This fully clarifies what to pass and its optionality.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Run Spyglass') on a specific resource ('every .mcfunction, pack JSON, .mcmeta, .snbt, and .mcdoc file') with a scope ('under a datapack workspace'). This clearly distinguishes it from a sibling like check_file, which focuses on a single file. The purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: it tells the agent what to pass ('the pack root... or a parent folder') and implies it is for whole-project checking rather than single files. However, it does not explicitly state when NOT to use it or name the sibling alternative, leaving that to inference from the name.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 2 tool updatesv0.1.0
    • First observedcheck_file
    • First observedcheck_project

TDQS

A4.3/5.0

Scored across 2 tools

Disambiguation5/5

The two tools are clearly distinct in scope: one checks a single file, the other checks an entire project workspace. There is no overlap or ambiguity about which tool to use for a given task.

Naming Consistency5/5

Both tools follow a consistent 'check_' verb-noun pattern, with 'file' and 'project' clarifying the target. The naming is predictable and uniform.

Tool Count4/5

The server has only 2 tools, which is below the typical 3-15 range, but the narrow purpose of checking datapack files is well-served by a file-level and a project-level check. The count is slightly thin but reasonable for the scope.

Completeness5/5

The domain is linting/diagnostics for datapack files. The server covers both individual file checks and whole-project scans, which are the only two granularities needed. No obvious operations are missing for the stated purpose.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers