Mc Mod Config

io.github.dcd887由 GitHub 账号 dcd887 发布v1.0.0更新于 Oct 24, 2026

读写 Minecraft 模组配置文件(TOML/JSON),带 schema 校验

已验证STDIO仅桌面文件与存储开发者工具

概览

AI 生成的概览

本地 MCP 服务器,让助手读取、校验、对比并清理 Minecraft 模组配置文件(.cfg、.toml、.json)。

可以做什么
  • 解析单个模组配置文件,返回结构化数据及发现的问题
  • 递归扫描配置目录,列出各配置的模组 ID、格式与大小
  • 校验全部配置中的空值、非法数字、解析错误与超长字符串
  • 对比两个配置目录,报告整合包更新前后新增、删除与变更的文件
  • 找出 mods 目录中已无对应模组 JAR 的孤立配置文件
  • 返回 Sodium、OptiFine、Phosphor、Lithium、Fabric API 等热门性能模组的内置默认配置
适用场景
适合维护或排查 Minecraft 整合包时使用:定位模组异常、更新后审查配置变化、清理残留配置文件。它是面向整合包作者与玩家的专用离线工具,而非通用工具。
运行要求
以 npm 包 mc-mod-config-mcp 形式通过 stdio 在本机运行,需要 Node.js 18+ 与 npm;README 说明需先构建,并在客户端配置中以绝对路径指向编译后的入口文件。无需账号、API 密钥或网络;可选环境变量 MOD_CONFIG_EXTENSIONS、MOD_CONFIG_MAX_FILE_MB、MOD_CONFIG_MAX_STRING_LEN 可覆盖内置默认值。
安装前请注意
工具会读取你指定路径下的配置文件,请只指向你愿意暴露的整合包目录。README 将其描述为无网络调用的只读分析,但未说明具备写入或删除能力,因此不要假定它能自动修复配置。配置内容会作为工具输出传给助手。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mc Mod Config,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mc-mod-config-mcp

[M8ven Verified]

MCP server for Minecraft mod configuration file management. Reads, validates, compares, and cleans up .cfg, .toml, and .json config files from modpacks.

Tools

ToolDescription
read_mod_configParse a single config file (.cfg, .toml, .json) and return structured data with any issues
list_mod_configsRecursively scan a config directory and list all configs with mod ID, format, and size
validate_mod_configsValidate all configs for common issues: empty values, invalid numbers, parse errors, oversized strings
compare_mod_configsDiff two config directories (before/after modpack update) and report added/removed/changed files
find_orphaned_configsFind config files whose mod JAR is no longer present in the mods/ directory
get_mod_default_configReturn known default/baseline config for popular mods (Sodium, OptiFine, Phosphor, Lithium, Fabric API)

Supported Config Formats

FormatExtensionLoader
Forge INI-style.cfgForge
Fabric TOML.tomlFabric
JSON.jsonAny

Features

  • Multi-format parsing — handles Forge .cfg, Fabric .toml, and .json configs natively
  • Validation engine — detects empty values, invalid numbers, parse errors, and oversized strings
  • Config comparison — key-level diff for tracking changes across modpack updates
  • Orphan detection — matches config files against installed mod JARs plus a built-in known-mods database
  • Default configs — bundled known-good defaults for popular performance mods
  • Fully offline — no network calls; all data is local or built-in

Installation

Prerequisites

  • Node.js 18+
  • npm

Build

bash
cd mc-mod-config-mcpnpm installnpm run build

Run as standalone MCP server

bash
node dist/index.js

The server communicates via stdio (JSON-RPC 2.0). It can be consumed by any MCP-compatible client.

Configuration for MCP clients

Add to your MCP client config:

json
{  "mcpServers": {    "mc-mod-config": {      "command": "node",      "args": ["${MC_MOD_CONFIG_ROOT}/dist/index.js"]    }  }}

Path note: Replace ${MC_MOD_CONFIG_ROOT} with the absolute path to this project's root directory. On Windows, use forward slashes: ["C:/path/to/mc-mod-config-mcp/dist/index.js"](把 C:/path/to/ 替换成你的实际路径)。 Alternatively, set an environment variable MC_MOD_CONFIG_ROOT pointing to the project root and use the variable in the config.

Configuration

本工具零配置即可用(内置默认值,任何环境开箱即用)。以下项目可通过环境变量或项目根目录 .env 文件覆盖(复制 .env.example 为 .env):

变量默认值说明
MOD_CONFIG_EXTENSIONScfg,toml,json支持扫描/解析的配置文件扩展名(逗号分隔,可扩展自定义扩展名)
MOD_CONFIG_MAX_FILE_MB50单个配置文件大小上限(MB),超过则跳过
MOD_CONFIG_MAX_STRING_LEN500校验时字符串值长度告警阈值

扩展已知模组默认配置库:编辑 src/mod-defaults.json(构建后为 dist/mod-defaults.json),在 defaults 下新增/覆盖模组即可,无需改代码。例如新增 "iris": { "name": "Iris", "fallbackConfig": { "enableShaders": true } }。

优先级:环境变量 > .env 文件 > 内置默认值。改动后重启 MCP server 生效。

Usage Examples

Read a config file

json
{  "name": "read_mod_config",  "arguments": {    "configPath": "/path/to/mods/sodium/sodium.toml"  }}

List all configs in a modpack

json
{  "name": "list_mod_configs",  "arguments": {    "configDir": "/path/to/modpack/config"  }}

Validate configs for issues

json
{  "name": "validate_mod_configs",  "arguments": {    "configDir": "/path/to/modpack/config"  }}

Compare configs before and after an update

json
{  "name": "compare_mod_configs",  "arguments": {    "oldConfigDir": "/path/to/old-modpack/config",    "newConfigDir": "/path/to/new-modpack/config"  }}

Find orphaned configs

json
{  "name": "find_orphaned_configs",  "arguments": {    "modsDir": "/path/to/modpack/mods",    "configDir": "/path/to/modpack/config"  }}

Get default config for a mod

json
{  "name": "get_mod_default_config",  "arguments": {    "modId": "sodium"  }}

Architecture

mc-mod-config-mcp/├── src/│   └── index.ts        # MCP server + all tool implementations├── dist/               # Compiled JavaScript (output of tsc)├── skills/│   └── mc-mod-config-helper.md  # Trae Work skill for config management├── __tests__/│   └── unit.test.ts    # Unit tests (fully offline)├── package.json        # Node.js dependencies (@modelcontextprotocol/sdk, zod)├── tsconfig.json       # TypeScript config (CommonJS output)└── .gitignore

The MCP uses the official @modelcontextprotocol/sdk v1.x with McpServer and StdioServerTransport.

Testing

bash
npm run buildnpm test

All unit tests are fully offline and do not require a Minecraft installation.

Platform Compatibility

ToolWindowsmacOSLinux
read_mod_config✅✅✅
list_mod_configs✅✅✅
validate_mod_configs✅✅✅
compare_mod_configs✅✅✅
find_orphaned_configs✅✅✅
get_mod_default_config✅✅✅

All tools use cross-platform Node.js fs and path APIs. All paths are resolved as absolute paths before processing. The Forge .cfg parser handles sections, type detection, and quoted values; the Fabric .toml parser handles nested tables and arrays.

License

MIT

来源:README.md,提交 365d450

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

1
  1. v1.0.0最新Oct 23, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分