feat: add You.com Search and Research as web search provider - #175
Open
ydc-oss-bot wants to merge 2 commits into
Open
feat: add You.com Search and Research as web search provider#175ydc-oss-bot wants to merge 2 commits into
ydc-oss-bot wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyA 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. Supportsresearch_effortlevels:lite,standard,deep,exhaustive.Both tools use
YDC_API_KEYenv var (X-API-Key header), with retry logic (tenacity) and input validation.Modified:
settings.pyYOUCOM_API_KEYenv var (readsYDC_API_KEY)tool-youcom-searchincreate_mcp_server_parameters()— launches the You.com MCP server as a stdio subprocess, same pattern astool-google-searchandtool-sogou-searchhas_ydc_api_keytoget_env_info()for loggingModified:
.env.exampleAdded
YDC_API_KEYentry under a new "You.com Search & Research (optional)" section.New file:
test_youcom_search_mcp_server.py7 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-searchto an agent'stoolslist in the config YAML:Set the API key:
export YDC_API_KEY=your_...tThe agent will then have access to
youcom_search(fast web search) andyoucom_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_compilechecks.