5709fd9c359e4806c5874b4fe7e2f4726d8daced
m2pack-secure
CLI-first archive builder for a modern Metin2 client pack pipeline.
It is designed as a replacement for legacy EterPack tooling when you control the client source and want a format that is easier to automate and harder to tamper with.
Goals
- CLI workflow first, no GUI dependency
- deterministic manifest layout for automation
zstdcompressionXChaCha20-Poly1305authenticated encryption per fileEd25519signed manifest for tamper detection- JSON output for AI agents and automation
Current commands
m2pack keygenm2pack buildm2pack listm2pack verifym2pack extractm2pack export-client-config
MCP Server
The repository also ships a Linux-friendly MCP server that wraps the m2pack
CLI for AI agents and automation.
Files:
mcp_server.mjspackage.json
Install:
npm install
Run:
npm run mcp
If the m2pack binary is not at build/m2pack, set:
export M2PACK_BINARY=/absolute/path/to/m2pack
Exposed tools:
pack_keygenpack_buildpack_listpack_verifypack_extractpack_export_client_configpack_binary_info
Smoke test:
npm run mcp:smoke
Build
cmake -S . -B build
cmake --build build -j
Quick start
Generate a master content key and signing keypair:
./build/m2pack keygen --out-dir keys --json
Build an archive from a client asset directory:
./build/m2pack build \
--input /path/to/client/root \
--output out/client.m2p \
--key keys/master.key \
--sign-secret-key keys/signing.key \
--json
Verify the archive:
./build/m2pack verify \
--archive out/client.m2p \
--public-key keys/signing.pub \
--key keys/master.key \
--json
Extract:
./build/m2pack extract \
--archive out/client.m2p \
--output out/unpacked \
--key keys/master.key
Export a client config header for m2dev-client-src/src/PackLib/M2PackKeys.h:
./build/m2pack export-client-config \
--key keys/master.key \
--public-key keys/signing.pub \
--output /path/to/m2dev-client-src/src/PackLib/M2PackKeys.h
Format summary
- Single archive file with a fixed header
- Binary manifest near the end of the file
- Signed manifest hash in the header
- Per-file random nonce
- Per-file AEAD ciphertext, authenticated with the relative file path
See docs/format.md and docs/client-integration.md.
Description
CLI-first secure Metin2 packer with zstd, XChaCha20-Poly1305 and Ed25519-signed manifests
Languages
Python
63.7%
C++
30.6%
JavaScript
4.7%
CMake
1%