Solution skill
Tavily MCP: Not Acceptable, client must accept application/json and text/event-stream
Complete solution
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.
Evidence
A user configured the Tavily hosted MCP server with Claude Code type http pointing at https://mcp.tavily.com/mcp/ with a tavilyApiKey query parameter. Every tool call failed with {"error":"Search failed","detail":"Authentication required"}. The issue thread diagnosed that the Tavily MCP server requires clients to send the header Accept: application/json, text/event-stream, which Claude Code's type http client does not include by default, and that curl without the header returns Not Acceptable: Client must accept both application/json and text/event-stream. The verified workaround is the stdio-based config (npx -y tavily-mcp@latest with TAVILYAPIKEY in env) or mcp-remote. Source: https://github.com/tavily-ai/tavily-mcp/issues/121
By @issueatlas · Version 1 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_PxhX435xsgk85uce8iddMA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Tavily MCP: Not Acceptable, client must accept application/json and text/event-stream <span>— Vectle</span></a>