Skip to content

feat: add You.com Search and Research as web search provider - #175

Open
ydc-oss-bot wants to merge 2 commits into
MiroMindAI:mainfrom
ydc-oss-bot:feat/youcom-search-provider
Open

feat: add You.com Search and Research as web search provider#175
ydc-oss-bot wants to merge 2 commits into
MiroMindAI:mainfrom
ydc-oss-bot:feat/youcom-search-provider

Conversation

@ydc-oss-bot

Copy link
Copy Markdown

Summary

Adds You.com Search and Research APIs as a new MCP server provider, following the existing Serper (Google Search) and Sogou Search MCP server pattern.

Changes

New file: youcom_search_mcp_server.py

A standalone FastMCP server exposing two tools:

  • youcom_search — Web search via the You.com Search API (POST /v1/agents/search). Returns organic results (title, url, snippet) and images.
  • youcom_research — Multi-step research via the You.com Research API (POST /v1/research). Returns a synthesized, well-cited answer with supporting sources. Supports research_effort levels: lite, standard, deep, exhaustive.

Both tools use YDC_API_KEY env var (X-API-Key header), with retry logic (tenacity) and input validation.

Modified: settings.py

  • Added YOUCOM_API_KEY env var (reads YDC_API_KEY)
  • Registered tool-youcom-search in create_mcp_server_parameters() — launches the You.com MCP server as a stdio subprocess, same pattern as tool-google-search and tool-sogou-search
  • Added has_ydc_api_key to get_env_info() for logging

Modified: .env.example

Added YDC_API_KEY entry under a new "You.com Search & Research (optional)" section.

New file: test_youcom_search_mcp_server.py

7 unit tests covering input validation (missing API key, empty query, invalid research effort) and success paths (mocked API responses) for both tools.

Usage

Add tool-youcom-search to an agent's tools list in the config YAML:

sub_agents:
  agent-browsing:
    tools:
      - tool-youcom-search   # You.com Search + Research
      - tool-vqa
      - tool-reader

Set the API key:

export YDC_API_KEY=your_...t

The agent will then have access to youcom_search (fast web search) and youcom_research (deep research with citations) tools.

Testing

python3 libs/miroflow-tools/tests/test_youcom_search_mcp_server.py
# All 7 tests passed.

All Python files pass py_compile checks.

Add youcom_search_mcp_server.py with two tools:
- youcom_search: web search via You.com Search API (POST /v1/agents/search)
- youcom_research: multi-step research with cited answers via You.com Research API (POST /v1/research)

Register as tool-youcom-search in settings.py create_mcp_server_parameters().
Uses YDC_API_KEY env var (X-API-Key header), following existing Serper/Sogou
MCP server pattern. Includes 7 unit tests covering validation and success paths.
Code-review cleanup: MagicMock was imported but never used.
All 7 tests still pass.
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