Skip to content

Commit 276037b

Browse files
d 🔹d 🔹claude
authored
docs(complete): align publish CLI flags with implementation (closes #767) (#1278)
## Summary `complete.md` documents three flags for `mcp-publisher publish` that the CLI does not actually parse: - `--file=PATH` — Path to server.json - `--registry=URL` — Registry URL override - `--dry-run` — Validate without publishing Reading [`cmd/publisher/commands/publish.go`](https://github.com/modelcontextprotocol/registry/blob/main/cmd/publisher/commands/publish.go) and [`cmd/publisher/main.go`](https://github.com/modelcontextprotocol/registry/blob/main/cmd/publisher/main.go) confirms the actual interface is a single positional `PATH` argument (default `./server.json`): ```go serverFile := \"server.json\" if len(args) > 0 && !strings.HasPrefix(args[0], \"-\") { serverFile = args[0] } ``` Registry URL is bound at login time via the saved token, and \"validate without publishing\" is a separate `mcp-publisher validate` subcommand. The bug user in #767 hit \"server.json not found\" precisely because `--file .registry/server.json` is filtered out by the `HasPrefix(args[0], \"-\")` check, leaving the default lookup in place. ## Background The canonical reference at [`docs/reference/cli/commands.md`](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/cli/commands.md) was already updated to the correct positional shape. `complete.md` (the concatenated single-file mirror of `docs/` used for LLM/quickstart consumption) had drifted out of sync — these were the only remaining `--file` references in the repo outside of test fixtures. Per the discussion on the prior flag-implementation attempt in #771, maintainers preferred fixing the documentation over adding the unimplemented flags: > @domdomegg: I'd lean towards removing the options from the docs. This PR closes that loop on the last stale doc surface. ## Changes `complete.md`: the `mcp-publisher publish` block now matches `docs/reference/cli/commands.md` line-for-line (positional `PATH`, no spurious flags, no dry-run example). ```diff -mcp-publisher publish [options] +mcp-publisher publish [PATH] -- \`--file=PATH\` - Path to server.json (default: \`./server.json\`) -- \`--registry=URL\` - Registry URL override -- \`--dry-run\` - Validate without publishing +- \`PATH\` - Path to server.json (default: \`./server.json\`) -# Dry run validation -mcp-publisher publish --dry-run - # Custom file location -mcp-publisher publish --file=./config/server.json +mcp-publisher publish ./config/server.json ``` Closes #767. ## Out of scope - `cmd/publisher/README.md:17` still shows `./bin/mcp-publisher publish --registry=http://localhost:8080` in the contributor quickstart. The flag is silently ignored at runtime (caught by the same `HasPrefix(\"-\")` filter). Happy to fold that fix into this PR or send a follow-up — flagging here in case a maintainer prefers one option. - `complete.md` is missing `mcp-publisher validate` and `mcp-publisher status` sections that exist in `docs/reference/cli/commands.md`. Out of scope for this single-concern PR; if there's interest, a broader sync would be a separate PR. ## Test plan - [x] `grep -r -- '--file' .` outside test fixtures returns 0 hits after the change - [x] `grep -r 'mcp-publisher publish --' docs/ complete.md` shows only legitimate flags (`--registry` on `login`) - [x] No code changes — `make check` not exercised since this is doc-only 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: d 🔹 <258577966+voidborne-d@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1d36806 commit 276037b

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

complete.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,30 +1991,26 @@ For detailed guidance on the publishing process, see the [publishing guide](../.
19911991

19921992
**Usage:**
19931993
```bash
1994-
mcp-publisher publish [options]
1994+
mcp-publisher publish [PATH]
19951995
```
19961996

19971997
**Options:**
1998-
- `--file=PATH` - Path to server.json (default: `./server.json`)
1999-
- `--registry=URL` - Registry URL override
2000-
- `--dry-run` - Validate without publishing
1998+
- `PATH` - Path to server.json (default: `./server.json`)
20011999

20022000
**Process:**
20032001
1. Validates `server.json` against schema
2004-
2. Verifies package ownership (see [Official Registry Requirements](../server-json/official-registry-requirements.md))
2005-
3. Checks namespace authentication
2006-
4. Publishes to registry
2002+
2. Publishes the `server.json` to the registry server URL specified in the login token
2003+
3. Server: Verifies package ownership (see [Official Registry Requirements](../server-json/official-registry-requirements.md))
2004+
4. Server: Checks namespace authentication
2005+
5. Server: Publishes to registry
20072006

20082007
**Example:**
20092008
```bash
20102009
# Basic publish
20112010
mcp-publisher publish
20122011
2013-
# Dry run validation
2014-
mcp-publisher publish --dry-run
2015-
20162012
# Custom file location
2017-
mcp-publisher publish --file=./config/server.json
2013+
mcp-publisher publish ./config/server.json
20182014
```
20192015

20202016
### `mcp-publisher logout`

0 commit comments

Comments
 (0)