Skip to content

CoFuture/MC-Agent-Kit

Repository files navigation

MC-Agent-Kit

CI/CD PyPI version Python 3.13 License: MIT

Toolsets and Skills to empower AI Agents for Minecraft ModSDK development.

English | 中文文档

Features

  • 🎮 Game Launcher - Launch Minecraft with custom Addons without MC Studio
  • 📊 Log Capture & Analysis - Real-time log capture with intelligent error detection
  • 🧠 Knowledge Base - Semantic search through ModSDK documentation
  • 🤖 Code Generation - AI-powered code generation for events, APIs, entities, items
  • 🔧 Code Completion - Intelligent code completion with best practices checking
  • 🐛 Auto-Fix - Automatic error diagnosis and fix suggestions
  • Performance Optimization - Caching and batch processing for faster operations

Installation

From PyPI

pip install mc-agent-kit

From Source

git clone https://github.com/your-username/mc-agent-kit.git
cd mc-agent-kit
uv sync

With Optional Dependencies

# For knowledge base features
pip install mc-agent-kit[knowledge]

# For development
pip install mc-agent-kit[dev]

# For everything
pip install mc-agent-kit[all]

Quick Start

CLI Usage

# Launch game with addon
mc-agent launch --addon-path ./my_addon

# Capture and analyze logs
mc-agent logs --analyze

# Generate code from templates
mc-agent generate event_listener --event OnServerChat

# Search documentation
mc-agent search "如何创建自定义实体"

Python API

from mc_agent_kit import (
    GameLauncher,
    LogCapture,
    KnowledgeBase,
    CodeGenerator,
)

# Launch game
launcher = GameLauncher(game_path="C:/Games/Minecraft")
launcher.launch_addon("./my_addon")

# Capture logs
capture = LogCapture()
capture.start()
# ... game runs ...
logs = capture.get_logs()

# Search knowledge base
kb = KnowledgeBase("./docs")
kb.build_index()
results = kb.search("创建实体")

# Generate code
generator = CodeGenerator()
code = generator.generate_from_template(
    "event_listener",
    {"event_name": "OnServerChat"}
)

OpenClaw Skills

MC-Agent-Kit includes OpenClaw Skills for AI agent integration:

  • modsdk-api-search - Search ModSDK API documentation
  • modsdk-event-search - Search event documentation
  • modsdk-code-gen - Generate ModSDK code
  • modsdk-debug - Debug and analyze errors
  • modsdk-game-executor - Execute code in-game
  • modsdk-log-analyzer - Analyze game logs
  • modsdk-autofix - Auto-fix common errors

See skills/ directory for skill documentation.

Documentation

Examples

Check the examples/ directory for sample projects:

  • hello-world - Basic addon structure
  • custom-entity - Custom entity creation
  • custom-item - Custom item creation
  • custom-ui - UI development

Development

Setup

# Clone repository
git clone https://github.com/your-username/mc-agent-kit.git
cd mc-agent-kit

# Install dev dependencies
uv sync --extra dev

# Run tests
uv run pytest

# Run linting
uv run ruff check src/

Project Structure

MC-Agent-Kit/
├── docs/                    # Documentation
├── examples/                # Example projects
├── skills/                  # OpenClaw Skills
├── src/
│   ├── mc_agent_kit/       # Main package
│   │   ├── launcher/       # Game launcher
│   │   ├── log_capture/    # Log capture
│   │   ├── knowledge/      # Knowledge base
│   │   ├── retrieval/      # Search & retrieval
│   │   ├── generator/      # Code generation
│   │   ├── execution/      # Code execution
│   │   ├── completion/     # Code completion
│   │   ├── autofix/        # Auto-fix
│   │   ├── performance/    # Optimization
│   │   └── skills/         # Agent skills
│   └── tests/              # Test suite
├── .github/workflows/      # CI/CD
├── pyproject.toml          # Project config
└── README.md               # This file

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see LICENSE for details.

Acknowledgments

  • NetEase Minecraft ModSDK documentation
  • OpenClaw framework for AI agent skills
  • All contributors and users

Roadmap

See ROADMAP.md for planned features and releases.


Made with ❤️ for Minecraft ModSDK developers

About

Toolsets and Skills to Empower AI Agent for the development of Minecraft mods

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages