[GH-ISSUE #4494] [BUG]: MCP SSE does not send configured headers #2862

Closed
opened 2026-02-22 18:31:34 -05:00 by yindo · 0 comments
Owner

Originally created by @ppil on GitHub (Oct 5, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4494

How are you running AnythingLLM?

Docker (local)

What happened?

I need to add a bearer token to SSE MCP requests for an internally hosted, yet remote to AnythingLLM, MCP server. Added the appropriate config (redacted below), and it was getting 401 unauthorized from my server. Tested from the LLM host via Curl with an explicit header and that works. Read the code behind making SSE requests from config through to the SDK, and the header from config should get passed, but isn't for some reason

{
  "mcpServers": {
     "derp": {
        "type": "sse",
        "url": "https://derp/mcp_server/sse"
        "headers":{
            "Authorization": "Bearer loremipsumnottodayhackerman"
        }
     }
  }
}

Tracked this down to an MCP SDK bug that was fixed in release 1.12.1. Looks like we're using an old version that hasn't gotten this bugfix yet...

I popped into the docker container and manually upgraded the server to the lastest @modelcontextprotocol/sdk (1.19.1) and it connected to my remote MCP server with no issue.

Requesting that this dependency be upgraded.

Are there known steps to reproduce?

Try to use a bearer token to add an SSE-based MCP server

Originally created by @ppil on GitHub (Oct 5, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/4494 ### How are you running AnythingLLM? Docker (local) ### What happened? I need to add a bearer token to SSE MCP requests for an internally hosted, yet remote to AnythingLLM, MCP server. Added the appropriate config (redacted below), and it was getting 401 unauthorized from my server. Tested from the LLM host via Curl with an explicit header and that works. Read the code behind making SSE requests from config through to the SDK, and the header from config should get passed, but isn't for some reason ``` { "mcpServers": { "derp": { "type": "sse", "url": "https://derp/mcp_server/sse" "headers":{ "Authorization": "Bearer loremipsumnottodayhackerman" } } } } ``` Tracked this down to an MCP SDK [bug](https://github.com/modelcontextprotocol/typescript-sdk/issues/317) that was [fixed](https://github.com/modelcontextprotocol/typescript-sdk/pull/538) in release [1.12.1](https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/1.12.1). Looks like we're using an old version that hasn't gotten this bugfix yet... I popped into the docker container and manually upgraded the server to the lastest @modelcontextprotocol/sdk (1.19.1) and it connected to my remote MCP server with no issue. Requesting that this dependency be upgraded. ### Are there known steps to reproduce? Try to use a bearer token to add an SSE-based MCP server
yindo added the possible bug label 2026-02-22 18:31:34 -05:00
yindo closed this issue 2026-02-22 18:31:34 -05:00
yindo changed title from [BUG]: MCP SSE does not send configured headers to [GH-ISSUE #4494] [BUG]: MCP SSE does not send configured headers 2026-06-05 14:48:56 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2862