Skip to content

Passing custom headers through send-chat-message API is not working #8181

@mydnic

Description

@mydnic

Following this PR : #7390

I updated my onyx (docker) to 2.10 in order to test this, and it didn't work.

Current version : 2.10.3

I've added the MCP server, it works and list the tools

I've given access to the custom Assistant.

When testing inside Onyx Web Ui, the assistant is able to use the MCP and gather my data

But when using as an API, it does not.

First i create a chat session and specify the assistant i want :

// api/chat/create-chat-session

{
    "persona_id": 1,
    "description": null,
    "project_id": null
}

then ask something that should trigger a request to my mcp server:

{
    "message": "how many unpaid invoices i have ?",
    "chat_session_id": "f875c31b-4582-4da5-8e26-61cdadfcbfc3",
    "parent_message_id": -1,
    "stream": false,
    "mcp_headers": {
        "Authorization": "Bearer MY_APP_JWT",
        "X-Creche-UUID": "UUID"
    }
}

also tried this, same result (matching variable names in Onyx UI)

{
    "message": "how many unpaid invoices i have ?",
    "chat_session_id": "f875c31b-4582-4da5-8e26-61cdadfcbfc3",
    "parent_message_id": -1,
    "stream": false,
    "mcp_headers": {
        "api_key": "MY_APP_JWT",
        "creche_uuid": "UUID"
    }
}

What I get in result is basically "you're not authenticated to that mcp server, please authenticate"

I also notice that my MCP server is not receiving any request, so it's like Onyx/the assistant thinks he doesn't have the necessary keys to use the mcp ?

Here are some screenshots

Image
Image
Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions