MCP OAuth — client_credentials grant ignored when CLIENT_SECRET is present

I followed Model Context Protocol (MCP) | Cursor Docs to configure an MCP server using Client Credentials OAuth. Does Cursor support token generation using CLIENT_ID and CLIENT_SECRET in auth section of config and token_endpoint present in OAuth discovery response?

Where does the bug appear (feature/product)? - Cursor IDE

Summary

Cursor’s MCP client always uses the authorization code (redirect) flow when connecting to a URL-based MCP server, even when the MCP configuration includes CLIENT_SECRET. It does not use the client credentials grant to obtain an access token directly from the token_endpoint(present in OAuth discovery) using CLIENT_ID and CLIENT_SECRET.

Steps to reproduce

  1. Configure a URL-based MCP server in .cursor/mcp.json with:

    1. url: base URL of the MCP server (e.g. https://localhost:8000/mcp/app or a remote URL).
    2. auth containing:
      1. CLIENT_ID
      2. CLIENT_SECRET
      3. scopes (e.g. ["read","write"])

    Example (with placeholders):

    {
      "mcpServers": {
        "my-mcp": {
          "url": "https://localhost:8000/mcp/app",
          "auth": {
            "CLIENT_ID": "your_client_id",
            "CLIENT_SECRET": "your_client_secret",
            "scopes": ["read", "write"]
          }
        }
      }
    }
    
    
  2. Ensure the MCP server (or its auth backend) serves /.well-known/oauth-authorization-server with:
    {
    "issuer":"``https://localhost:8000``",
    "authorization_endpoint":"``https://example.com/auth/api/authorize``", "token_endpoint":"``https://example.com/auth/api/token``", "response_types_supported":["code","token","id_token"], "token_endpoint_auth_methods_supported":["client_secret_basic"], "grant_types_supported":["client_credentials"]
    }

  3. In Cursor, add or reload the MCP server so it connects to the configured URL.

  4. Observe Cursor output/logs.

Result: Cursor prepares a redirect to the authorization endpoint and does not call the token endpoint with client credentials.

Expectation

When auth in mcp.json contains both CLIENT_ID and CLIENT_SECRET, and a token_endpoint is available (from the /.well-known/oauth-authorization-server discovery response), Cursor should:

  1. Use the client credentials grant (RFC 6749 §4.4).
  2. Request an access token by calling the token_endpoint with grant_type=client_credentials, authenticating with CLIENT_ID and CLIENT_SECRET (e.g. HTTP Basic or body parameters).
  3. Use the returned access token for MCP requests to the server.
  4. Not redirect the user to an authorization URL when a server-to-server credential is already configured.

Actual behavior

  1. Cursor fetches /.well-known/oauth-authorization-server from the MCP server URL.
  2. Cursor uses the authorization_endpoint from that discovery response to build an authorization (redirect) request, and logs that it is redirecting the user to the authorization URL.
  3. The token_endpoint from the discovery response is not used to obtain a token with CLIENT_ID and CLIENT_SECRET.
  4. Even with CLIENT_SECRET present in auth, Cursor still initiates the redirect-based flow (e.g. log message: “Redirect to authorization requested {“url”:"https://…….”).

Operating System - MacOS

Version Info:
Version: 2.5.17
VSCode Version: 1.105.1
Commit: 7b98dcb824ea96c9c62362a5e80dbf0d1aae4770
Date: 2026-02-17T05:58:33.110Z
Build Type: Stable
Release Track: Default
Electron: 39.3.0
Chromium: 142.0.7444.265
Node.js: 22.21.1
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.3.0

Does this stop you from using Cursor? - Sometimes - I can sometimes use Cursor

Hi there!

We detected that this may be a bug report, so we’ve moved your post to the Bug Reports category.

To help us investigate and fix this faster, could you edit your original post to include the details from the template below?

Bug Report Template - Click to expand

Where does the bug appear (feature/product)?

  • Cursor IDE
  • Cursor CLI
  • Background Agent (GitHub, Slack, Web, Linear)
  • BugBot
  • Somewhere else…

Describe the Bug
A clear and concise description of what the bug is.


Steps to Reproduce
How can you reproduce this bug? We have a much better chance at fixing issues if we can reproduce them!


Expected Behavior
What is meant to happen here that isn’t working correctly?


Screenshots / Screen Recordings
If applicable, attach images or videos (.jpg, .png, .gif, .mp4, .mov)


Operating System

  • Windows 10/11
  • MacOS
  • Linux

Version Information

  • For Cursor IDE: Menu → About Cursor → Copy
  • For Cursor CLI: Run agent about in your terminal
IDE:
Version: 2.xx.x
VSCode Version: 1.105.1
Commit: ......

CLI:
CLI Version 2026.01.17-d239e66

For AI issues: which model did you use?
Model name (e.g., Sonnet 4, Tab…)


For AI issues: add Request ID with privacy disabled
Request ID: f9a7046a-279b-47e5-ab48-6e8dc12daba1
For Background Agent issues, also post the ID: bc-…


Additional Information
Add any other context about the problem here.


Does this stop you from using Cursor?

  • Yes - Cursor is unusable
  • Sometimes - I can sometimes use Cursor
  • No - Cursor works, but with this issue

The more details you provide, the easier it is for us to reproduce and fix the issue. Thanks!