Skip to content

feat: add optional You.com search engine integration - #105

Open
mouse-value-add wants to merge 1 commit into
Aas-ee:mainfrom
mouse-value-add:feat/youcom-search-engine
Open

feat: add optional You.com search engine integration#105
mouse-value-add wants to merge 1 commit into
Aas-ee:mainfrom
mouse-value-add:feat/youcom-search-engine

Conversation

@mouse-value-add

Copy link
Copy Markdown

Summary

This PR adds You.com as an optional search engine to the open-webSearch multi-engine MCP server, following the existing engine architecture patterns.

What changed

  • New engine implementation: Added youcom search engine in src/engines/youcom/
  • API integration: Implements You.com Search API with both keyless and authenticated modes
  • Configuration updates: Added youcom to SUPPORTED_SEARCH_ENGINES array
  • Runtime registration: Integrated youcom engine into the default search executors
  • Name normalization: Added support for 'you', 'you.com', and 'youcom' engine names
  • Documentation: Updated tool description to mention You.com support

How it works

Keyless Operation (Default)

  • Uses You.com Search API without authentication
  • 100 free searches per day per IP
  • No setup required - works out of the box

Enhanced Operation (Optional)

  • Set YDC_API_KEY environment variable for authenticated access
  • Higher rate limits and enhanced features per You.com plan
  • Graceful fallback to keyless mode if API key is invalid

Usage Examples

MCP Tool Call

{
  "query": "TypeScript tutorials", 
  "engines": ["youcom", "duckduckgo"],
  "limit": 10
}

CLI Usage

npm run search -- --query "AI frameworks" --engines youcom,brave --limit 15

Environment Setup (Optional)

export YDC_API_KEY=your_api_key_here

Error Handling

  • 401 Unauthorized: Clear message about checking YDC_API_KEY
  • 429 Rate Limited: Suggests upgrading to API key for higher limits
  • Network failures: Graceful degradation with informative errors
  • Malformed responses: Validates API response structure

Validation Performed

✅ TypeScript compilation passes without errors
✅ All existing tests continue to pass
✅ You.com engine returns properly formatted SearchResult objects
✅ MCP tool integration works correctly
✅ Engine name normalization handles multiple variants
✅ Both keyless and authenticated modes tested
✅ Error scenarios handled gracefully

Backward Compatibility

  • ✅ No changes to existing engine behavior
  • ✅ No changes to default configuration
  • ✅ youcom engine is opt-in via engines parameter
  • ✅ Existing MCP clients continue to work unchanged

Integration Quality

This integration demonstrates the clean extensibility of open-webSearch's architecture. You.com fits naturally as another search provider in the multi-engine ecosystem, providing users with additional choice for web search without compromising the existing functionality.

The implementation follows all established patterns:

  • Same SearchResult interface as other engines
  • Same error handling patterns
  • Same configuration and registration approach
  • Same optional/fallback philosophy as the rest of the project

Ready for review and merge! 🚀

- Add youcom search engine in src/engines/youcom/
- Implement searchYoucom() function with You.com Search API
- Support both keyless and authenticated (YDC_API_KEY) modes
- Update SUPPORTED_SEARCH_ENGINES to include youcom
- Add engine name normalization for 'you', 'you.com', 'youcom'
- Register youcom engine in runtime configuration
- Update tool description to mention You.com support
- Add comprehensive error handling and fallback behavior
- Maintain backward compatibility with existing engines

Follows existing engine patterns and integrates seamlessly
with the multi-engine MCP server architecture.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant