mc-modpack-mcp

mc-modpack-mcp

MCP server for Minecraft modpack diagnostics, enabling mod conflict detection, log/crash analysis, and dependency lookup via Modrinth.

Category
访问服务器

README

mc-modpack-mcp

MCP (Model Context Protocol) server for Minecraft modpack diagnostics. Supports Fabric/Forge mod conflict detection, log analysis, crash reports, and AI-powered intelligent diagnosis. Core diagnostic engine is fully offline; optional AI analysis uses China-based DashScope (通义千问) API. get_java_versions requires PCL launcher on Windows; all other tools work cross-platform.

Features

  • Java version detection — reads PCL config to list all available Java runtimes with version recommendations
  • Version info — parses instance JSON to extract Minecraft version, loader, Java requirements, JVM args
  • Conflict detection — finds known problematic mod combinations from an external rules.json (easily extensible)
  • Cleanliness scan — detects non-JAR files, source jars, scripts in mods/ directory
  • Log analysis — reads latest.log with level filtering (INFO/WARN/ERROR) and keyword search
  • Crash report analysis — finds crash reports, classifies errors, and suggests fixes automatically
  • Dependency lookup — queries Modrinth API for mod version and dependency info
  • Human-readable output — all tools return friendly text with emojis and 💡 tips, plus JSON below --- JSON ---
  • CLI mode — run npm run diagnose for an interactive terminal-based diagnosis (no MCP needed)
  • External rules engine — edit src/rules.json to add new conflicts, crash patterns, or Java version ranges without touching code

Tools

Tool Description
get_java_versions List all Java runtimes from PCL config
get_version_info Read instance metadata (version, loader, Java, JVM args, mod count)
list_mods Scan mods/ directory, optionally filter by regex
detect_conflicts Detect known mod conflicts with auto-replacement recommendations
scan_cleanliness Find non-JAR files, source jars, scripts in mods/
read_log Read latest.log with level/keyword/tail filtering
find_crash_reports List all crash reports in crash-reports/
analyze_crash Parse a crash report, extract exception type and summary
check_mod_dependencies Query Modrinth API for mod deps and compatibility
get_replacement_recommendations Get replacement mod suggestions for known conflicts
ai_diagnose 🤖 AI-powered full diagnostics report using 通义千问 (requires DASHSCOPE_API_KEY)

Installation

Prerequisites

  • Node.js 18+
  • npm
  • A Minecraft instance (any launcher — macOS/Linux users must pass mc_dir explicitly for all tools)

Note: get_java_versions reads PCL launcher config and works on Windows only. All other tools are cross-platform.

Build

cd mc-modpack-mcp
npm install
npm run build

Run as standalone MCP server

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 (e.g., .mcp.json or equivalent):

{
  "mcpServers": {
    "mc-modpack": {
      "command": "node",
      "args": ["/absolute/path/to/mc-modpack-mcp/dist/index.js"]
    }
  }
}

Usage Examples

Get Java versions from PCL

{
  "name": "get_java_versions",
  "arguments": {
    "mc_dir": "{your_minecraft_directory}"
  }
}

Detect conflicts in an instance

{
  "name": "detect_conflicts",
  "arguments": {
    "mc_dir": "{your_minecraft_directory}",
    "instance_id": "rpg"
  }
}

Read WARN logs (last 50 lines)

{
  "name": "read_log",
  "arguments": {
    "mc_dir": "{your_minecraft_directory}",
    "instance_id": "rpg",
    "level": "WARN",
    "tail": 50
  }
}

Check mod dependencies via Modrinth

{
  "name": "check_mod_dependencies",
  "arguments": {
    "project_id": "sodium",
    "mc_version": "1.20.1",
    "loader": "fabric"
  }
}

Architecture

mc-modpack-mcp/
├── src/
│   └── index.ts        # All tool implementations + MCP server setup
├── dist/               # Compiled JavaScript (output of tsc)
├── skills/
│   └── mc-modpack-helper/
│       └── SKILL.md    # Trae Work skill for modpack diagnostics
├── package.json        # Node.js dependencies (@modelcontextprotocol/sdk, zod)
├── tsconfig.json       # TypeScript config (CommonJS output)
├── .gitignore
├── test.js             # Integration test runner
├── test_logs/          # Test output logs (gitignored)
└── backups/            # Backup snapshots from tests (gitignored)

The MCP uses the official @modelcontextprotocol/sdk v1.x with McpServer and StdioServerTransport. All tools use server.tool() registration pattern compatible with the MCP SDK specification.

AI Module (src/ai.ts)

ai_diagnose 工具使用独立模块封装通义千问 API,提供:

  • callQwen(prompt) — 调用 Qwen 模型生成报告
  • buildDiagnosePrompt(data) — 构建诊断 prompt,整合所有结构化数据

Skills

This repository also includes a Trae Work skill for modpack diagnostics. After cloning, copy the skill to your Trae Work skills directory:

Windows (PowerShell):

copy skills\mc-modpack-helper\SKILL.md "$env:USERPROFILE\.trae\skills\mc-modpack-helper\SKILL.md"

macOS / Linux:

mkdir -p ~/.trae/skills/mc-modpack-helper
cp skills/mc-modpack-helper/SKILL.md ~/.trae/skills/mc-modpack-helper/SKILL.md

See SKILL.md for the full skill documentation with 8-phase diagnostic workflow.

Testing

npm run build
MC_DIR=/path/to/your/.minecraft node test.js

Or on Windows (PowerShell):

$env:MC_DIR="C:\path\to\your\.minecraft"; node test.js

Tests create backups before running and log results to test_logs/. See individual test log files for detailed output.

Platform Compatibility

Tool Windows macOS Linux
get_java_versions ✅ Full ⚠️ PCL-only ⚠️ PCL-only
get_version_info ✅ ✅ ✅
list_mods ✅ ✅ ✅
detect_conflicts ✅ ✅ ✅
scan_cleanliness ✅ ✅ ✅
read_log ✅ ✅ ✅
find_crash_reports ✅ ✅ ✅
analyze_crash ✅ ✅ ✅
check_mod_dependencies ✅ ✅ ✅

All tools accept mc_dir as an explicit path. get_java_versions auto-detects PCL on Windows; on other platforms it returns a clear message when PCL config is absent.

Using the Rules Engine

All conflict rules, Java version mappings, and crash analysis patterns live in src/rules.json. You can customize them without modifying source code:

{
  "conflicts": [
    {
      "id": "my-custom-conflict",
      "name": "My Custom Conflict",
      "patterns": ["mod-a", "mod-b"],
      "severity": "error",
      "solution": "Install only one of these mods.",
      "emoji": "🔴"
    }
  ],
  "javaVersionMap": [
    { "mcFrom": "1.20.5", "mcTo": "1.20.6", "minJava": 17, "recommendedJava": 21, "notes": "..." }
  ],
  "crashAnalysisPatterns": [
    { "keywords": ["my-error-pattern"], "category": "custom", "solution": "Do something about it." }
  ]
}
Section Purpose
conflicts Mod conflict detection rules
javaVersionMap Minecraft → Java version compatibility
crashAnalysisPatterns Crash report classification and fix suggestions

CLI Usage

Run a quick interactive diagnosis without setting up MCP:

npm run diagnose
# or
MC_DIR=/path/to/.minecraft npm run diagnose

The CLI will:

  1. Auto-detect your Minecraft instance
  2. Check Java runtimes (PCL on Windows)
  3. Scan for mod conflicts
  4. Check directory cleanliness
  5. Review crash reports

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选