-
Notifications
You must be signed in to change notification settings - Fork 744
Description
Issue Description
The Jina MCP server fails authentication for search functions (search_web, search_images, expand_query, etc.) while URL reading functions work correctly. Direct API calls to both search and reader endpoints work perfectly with the same API key, indicating this is an MCP server implementation issue rather than an API key or service problem.
Environment Information
- Claude Code Version: Latest
- MCP Server: jina-mcp-server via
https://mcp.jina.ai/sse - Transport: SSE (Server-Sent Events)
- API Key: Valid and topped-up
- Region: Asia/Jakarta (ID)
Configuration
claude mcp add --transport sse jina https://mcp.jina.ai/sse -s user --header "Authorization : Bearer jina_1ca8f3ecfd7c495dafba3c146a086519Dmj32NI96__TFVhcKr5oaVWt2I55"Test Results
✅ Working Functions
read_url()- Successfully retrieves and converts web content to markdownprimer()- Returns location/context data correctlyshow_api_key()- Returns configured API key- MCP Server shows "✓ Connected" status
❌ Failing Functions
search_web()- Returns "Unauthorized" errorsearch_images()- Returns "Unauthorized" errorsearch_arxiv()- Returns "Unauthorized" errorexpand_query()- Returns "Authentication failed. Please set your API key in the Jina AI MCP settings"parallel_search_web()- Returns "Unauthorized"
Direct API Testing (All Working)
# Search API - WORKS
curl -H "Authorization: Bearer jina_1ca8f3ecfd7c495dafba3c146a086519Dmj32NI96__TFVhcKr5oaVWt2I55" "https://s.jina.ai/http://example.com"
# Returns: Full search results with titles, URLs, descriptions
# Reader API - WORKS
curl -H "Authorization: Bearer jina_1ca8f3ecfd7c495dafba3c146a086519Dmj32NI96__TFVhcKr5oaVWt2I55" "https://r.jina.ai/http://example.com"
# Returns: Full content extractionError Messages
MCP Function Errors:
Error: Search failed for query "artificial intelligence": Unauthorized
Authentication failed. Please set your API key in the Jina AI MCP settings. You can get a free API key by visiting https://jina.ai and signing up for an account.
Debugging Steps Performed
- ✅ API Key Validation: Direct curl calls work perfectly with both search and reader endpoints
- ✅ Service Status: Jina AI status page shows all systems operational
- ✅ Configuration: Multiple configuration methods tested (SSE, stdio, environment variables, direct headers)
- ✅ Transport Methods: Tested both SSE and stdio transport types
- ✅ Header Formats: Tried various header formatting approaches
- ✅ API Credits: Confirmed API account is topped up and active
- ✅ Regional Testing: Tested from multiple network locations
Expected Behavior
All Jina MCP functions should work consistently with a valid API key, just as direct API calls do.
Actual Behavior
URL reading functions work perfectly, but search functions fail with authentication errors despite using the same valid API key.
Impact
- High: Search functionality is completely unusable through MCP
- Users cannot access Jina's search capabilities through Claude Code
- Forces workaround with alternative MCP servers or direct API calls
Additional Context
Pattern Observation:
This appears to be a service-specific authentication issue where:
- Reader API (
r.jina.ai) → Works through MCP and direct calls - Search API (
s.jina.ai) → Only works through direct calls, fails through MCP
Community Evidence:
Multiple similar issues reported in community forums suggesting this is a known MCP server authentication handling problem.
Possible Root Causes:
- MCP server incorrectly formats authentication headers for search requests
- Search API endpoints have different authentication requirements not properly handled by MCP
- MCP server implementation bug specific to search function authentication
- Rate limiting or token validation differences between reader and search APIs
Reproduction Steps
- Configure Jina MCP server with valid API key:
claude mcp add --transport sse jina https://mcp.jina.ai/sse -s user --header "Authorization : Bearer YOUR_API_KEY"- Test URL reading (works):
mcp__jina-mcp-server__read_url("https://example.com")- Test search function (fails):
mcp__jina-mcp-server__search_web("test query", 3)- Verify direct API calls work:
curl -H "Authorization: Bearer YOUR_API_KEY" "https://s.jina.ai/http://example.com"Requested Resolution
- Fix MCP server authentication for search functions to match direct API behavior
- Proper error handling to distinguish between API key issues vs MCP implementation issues
- Documentation updates if there are different authentication requirements for search vs reading
- Configuration validation tools to help users troubleshoot similar issues
Workaround Available
Use direct API calls or alternative MCP search servers while this issue is resolved.
Priority
High - Core functionality completely broken for search capabilities
Environment Details:
- OS: macOS Darwin 24.6.0
- Client: claude-code/2.0.20
- Network: PT. Eka Mas Republik (CGK, Indonesia)
- Timezone: Asia/Jakarta