Skip to content

Conversation

locnguyen1986
Copy link
Contributor

The issue was that the /v1/conv/mcp endpoint was using two middleware functions:

  • AppUserAuthMiddleware()
  • RegisteredUserMiddleware()

The /v1/mcp endpoint only used AppUserAuthMiddleware()

When RegisteredUserMiddleware() encounters authentication failures, it calls AbortWithStatusJSON() which sets the Content-Type to application/json. However, the MCP (Model Context Protocol) server expects streaming content types for its protocol communication, which caused the "Unexpected content type" error

Copy link
Collaborator

@jjchen01 jjchen01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@locnguyen1986 locnguyen1986 merged commit eb26319 into main Sep 24, 2025
1 check passed
@locnguyen1986 locnguyen1986 deleted the fix/fix-conv-mcp branch September 24, 2025 04:17
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.

3 participants