What changed: accc8c090 took Claude Code's names for a server's own
OAuth app (oauth.clientId, clientSecret, callbackPort) but sent
redirect_uri=http://127.0.0.1:<port>/callback. Claude Code sends
http://localhost:<port>/callback:
- code.claude.com/docs/en/mcp, "Use pre-configured OAuth credentials":
register http://localhost:PORT/callback; --callback-port fixes the
port to match it. Its version note says 2.1.229 sent 127.0.0.1 and
servers that match the registered URL exactly refused the sign-in,
so 2.1.231 went back to localhost.
- The installed Claude Code 2.1.296 binary builds
`http://localhost:${n}/callback` (default port 3118 / a random
free one, MCP_OAUTH_CALLBACK_PORT) and listens on 127.0.0.1 only.
So an app registered for Claude Code at an exact-match server was
refused by magpie. StartWith now sends localhost for a user's own app
and still listens on 127.0.0.1 alone, as Claude Code does, so the hosts
don't differ and the editor needs no note. magpie's own dynamic
registration keeps 127.0.0.1 (it registers that URL itself).
The no-registration error, the editor's hint (now
http://localhost[:port]/callback), its zh/zh-TW/ja/de translations,
the OAuthApp comment and docs/subsystems/library.md say localhost.
Run:
- New TestAppMadeForClaudeCode: the GitHub-shaped fake matching one
exact registered URL http://localhost:<port>/callback, at authorize
and at the token request. With the old mcpauth.go it fails (as do
the three GitHub tests now asserting localhost); with the fix all
pass. go test -race ./internal/mcpauth/...
- go test -tags nogui ./internal/library ./internal/gui
- gofmt -l; go vet darwin, GOOS=linux -tags nogui, GOOS=windows
- GUI mcp-oauth-app (Chromium+WebKit, 1100/390, en zh zh-TW ja de,
22/22) and i18n-keys; with the hint's old 127.0.0.1 put back by hand,
mcp-oauth-app goes red (0/11 Chromium).
Not run: a real sign-in with a real OAuth app (none to use). GitHub's
docs say a loopback redirect needn't match the registered port but
don't say whether that holds for localhost as it does for 127.0.0.1;
if GitHub wants the port, the user sets Callback port and registers
http://localhost:<port>/callback, as Claude Code's docs also say.