How to properly use MCP servers on LiteLLM?

Hi, I’m trying to use MCP from NocoDB databases into LiteLLM. That’s my litellm config file:

nocodb_mcp:
url: "https://nocodb.mydomain.tld/mcp/ID"
transport: "http"
headers:
xc-mcp-token: "REDACTED-TOKEN"
Accept: "application/json, text/event-stream"


But I see 401 errors and it did not work. Tried to use xc-mcp-nocodb_mcp-xc-mcp-token as well.

Curl is OK, the MCP servers are reachable and operative.

NocoDB’s MCP endpoint returns two different errors depending on what’s wrong:

  • 401 (MCP token missing) > the xc-mcp-token header never reached NocoDB
  • 404 (MCP Token not found) > the header arrived but the token value (or the token id in the URL) is wrong

You’re getting 401, and your curl with the same header works - so the token, the URL, and the server are all fine. This isn’t a token or endpoint problem: LiteLLM isn’t forwarding the xc-mcp-token header upstream to NocoDB. So the fix is entirely on the LiteLLM side. A few things to check, in order:

  1. YAML indentation. As pasted, the header keys look flush with headers: rather than nested under it. If that’s the case in your real file, headers is empty and nothing gets sent - which is exactly a 401. It must be:
headers:
     xc-mcp-token: "REDACTED-TOKEN"
     Accept: "application/json, text/event-stream"
  1. Check how your LiteLLM version forwards custom headers.