Skip to content

when adding MCP server, a invalid token should tell user, but return invalid json(500) on UI #2739

@int0x03

Description

@int0x03

Describe the bug
on UI, when I add a MCP server, and given the wrong token, it should tell user the token is invalid, but on current UI, it just says: Unexpected token 'I', "Internal S"... is not valid JSON

To Reproduce

  1. add an MCP server which need a token, but give the wrong token
  2. you can see on the top right corner: Unexpected token 'I', "Internal S"... is not valid JSON
  3. in the chainlit UI log, you can see
INFO:httpx:HTTP Request: POST https://example.com/mcp/server "HTTP/1.1 401 Unauthorized"
INFO:     127.0.0.1:62307 - "POST /chat/mcp HTTP/1.1" 500 Internal Server Error

                 ***********************   
    |     raise RuntimeError("No response returned.")
    | RuntimeError: No response returned.

Expected behavior
it should tell users the clearly msg what's wrong for the MCP server

Screenshots

Image Image

Desktop (please complete the following information):

  • OS: [iOS]
  • Browser [chrome]
  • Version [all]

Metadata

Metadata

Assignees

No one assigned

    Labels

    authPertaining to authentication.backendPertains to the Python backend.needs-triage

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions