You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLI.md
+2-68Lines changed: 2 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Options:
19
19
20
20
Commands:
21
21
init [directory] Create a new MCPB extension manifest
22
-
validate [manifest] Validate a MCPB manifest file
22
+
validate <manifest> Validate a MCPB manifest file
23
23
pack <directory> [output] Pack a directory into a MCPB extension
24
24
sign [options] <mcpb-file> Sign a MCPB extension file
25
25
verify <mcpb-file> Verify the signature of a MCPB extension file
@@ -58,7 +58,7 @@ The command will prompt you for:
58
58
59
59
After creating the manifest, it provides helpful next steps based on your server type.
60
60
61
-
### `mcpb validate [path]`
61
+
### `mcpb validate <path>`
62
62
63
63
Validates a MCPB manifest file against the schema. You can provide either a direct path to a manifest.json file or a directory containing one.
64
64
@@ -69,28 +69,8 @@ mcpb validate manifest.json
69
69
# Validate manifest in directory
70
70
mcpb validate ./my-extension
71
71
mcpb validate .
72
-
73
-
# Validate using --dirname without specifying manifest.json explicitly
74
-
mcpb validate --dirname ./my-extension
75
72
```
76
73
77
-
#### Additional validation with `--dirname`
78
-
79
-
Passing `--dirname <directory>` performs deeper checks that require access to the extension's source files:
80
-
81
-
- Verifies referenced assets exist relative to the directory (`icon`, each `screenshots` entry, `server.entry_point`, and path-like `server.mcp_config.command`).
82
-
- Launches the server (honoring `${__dirname}` tokens) and discovers tools & prompts using the same logic as `mcpb pack`.
83
-
- Compares discovered capability names against the manifest and fails if they differ.
84
-
85
-
When `--dirname` is supplied without an explicit manifest argument, the CLI automatically resolves `<directory>/manifest.json`. Use `--update` alongside `--dirname` to rewrite the manifest in-place with the discovered tool/prompt lists (including `tools_generated` / `prompts_generated` flags). When rewriting, the CLI also copies over tool descriptions and prompt metadata (descriptions, declared arguments, and prompt text) returned by the server. Without `--update`, any mismatch causes the command to fail.
86
-
87
-
The discovery step respects the same environment overrides as `mcpb pack`:
88
-
89
-
-`MCPB_TOOL_DISCOVERY_JSON`
90
-
-`MCPB_PROMPT_DISCOVERY_JSON`
91
-
92
-
These allow deterministic testing without launching the server.
93
-
94
74
### `mcpb pack <directory> [output]`
95
75
96
76
Packs a directory into a MCPB extension file.
@@ -109,52 +89,6 @@ The command automatically:
109
89
- Excludes common development files (.git, node_modules/.cache, .DS_Store, etc.)
110
90
- Creates a compressed .mcpb file (ZIP with maximum compression)
111
91
112
-
#### Capability Discovery (Tools & Prompts)
113
-
114
-
During packing, the CLI launches your server (based on `server.mcp_config.command` + `args`) and uses the official C# MCP client to request both tool and prompt listings. It compares the discovered tool names (`tools` array) and prompt names (`prompts` array) with those declared in `manifest.json`.
115
-
116
-
If they differ:
117
-
118
-
- Default: packing fails with an error explaining the mismatch.
119
-
-`--force`: continue packing despite any mismatch (does not modify the manifest).
120
-
-`--update`: overwrite the `tools` and/or `prompts` list in `manifest.json` with the discovered sets (also sets `tools_generated: true` and/or `prompts_generated: true`) and persists the discovered descriptions plus prompt arguments/text when available.
121
-
-`--no-discover`: skip dynamic discovery entirely (useful offline or when the server cannot be executed locally).
122
-
123
-
Environment overrides for tests/CI:
124
-
125
-
-`MCPB_TOOL_DISCOVERY_JSON` JSON array of tool names.
126
-
-`MCPB_PROMPT_DISCOVERY_JSON` JSON array of prompt names.
127
-
If either is set, the server process is not launched for that capability.
128
-
129
-
#### Referenced File Validation
130
-
131
-
Before launching the server or writing the archive, `mcpb pack` now validates that certain files referenced in `manifest.json` actually exist relative to the extension directory:
132
-
133
-
-`icon` (if specified)
134
-
-`server.entry_point`
135
-
- Path-like `server.mcp_config.command` values (those containing `/`, `\\`, `${__dirname}`, starting with `./` or `..`, or ending in common script/binary extensions such as `.js`, `.py`, `.exe`)
136
-
- Each file in `screenshots` (if specified)
137
-
138
-
If any of these files are missing, packing fails immediately with an error like `Missing icon file: icon.png`. This happens before dynamic capability discovery so you get fast feedback on manifest inaccuracies.
139
-
140
-
Commands (e.g. `node`, `python`) that are not path-like are not validated—they are treated as executables resolved by the environment.
141
-
142
-
Examples:
143
-
144
-
```bash
145
-
## Fail if mismatch
146
-
mcpb pack .
147
-
148
-
# Force success even if mismatch
149
-
mcpb pack . --force
150
-
151
-
## Update manifest.json to discovered tools/prompts
0 commit comments