Visitar URL original
docs(publishing): troubleshooting for DNS/HTTP auth (#845) (#1268) · modelcontextprotocol/registry@edd9fa7 · GitHub
Skip to content

Commit edd9fa7

Browse files
rhinocapclaude
andauthored
docs(publishing): troubleshooting for DNS/HTTP auth (#845) (#1268)
## Summary Adds a **Troubleshooting DNS and HTTP authentication** section to the publishing authentication guide. Patterned after #1253 (my prior docs fix in the same file): docs-only, focused on the recurring failure modes that bottom out as a generic `signature verification failed` or `no MCP public key found` error. Motivated by #845 (improve CLI/TUI experience for DNS/HTTP auth) and the recurring confusion around DNS apex/selector placement called out in #1126. The full TUI work in #845 is a larger lift; this is the docs slice that lets people self-diagnose today using the tools they already have (`dig`, `curl`). The new section covers, in order: 1. **Comparing the CLI's "Expected proof record" against what's actually published** — the most common cause of false-fail loops, especially after rotating keys. 2. **DNS: verifying the TXT record with `dig` before logging in** — distinguishes missing / stale / misplaced records, and notes the existing misplaced-selector probe added for #1126 (so users know what error shape to expect). 3. **HTTP: verifying `/.well-known/mcp-registry-auth` with `curl -i`** — plus the four constraints baked into the server-side fetcher in `internal/api/handlers/v0/auth/http.go`: HTTPS only, no redirects (the fetcher returns `http.ErrUseLastResponse` from `CheckRedirect`), `MaxKeyResponseSize = 4096` byte cap, and the `safeDialContext` blocklist of loopback / RFC1918 / link-local / CGNAT IPs. 4. **Algorithm vs key mismatch** — `--algorithm` must match the published `k=` field. Nothing new in code; the existing apex/selector `<Warning>` (already in the file) and the OpenSSL 3.x `<Note>` from #1253 are untouched. ## Test plan - [x] `git diff --stat` confirms a single-file docs change (`docs/modelcontextprotocol-io/authentication.mdx`, +48/-0). - [x] Verified the documented HTTP constraints against `internal/api/handlers/v0/auth/http.go`: `MaxKeyResponseSize = 4096`, `CheckRedirect` returning `ErrUseLastResponse`, `safeDialContext` IP blocklist, `https://` URL construction, `strings.TrimSpace` of the body. - [x] Verified the documented DNS misplaced-selector behavior against `internal/api/handlers/v0/auth/dns.go` (`commonWrongSelectors = ["_mcp-auth", "_mcp-registry"]`, `findMisplacedSelector` probe). - [x] Verified the "Expected proof record" output line is what `cmd/publisher/auth/common.go` actually prints (`PrintEd25519KeyInfo` / `printEcdsaKeyInfo`). - [ ] Markdown rendering of `<CodeGroup>` / fenced blocks — relying on the existing patterns in this file for syntax validity, no new MDX components introduced. Continuing the publisher-devex thread from #1253. Happy to split or trim if maintainers prefer a smaller surface area. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c34626b commit edd9fa7

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

‎docs/modelcontextprotocol-io/authentication.mdx‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,44 @@ curl -sS -o - -w '\n%{http_code}\n' \
369369
The response body must be the proof record printed by the login command (`v=MCPv1; k=...; p=...`). When the Registry cannot use the endpoint, the login error carries the Registry's own fetch failure, such as `dial tcp <ip>:443: i/o timeout`, `HTTP 403: failed to fetch key from ...`, or `HTTP 301: failed to fetch key from ...`. Allow plain HTTPS clients through for `/.well-known/mcp-registry-auth`, serve the path without redirects, then retry.
370370

371371
Addresses that resolve to loopback, private, link-local, or carrier-grade NAT ranges are refused by design, so the endpoint must be reachable at a public address.
372+
373+
## Troubleshooting DNS and HTTP authentication
374+
375+
If `mcp-publisher login dns` or `login http` fails, check the published proof record before changing keys or retrying. A fetch failure and a signature mismatch have different causes; read the detailed error returned by the Registry.
376+
377+
### Compare the "Expected proof record" against what is actually published
378+
379+
Each login invocation prints an `Expected proof record:` line, for example:
380+
381+
```text Output
382+
Expected proof record:
383+
v=MCPv1; k=ed25519; p=CmELkdW27Q+pySZRD1ezkXAG/SbeDhGWAjtuKKMKixg=
384+
```
385+
386+
Check that the algorithm (`k=`) and public key (`p=`) in the published MCPv1 record match the current login command's output. Rerun the login command after rotating a key so you compare against the freshly derived public key. For HTTP verification, surrounding whitespace and trailing newlines are trimmed; their presence alone does not cause a signature mismatch. Avoid editing or wrapping the public-key data itself.
387+
388+
When a signature does not match, the Registry's error includes fingerprints of the published keys it tried. Compare these with the key you intended to publish to help identify a stale record or a mismatch between the private key and published public key.
389+
390+
### DNS: verify the TXT record before logging in
391+
392+
Confirm an MCPv1 TXT record is published at the exact domain passed to `--domain`, rather than at a selector such as `_mcp-auth.<domain>`:
393+
394+
```bash
395+
dig TXT example.com +short
396+
# Expect a record like:
397+
# "v=MCPv1; k=ed25519; p=CmELkdW27Q+pySZRD1ezkXAG/SbeDhGWAjtuKKMKixg="
398+
```
399+
400+
If no MCPv1 record appears, check the DNS provider's record name and value, then allow for DNS propagation and cached responses after correcting it. If `dig TXT _mcp-auth.example.com +short` returns the proof record but `dig TXT example.com +short` does not, it is published at the wrong name (see the apex warning above).
401+
402+
When the Registry finds a well-formed MCPv1 record at a known wrong selector (`_mcp-auth.<domain>` or `_mcp-registry.<domain>`) but none at the requested domain, it returns a specific error identifying the misplaced record.
403+
404+
The Registry tries all valid published MCP keys; a different key in another TXT record does not take precedence over the correct one. Ensure at least one record contains the public key for the private key used by the login command. Remove retired MCP authentication records when they are no longer needed, while preserving keys still in use and TXT records for other services.
405+
406+
### HTTP: verify the well-known endpoint before logging in
407+
408+
Follow [Troubleshooting failed HTTP verification](#troubleshooting-failed-http-verification) for the exact request, timeout, response-size limit, redirect policy, and network requirements. A successful request from your own machine does not establish that the Registry can reach the endpoint.
409+
410+
### Confirm the algorithm matches the key
411+
412+
The `--algorithm` flag (default `ed25519`) must match the algorithm declared in the published proof record's `k=` field. Signing an Ed25519 timestamp against an `ecdsap384` proof record (or vice versa) fails verification. If you regenerated the keypair with a different algorithm than what is published, update the TXT record or the `mcp-registry-auth` file before retrying.

0 commit comments

Comments
 (0)