Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
When Cursor connects to a remote MCP server that uses OAuth 2.1 with Dynamic Client Registration (RFC 7591), it performs a fresh DCR call to the authorization server’s /oauth/register endpoint on every reconnect or token refresh, instead of caching and reusing the client_id from the first registration. This floods the AS with duplicate “Cursor” client entries that all have identical redirect_uris and scopes — they are functionally indistinguishable. AS dashboards have no built-in cleanup mechanism (Clerk’s docs explicitly warn about the resulting administrative overhead), so resource server operators have to write cron jobs to delete stale clients.
Steps to Reproduce
- Add a remote MCP server in Cursor settings whose URL exposes /.well-known/oauth-protected-resource pointing to an AS with DCR enabled (I tested with Clerk).
- Click Connect — full OAuth 2.1 + PKCE flow runs, MCP works, you get a token.
- Disconnect the MCP server in Cursor settings, then reconnect.
- Query the AS’s OAuth Applications list (e.g. Clerk Dashboard or
GET https://api.clerk.com/v1/oauth_applications).
Each reconnect creates a new entry. From a single Cursor instance against my server I logged 5 entries within 9 minutes in one session, and 3 more within 4 minutes after a fresh reconnect later. All entries: same name “Cursor”, same redirect_uri “cursor://anysphere.cursor-mcp/oauth/callback”, same scopes, same client_uri.
Expected Behavior
Cursor caches the client_id (and refresh_token where applicable) from the first DCR registration, scoped per (MCP server URL, workspace). On subsequent connections, Cursor reuses the cached client_id and only triggers /oauth/register again if the AS rejects it (e.g. invalid_client at /oauth/token). RFC 7591 §3 explicitly permits clients to persist DCR registrations for reuse.
Operating System
Windows 10/11
Version Information
Version: 3.1.15 (user setup)
VSCode Version: 1.105.1
Commit: 3a67af7b780eObfc8d32aefa96b8ffıcb8817f80
Date: (1 day ago)
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Nodejs: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows NT x64 10.0.19045
Additional Information
Inspecting one of the registered clients via the Clerk admin API:
{
“name”: “Cursor”,
“client_id”: “MqJwPUkigF2osFOS”,
“redirect_uris”: [“cursor://anysphere.cursor-mcp/oauth/callback”],
“scopes”: “email offline_access profile”,
“dynamically_registered”: true,
“public”: true,
“created_at”: 1776369856047
}
Three other entries from the same Cursor instance within the same hour have identical fields except client_id and created_at. There’s no observable reason these should be separate clients.
Side note: Cursor correctly reads scopes_supported from the resource server’s RFC 9728 protected-resource metadata and includes those scopes in the /oauth/authorize call. That part works well — it’s only the DCR persistence that’s missing.
Bug report URL of corresponding Clerk Support ticket I’m filing (for cleanup automation): can be cross-referenced if needed.
Does this stop you from using Cursor
No - Cursor works, but with this issue