mcp: expose m2pack_* tools in the mcp server
Add four ToolSpec entries (m2pack_build, m2pack_verify, m2pack_diff, m2pack_export_runtime_key) mirroring the CLI argparse signatures. server.py auto-enumerates TOOL_SPECS so no wiring change needed.
This commit is contained in:
@@ -64,6 +64,7 @@ class ToolSpec:
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
_RELEASE = ("release",)
|
_RELEASE = ("release",)
|
||||||
|
_M2PACK = ("m2pack",)
|
||||||
|
|
||||||
|
|
||||||
TOOL_SPECS: tuple[ToolSpec, ...] = (
|
TOOL_SPECS: tuple[ToolSpec, ...] = (
|
||||||
@@ -164,6 +165,54 @@ TOOL_SPECS: tuple[ToolSpec, ...] = (
|
|||||||
FieldSpec("dry_run_upload", "boolean", description="rsync --dry-run for upload + promote."),
|
FieldSpec("dry_run_upload", "boolean", description="rsync --dry-run for upload + promote."),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
ToolSpec(
|
||||||
|
name="m2pack_build",
|
||||||
|
subcommand=_M2PACK + ("build",),
|
||||||
|
description="Build a signed .m2p archive from a client asset directory via m2pack-secure.",
|
||||||
|
fields=(
|
||||||
|
FieldSpec("input", "path", required=True, description="Client asset source directory."),
|
||||||
|
FieldSpec("output", "path", required=True, description="Output .m2p archive path."),
|
||||||
|
FieldSpec("key", "path", required=True, description="Master content key file."),
|
||||||
|
FieldSpec(
|
||||||
|
"sign_secret_key",
|
||||||
|
"path",
|
||||||
|
required=True,
|
||||||
|
description="Ed25519 signing secret key file.",
|
||||||
|
),
|
||||||
|
FieldSpec("key_id", "integer", description="Content key id (default 1)."),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ToolSpec(
|
||||||
|
name="m2pack_verify",
|
||||||
|
subcommand=_M2PACK + ("verify",),
|
||||||
|
description="Verify an .m2p archive's manifest signature and optionally full decrypt.",
|
||||||
|
fields=(
|
||||||
|
FieldSpec("archive", "path", required=True, description="Path to .m2p archive."),
|
||||||
|
FieldSpec("public_key", "path", description="Ed25519 public key file."),
|
||||||
|
FieldSpec("key", "path", description="Master content key file for full-decrypt verify."),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ToolSpec(
|
||||||
|
name="m2pack_diff",
|
||||||
|
subcommand=_M2PACK + ("diff",),
|
||||||
|
description="Diff two directories and/or .m2p archives (left vs right).",
|
||||||
|
fields=(
|
||||||
|
FieldSpec("left", "path", required=True, description="Left side: directory or .m2p archive."),
|
||||||
|
FieldSpec("right", "path", required=True, description="Right side: directory or .m2p archive."),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ToolSpec(
|
||||||
|
name="m2pack_export_runtime_key",
|
||||||
|
subcommand=_M2PACK + ("export-runtime-key",),
|
||||||
|
description="Export a launcher runtime-key payload (json or blob form) from master+public keys.",
|
||||||
|
fields=(
|
||||||
|
FieldSpec("key", "path", required=True, description="Master content key file."),
|
||||||
|
FieldSpec("public_key", "path", required=True, description="Ed25519 public key file."),
|
||||||
|
FieldSpec("output", "path", required=True, description="Output payload path."),
|
||||||
|
FieldSpec("key_id", "integer", description="Content key id (default 1)."),
|
||||||
|
FieldSpec("format", "string", description="Payload format: json or blob (default json)."),
|
||||||
|
),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user