Skip to content

docs(complete): align publish CLI flags with implementation (closes #767)#1278

Merged
rdimitrov merged 1 commit into
modelcontextprotocol:mainfrom
voidborne-d:fix/docs-publish-cli-flags
May 11, 2026
Merged

docs(complete): align publish CLI flags with implementation (closes #767)#1278
rdimitrov merged 1 commit into
modelcontextprotocol:mainfrom
voidborne-d:fix/docs-publish-cli-flags

Conversation

@voidborne-d
Copy link
Copy Markdown
Contributor

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 and cmd/publisher/main.go confirms the actual interface is a single positional PATH argument (default ./server.json):

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 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).

-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

  • grep -r -- '--file' . outside test fixtures returns 0 hits after the change
  • grep -r 'mcp-publisher publish --' docs/ complete.md shows only legitimate flags (--registry on login)
  • No code changes — make check not exercised since this is doc-only

🤖 Generated with Claude Code

…textprotocol#767)

complete.md still documented three flags for `mcp-publisher publish`
(`--file=PATH`, `--registry=URL`, `--dry-run`) that the CLI does not
parse. Reading the publisher source confirms the actual interface is
a positional `PATH` argument (default `./server.json`); registry URL
is bound at login time via the saved token, and "validate without
publishing" is a separate `mcp-publisher validate` subcommand.

Per the discussion on the earlier flag-implementation attempt (modelcontextprotocol#771),
maintainers preferred fixing the documentation rather than adding the
unimplemented flags. `docs/reference/cli/commands.md` was already
updated to the correct positional shape, but `complete.md` (which
mirrors the docs/ tree into a single file for LLM/quickstart use)
had drifted out of sync.

This change syncs the `mcp-publisher publish` block in `complete.md`
with the canonical version in `docs/reference/cli/commands.md`,
removing the three stale flags and the corresponding example.

Closes modelcontextprotocol#767.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rdimitrov rdimitrov merged commit 276037b into modelcontextprotocol:main May 11, 2026
3 checks passed
@voidborne-d
Copy link
Copy Markdown
Contributor Author

Thanks for the quick review and merge, @rdimitrov!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

publish subcommand's --file flag not working

2 participants