Skip to content

feat: add optional You.com web search integration - #44

Open
mouse-value-add wants to merge 1 commit into
forloopcodes:mainfrom
mouse-value-add:feat/youcom-web-search-integration
Open

feat: add optional You.com web search integration#44
mouse-value-add wants to merge 1 commit into
forloopcodes:mainfrom
mouse-value-add:feat/youcom-web-search-integration

Conversation

@mouse-value-add

Copy link
Copy Markdown

Summary

This PR adds an optional You.com web search MCP tool to complement Context+'s existing local semantic search capabilities with external web knowledge.

What Changed

  • Added MCP tool - searches the web using You.com Search API
  • Flexible authentication - works with optional or falls back to keyless operation (100 free searches/day)
  • Comprehensive parameters - supports query, count, domains, freshness filters, localization
  • Error handling - graceful fallbacks with actionable error messages
  • Documentation - updated README with setup, usage examples, and configuration
  • Test coverage - complete test suite for all functionality

Integration Architecture

The web search tool follows Context+'s existing MCP tool patterns:

  • Registered as alongside semantic search tools
  • Uses same wrapper for consistency
  • Follows existing error handling and response formatting conventions
  • No breaking changes - purely additive functionality

Usage Example

Setup

Optional authentication:

Keyless mode (no API key needed):

  • Works out of the box with 100 free searches per day per IP
  • No configuration required

Validation Performed

✅ TypeScript compilation and linting passes
✅ All existing tests continue to pass (245/245)
✅ New web search tests pass (9/9)
✅ MCP tool registration works correctly
✅ Both keyless and authenticated operation modes tested
✅ Error scenarios handled gracefully (401, 429, network failures)
✅ Backward compatibility maintained - existing functionality unchanged
✅ Follows all established MCP tool patterns and architecture

Fallback/Error Behavior

  • Missing API key: Uses keyless You.com Search API automatically
  • Rate limits (429): Clear error suggesting API key upgrade with guidance
  • Invalid API key (401): Informative error about checking YDC_API_KEY variable
  • Network failures: Graceful error handling with context
  • Malformed responses: Validates response structure with helpful error messages
  • All errors maintain MCP server functionality and provide actionable guidance

Why This Integration Benefits Context+

Context+ excels at local codebase intelligence through semantic search, AST analysis, and memory graphs. Adding web search provides:

  1. Current information - Access to latest documentation, frameworks, and best practices
  2. External research - Complement local code analysis with broader ecosystem knowledge
  3. Problem solving - Find solutions to specific technical challenges beyond the local codebase
  4. Technology research - Research new libraries, patterns, and approaches for development

This creates a powerful combination: deep local code understanding + current external knowledge.


Related tracking issue: youdotcom-oss/integration-tracking#163

The integration is purely optional and follows Context+'s high-quality standards. Happy to adjust the implementation based on feedback!

- Add web_search tool using You.com Search API
- Support both authenticated (YDC_API_KEY) and keyless operation
- Complement existing semantic search with external web knowledge
- Include comprehensive error handling and parameter validation
- Add usage examples and configuration documentation
- Include test coverage for all functionality

The web search tool provides external information to enhance
Context+'s local semantic intelligence, enabling agents to access
current web knowledge alongside codebase analysis.
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

@mouse-value-add is attempting to deploy a commit to the ForLoopCodes' projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant