Skip to content

auth login and connect: no login wall where the server asks for none - #80

Merged
niksa90 merged 4 commits into
mainfrom
fix/auth-login-no-login-needed
Nov 17, 2026
Merged

niksa90 merged 4 commits into
mainfrom
fix/auth-login-no-login-needed

Conversation

@niksa90

@niksa90 niksa90 commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

What

  • connect: with --protocol auto (the default) and no stored login, a 401 or 403 to server/discover gets one 2025 initialize before toolmenu reports "wants credentials". If that is refused too, the error names initialize; if it fails some other way (a server on 2026-07-28 only), the original server/discover 401 is reported. --protocol modern is unchanged.
  • auth login: a server that never asks for credentials gets "No login made … nothing was stored" instead of "Logged in", and the empty store file is removed. A store file from before the login (a registered client, a rejected token) is kept.
  • Test fixture raw-http-server.mjs: discoverStatus, initializeStatus and requireAuth options.

Why

Dreamwork 1.10.0 (https://mcp.dreamworkhq.com/mcp) answers server/discover with a 401 and serves a 74-tool guest menu over the 2025 handshake. toolmenu snapshot stopped at "wants credentials" and pointed at auth login, which then reported a login with no token behind it.

Tests

  • npm test: 727 passing.
  • New CLI test: discover 401 and 403 fall back and list the menu; --protocol modern doesn't fall back; a 2026-only server keeps its discover 401; a server that refuses everything reports initialize got HTTP 401. It fails without the connect.ts change.
  • auth login test: nothing stored, and the next step.
  • Checked by hand against Dreamwork: snapshot lists 74 tools with no flags.

Notes

src/connect.ts: the retry is a recursive connect() with protocol: 'legacy', so on a real login wall each connection now makes two requests before failing.

A server that lists its tools without credentials (Google's hosted Gmail
server, for one) made `auth login` print "Logged in", and leave a file with no
token in it that `auth list` then showed as a login. It asks only when a tool
is called, so a later session would have failed with no hint why.

Now `auth login` checks for a token. With none, it says no login was made,
removes the stray file, and says what to do if tool calls then need one
(--header, or --client-id and --client-secret). The API's result gains
`authenticated`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

toolmenu

Verdict: ✓ unchanged: the same menu and the same findings. Nothing to accept. Findings against the baseline: 0 new, 0 gone, 0 changed.

toolmenu diff: toolmenu 0.28.0 → 0.28.1 (server-reported)

No breaking changes · 0 minor · 0 notices · ±0 tokens (~1,523 → ~1,523, estimate) · 6 → 6 tools

Version: suggested bump: none · not checked (set the Action's release input old..new)

No findings.

✓ 0 errors, 0 warnings, 0 info

Baseline: docs/toolmenu-menu.json as of main

toolmenu snapshot: toolmenu 0.28.1

Protocol 2026-07-28 · 6 tools · ~1,523 tokens (estimate)

1 info
Rule Finding
info write/no-dry-run · unsure 2 tools are annotated as destructive, and toolmenu found no dry_run/preview-style parameter and no preview tool for the same thing. Where a mistake is costly to undo, a dry run lets the agent see what would change while it can still back out. · snapshot_menu, check_session
→ Next: Where the effect is hard to undo, add a dry_run parameter that returns what would change without changing it. If it's cheap to undo, or a preview exists under another name, ignore this.

0 errors, 0 warnings, 1 info

Where the tokens go (estimate): the top 5 tools are 93% of the menu
Share Tool Tokens Description Schema
30% snapshot_menu ~461 ~99 ~353
26% check_session ~394 ~102 ~283
15% review_baseline ~231 ~65 ~156
12% diff_menus ~187 ~39 ~138
10% check_auth ~149 ~86 ~54
  • repeated: cwd (~37 tokens) in 4 tools, ~148 in all

A tool's schema can't $ref another tool's, so a block shared across tools is paid once per tool: only a smaller block saves tokens there.

toolmenu · token counts are estimates

Dreamwork 1.10.0 answers server/discover with a 401 and serves a guest
menu over the 2025 handshake, so snapshot stopped at "wants credentials".
With --protocol auto, a 401 or 403 to server/discover now gets one 2025
initialize before toolmenu reports credentials. CHANGELOG lines for this
and the auth login change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kCPJZAgTv3Bna4BGLzw2o
- A 2026-only server behind a login keeps its server/discover 401 when the
  2025 retry fails for another reason; a stored login that was refused is
  reported as such, with no retry.
- auth login keeps a store file that existed before it (a registered
  client, a rejected token) when the server asks for nothing.
- auth login's next step no longer suggests --client-id, which leads back
  to the same message.
- CHANGELOG: the plugin pin goes under Repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kCPJZAgTv3Bna4BGLzw2o
@niksa90 niksa90 changed the title auth login: say so when the server never asked for a login auth login and connect: no login wall where the server asks for none Nov 17, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014kCPJZAgTv3Bna4BGLzw2o
@niksa90
niksa90 merged commit 7f31609 into main Nov 17, 2026
6 checks passed
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.

2 participants