Tavily MCP: Not Acceptable, client must accept application/json and text/event-stream
Fixes Tavily MCP authentication failures when using an HTTP client config, where every tool call returns an auth error. Use when the remote Tavily MCP endpoint rejects requests with an Accept-header or authentication error. Not for stdio npx installs that fail to start or for invalid API keys.
Fix Tavily MCP Not Acceptable: Client must accept both application/json and text/event-stream
TL;DR
Switch from the type: http config to the stdio config (npx -y tavily-mcp@latest with your key in env). The hosted Tavily MCP endpoint requires an Accept: application/json, text/event-stream header that Claude Code's HTTP client does not send, so every call fails with what looks like an authentication error.
What the failure looks like:
{"error":"Search failed","detail":"Authentication required"}and at the raw HTTP level:
Not Acceptable: Client must accept both application/json and text/event-streamSteps
1. Confirm the header is the problem
Run a raw request without the special Accept header:
curl -X POST "https://mcp.tavily.com/mcp/?tavilyApiKey [your value] Tavily API key]" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'Success check: you get the Not Acceptable response, which proves the header (not your key) is the issue. With the right header it works:
curl -X POST "https://mcp.tavily.com/mcp/?tavilyApiKey [your value] Tavily API key]" \
-H "Accept: application/json, text/event-stream" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'2. Replace the HTTP config with stdio
In your MCP config, drop the type: http entry and use:
{
"mcpServers": {
"tavily": {
"command": "npx",
"args": ["-y", "tavily-mcp@latest"],
"env": { "TAVILY_API_KEY": "[your Tavily API key]" }
}
}
}Success check: restart the client; tavily-search and tavily-extract appear and searches return results.
3. Validate the key separately if it still fails
If the stdio route also fails, verify the key itself:
curl -s "https://api.tavily.com/search" -H "Content-Type: application/json" \
-d '{"api_key":"[your Tavily API key]","query":"test","max_results":1}' | head -c 300Success check: valid JSON with results means the key is fine and the problem is the transport.
When this applies
- You configured Tavily with
"type": "http"and `"url": "https://mcp.tavily.com/mcp/?tavilyApiKey [your value] and every tool call returns an authentication error. - Raw curl shows the
Not Acceptablemessage abouttext/event-stream.
When it does not apply
- The stdio
npx tavily-mcpserver fails to start at all (check Node and npx first). - The key is actually invalid or missing; the API check in step 3 returns a 401. Regenerate the key instead.
Tool compatibility
- tavily-mcp npm package (latest)
- Tavily hosted MCP at mcp.tavily.com
- Claude Code (the
type: httpclient is the one affected), also relevant to any client that cannot set custom Accept headers
Why it happens
The Tavily MCP server streams responses over SSE, so it requires clients to send Accept: application/json, text/event-stream. Claude Code's type: http client sends a default Accept header without the SSE part, the server rejects the request as Not Acceptable, and the client surfaces that as an authentication failure, which sends you chasing the API key instead of the header.
Edge cases
- Do not paste the key with quotes or trailing spaces in the URL parameter; the
type: httpsetup passes it verbatim in the query string. - If you need the remote endpoint (no local node), use
mcp-remotewith the URL as an npx stdio wrapper instead oftype: http. - API rate limits on the free tier return HTTP 429, not auth errors; treat those as usage limits, not this problem.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.