Skip to content

Register the client dynamically when none is set - #3

Merged
sergeyfast merged 3 commits into
masterfrom
feat/dcr
Oct 11, 2026
Merged

sergeyfast merged 3 commits into
masterfrom
feat/dcr

Conversation

@sergeyfast

@sergeyfast sergeyfast commented Oct 11, 2026 •

Copy link
Copy Markdown
Member
  • Add RFC 7591 dynamic client registration: without a configured clientID mcpurl registers a public client (PKCE, no secret) for its loopback redirect URI, so servers that offer DCR need no hand-made client and no --client-id; a configured clientID still wins
  • Keep registrations in ~/.config/mcpurl/clients, keyed by endpoint and redirect URI: the callback port is part of what the server registered, and config.toml stays untouched, so bare-URL runs work too
  • Register once across concurrent processes (Claude Desktop + Cursor) under a file lock that re-reads the store
  • Drop the registration and its token and register anew with one browser login when refresh answers invalid_client or discovery finds another authorization server
  • Follow a registration another process replaced: a second bridge waiting on the same token lock picks up the new client instead of opening a browser on the dead one
  • Refuse confidential clients, foreign redirect_uris and servers without a registration endpoint with an actionable error, the server's own error text included
  • Let logout work without a clientID and drop the registration too, an unreadable one included; uninstall and logout --all clean registrations up, show prints them
  • Point the login timeout at mcpurl logout when the browser reports an unknown client: a server that forgot the client fails its authorization page, out of mcpurl's sight
  • Add tests for registration and reuse, the two-process race, re-registration (also seen from a second bridge), a foreign issuer, every refused and lenient registration answer, a static client's invalid_client, unreadable registrations, and show / logout / logout --all / uninstall
  • Update README for setups without --client-id
  • Require Go 1.26.9 to clear stdlib advisories (net/http, net/textproto, crypto/tls) that failed the security job

- Add RFC 7591 dynamic client registration: without a configured
  clientID mcpurl registers a public client for its loopback redirect
  URI and keeps it in ~/.config/mcpurl/clients, keyed by endpoint and
  redirect URI
- Register once across concurrent processes under a file lock
- Drop the registration and its token and register anew when refresh
  answers invalid_client or the authorization server has changed
- Refuse confidential clients, foreign redirect URIs and servers
  without a registration endpoint with an actionable error
- Let logout work without a clientID and drop the registration too;
  uninstall and logout --all clean registrations up, show prints them
- Point the login timeout at logout when the browser reports an
  unknown client, and let logout drop an unreadable registration
- Update README for setups without --client-id
- Bump the go directive from 1.26.7, which CI installs verbatim via
  setup-go's go-version-file, so govulncheck reported nine standard
  library vulnerabilities fixed in 1.26.9 (net/http, net/textproto,
  crypto/tls) and failed the security job
- No source change: the advisories are in the toolchain, not in
  mcpurl, and govulncheck is clean on 1.26.9
- Fix a second bridge opening a browser on a dead client_id: when the
  server forgot a shared registration and one process re-registered,
  the other, waiting on the same token lock, logged in with the old
  client instead of picking up the new one
- Cover more registration answers: a plain http endpoint, no client_id,
  non-JSON, an error page, a token quoted in error_description, and
  the lenient 200 / no-echo answers
- Cover every unreadable registration shape, the redirect URI default,
  the login-timeout hint, and the registration drop by logout,
  logout --all and uninstall
@sergeyfast
sergeyfast merged commit 691e347 into master Oct 11, 2026
3 checks passed
@sergeyfast
sergeyfast deleted the feat/dcr branch October 11, 2026 15:40
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.

1 participant