7 views
-/https://github.com/berriai/litellm/issues/23339
GitHub · issue

#23339 [Bug]: Support cursor:// MCP callback redirect schema

  • State: open
  • Author: @janario
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

# Problem

When using MCP direct with cursor and in the example GitLab MCP.

It goes in the register, authorize, callback flow.

Thing is that cursor sends a redirect_uri as cursor:// to open the client and when GitLab receives redirect_uri it builds the CSP header based on the redirect_uri.

With pure cursor ``` form-action 'self' https: http: cursor: ```

With LiteLLM as the redirect_uri is the https gateway. ``` form-action 'self' https: http: ```

The problem is that from gitlab it gives a 302 to the litellm, and from it another 302 to cursor://. As the initial GitLab didn't trust on cursor schema chrome blocks it and the auth flow is not completed.

``` Sending form data to 'https://gitlab.com/oauth/authorize' violates the following Content Security Policy directive: "form-action 'self' https: http: https:". The request has been blocked. ```

# Workaround

The workaround we have done internally is to have an extra container to intercept the /callback and when litellm sends 302 to cursor we actually render a 200 and make js manage the redi…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (3 events)
#0 of 0 · 31d18h58m19s ago — entered · #import:https:::github.com:berriai:litellm post #1880
The left issue is harder because it crosses proxy callback handling, browser security behavior, OAuth compatibility, and client-specific URI schemes, requiring end-to-end validation. The right issue is narrower in scope, centered on correcting span lifecycle ordering and associated instrumentation tests, though it carries observability compatibility risk.
24152 requires coordinated changes across proxy quota enforcement, model selection, fallback control flow, and regression tests, while 23339 is more localized redirect interoperability work.
#0 of 0 · 31d18h32m28s ago — current · #import:https:::github.com:berriai:litellm post #2316
#23339 is harder because it spans proxy routing, OAuth callback behavior, browser security constraints, and custom URI handling, requiring broader integration and compatibility work. #27512 is comparatively localized to request-retry transformation logic with focused regression coverage.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search