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 分