python setup.py
脚本会自动:
如果尚未安装Python,请访问 python.org 下载并安装 Python 3.11+。
注意:安装时请勾选 “Add Python to PATH”。
pip install websockets pyyaml cryptography
或使用国内镜像加速:
pip install websockets pyyaml cryptography -i https://pypi.tuna.tsinghua.edu.cn/simple
python check_project_integrity.py
预期输出:
Result: 9/9 checks passed
Status: ALL CHECKS PASSED
适用于个人测试和开发:
python start.py
服务将启动在:
0.0.0.0:8080127.0.0.1:19132适用于生产环境:
config.yaml 配置:server:
mnw_host: "0.0.0.0"
mnw_port: 8080
mc_host: "your-mc-server-ip"
mc_port: 19132
max_clients: 100
使用进程管理器(如pm2、systemd)保持服务运行
配置防火墙允许端口访问
MnMCP/
├── run.bat # Windows启动脚本
├── start.py # Python启动脚本
├── setup.py # 安装脚本
├── config.yaml # 配置文件
├── requirements.txt # 依赖列表
├── src/ # 源代码
│ ├── core/ # 核心模块
│ ├── crypto/ # 加密模块
│ ├── protocol/ # 协议模块
│ └── utils/ # 工具模块
├── tests/ # 测试文件
├── data/ # 数据文件
└── docs/ # 文档
A: 使用国内镜像:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
A: 编辑 config.yaml 修改端口号:
server:
mnw_port: 8081 # 修改为其他端口
A: 确保安装 Python 3.11+。可以使用 install_python.py 自动安装。
安装完成后,请参阅 使用指南 了解如何启动服务并连接游戏。