feat: add optional You.com MCP server integration - #4770
Conversation
- Add comprehensive You.com MCP integration documentation to MCP.md - Include configuration examples for both authenticated and keyless operation - Add hosted SSE server option using https://api.you.com/mcp - Document available tools: you-search, you-contents, you-research - Add practical usage examples and error handling guidance - Include example configuration file for easy setup - Update main README with MCP integration quick start guide This integration enables AI-Native IDE users to access current web search, content extraction, and cited research capabilities through You.com's MCP server, enhancing AI assistant functionality with up-to-date information.
|
|
Walkthrough新增 You.com MCP 搜索集成说明、配置示例和完整文档,覆盖服务配置、搜索工具、认证选项、配额限制及错误处理。 ChangesYou.com MCP 集成
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@examples/youcom-mcp-config.json`:
- Around line 14-18: 为旧配置中的所有 STDIO 服务器补全类型字段,确保迁移逻辑能够识别它们:在
examples/youcom-mcp-config.json 的 14-18 行添加 type 为 stdio 并显式设置 enabled 为 true;在
packages/ai-native/MCP.md 的 203-210 行和 219-225 行的本地配置示例中添加 type 为 stdio。
- Around line 5-10: Rewrite the hosted You.com MCP examples in
examples/youcom-mcp-config.json (lines 5-10), README.md (lines 76-82), and
packages/ai-native/MCP.md (lines 234-243) to use type "sse" with url
"https://api.you.com/mcp" instead of command-based stdio configuration; remove
the remote env mapping and pass YDC_API_KEY through an Authorization Bearer
value or the SSE transportOptions.authProvider.token configuration in each
affected example.
In `@packages/ai-native/MCP.md`:
- Around line 205-206: 更新 MCP.md 中 You.com MCP 配置示例的 args,将不可用的
`@youdotcom/mcp-server` 替换为 `@youdotcom-oss/mcp`,并同步修改后续所有重复的 You.com MCP 安装示例。
- Around line 302-312: 将 Error Handling 章节改为与当前实现一致的可验证描述:不要宣称已支持
429、401、网络错误、malformed response 的专项提示或 fallback,除非能在 addExternalMCPServers 及 SSE
错误处理流程中补齐实现并提供测试依据;否则仅描述现有 logger 记录和启动异常捕获行为。
- Around line 277-283: Update the you-research example in the “Research with
Citations” section to replace sources_count with the MCP-supported
source_control parameter. Preserve query and only retain research_effort if
needed; do not document sources_count as an input.
- Around line 215-228: 更新 MCP.md 中 youcom-search 的 keyless 本地配置:移除
--keyless,改为省略 YDC_API_KEY 并在 env 中设置 YDC_PROFILE=free。同步修正远程 free profile 说明,使用
https://api.you.com/mcp?profile=free,并明确该 profile 仅提供 you-search、每日限制 100 次,不包含
you-contents 或 you-research。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d7fb6baa-7bed-4d14-8dd2-7db14d0b445b
📒 Files selected for processing (3)
README.mdexamples/youcom-mcp-config.jsonpackages/ai-native/MCP.md
| "type": "sse", | ||
| "command": "https://api.you.com/mcp", | ||
| "args": [], | ||
| "enabled": true, | ||
| "env": { | ||
| "YDC_API_KEY": "${env:YDC_API_KEY}" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== repo files of interest =="
git ls-files | rg 'examples/youcom-mcp-config\.json|README\.md|packages/ai-native/MCP\.md|mcp|server|SSE|ai\.native\.mcp|servers|transportOptions|serverHost|url' || true
echo
echo "== example config =="
cat -n examples/youcom-mcp-config.json 2>/dev/null || true
echo
echo "== relevant README lines =="
rg -n -C 3 'youcom-web|ai\.native\.mcp\.servers|You\.com|command|url|transportOptions|serverHost|YDC_API_KEY' README.md || true
echo
echo "== relevant MCP docs lines =="
rg -n -C 3 'youcom-web|ai\.native\.mcp\.servers|You\.com|command|url|transportOptions|serverHost|YDC_API_KEY|type: "sse"|type: "stdio"' packages/ai-native/MCP.md || trueRepository: opensumi/core
Length of output: 15565
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== mcp config service outline =="
ast-grep outline packages/ai-native/src/browser/mcp/config/mcp-config.service.ts --view expanded || true
echo
echo "== search for serverHost/url/transportOptions in ai-native =="
rg -n -C 4 'serverHost|transportOptions|url|type.*sse|sse|type.*stdio|stdio|mcp.*server' packages/ai-native/src packages/ai-native/__test__ packages/extension/src/hosted packages/core-common src scripts || true
echo
echo "== relevant config service sections =="
wc -l packages/ai-native/src/browser/mcp/config/mcp-config.service.ts packages/ai-native/src/node/mcp-server.sse.ts packages/ai-native/src/node/mcp-server.stdio.ts packages/ai-native/src/node/mcp-server-manager-impl.ts packages/ai-native/src/common/mcp-server-manager.ts packages/extension/src/hosted/api/vscode/ext.host.urls.ts packages/core-common/src/common-module/credential.server.tsRepository: opensumi/core
Length of output: 50372
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== config service focused search =="
rg -n -C 5 'url|transportOptions|serverHost|command|type|args|env|sse|stdio|MCP_SERVER_TYPE|MCPServers' packages/ai-native/src/browser/mcp/config packages/ai-native/src/common/mcp-server-manager.ts packages/ai-native/src/node/mcp-server.sse.ts packages/ai-native/src/node/mcp-server.stdio.ts packages/core-common/src/settings/ai-native.ts || true
echo
echo "== file sections =="
sed -n '1,260p' packages/ai-native/src/browser/mcp/config/mcp-config.service.ts
echo "---"
sed -n '1,220p' packages/ai-native/src/node/mcp-server.sse.ts
echo "---"
sed -n '1,140p' packages/ai-native/src/common/mcp-server-manager.tsRepository: opensumi/core
Length of output: 50370
🌐 Web query:
You.com MCP server command line YDC_API_KEY bearer token
💡 Result:
To use your You.com API key with an MCP (Model Context Protocol) server, you can authenticate via a bearer token for remote HTTP connections or by setting an environment variable for local STDIO connections [1][2][3]. You can obtain your API key at the You.com platform portal [1][4][5]. ### Authentication Methods 1. Remote HTTP Server (Recommended) If your MCP client supports remote HTTP connections, you do not need to install the server locally [1][3]. Configure your client to connect to https://api.you.com/mcp and include the API key in the request headers [1][3]. Example configuration for an MCP client: { "mcpServers": { "ydc-server": { "type": "http", "url": "https://api.you.com/mcp", "headers": { "Authorization": "Bearer <YDC_API_KEY>" } } } } 2. Local STDIO Server If your client requires running the server as a local process, use the @youdotcom-oss/mcp package [6][7]. In this setup, provide the API key as the YDC_API_KEY environment variable [2][6][8]. Example configuration for an MCP client: { "mcpServers": { "ydc-server": { "command": "npx", "args": ["-y", "@youdotcom-oss/mcp"], "env": { "YDC_API_KEY": "<YDC_API_KEY>" } } } } ### Notes - Free Tier: If you do not provide an API key, the server may operate in a limited free tier (often restricted to you-search only, depending on the profile) [2][4][3]. - OAuth 2.1: Some remote clients support OAuth 2.1, which allows you to connect without manually managing an API key by triggering an automated browser-based authorization flow [1][2][3]. - Gemini CLI: Note that some clients, such as the Gemini CLI, may require using httpUrl instead of url in their configuration [9]. Always ensure your API key is kept secure and not hardcoded in publicly accessible repositories [8].
Citations:
- 1: https://you.com/docs/capabilities/mcp-server-for-web-search
- 2: https://you.com/docs/build-with-agents/mcp-server.md
- 3: https://you.com/docs/build-with-agents/mcp-server
- 4: https://github.com/youdotcom-oss/dx-toolkit
- 5: https://old-docs.you.com/tools/mcp-server
- 6: https://registry.npmjs.org/@youdotcom-oss/mcp
- 7: https://registry.npmjs.org/%40youdotcom-oss%2Fmcp
- 8: https://github.com/brainsparker/youdotcom-mcp-server
- 9: https://you.com/docs/build-with-agents/agent-harnesses/gemini-cli
🌐 Web query:
@mcp sdk SSEClientTransport options Authorization headers Bearer token
💡 Result:
To provide Bearer token authentication for the MCP SDK's SSEClientTransport, you should use the authProvider option provided in SSEClientTransportOptions [1][2][3]. Recommended Approach: Using authProvider The SDK provides a dedicated authProvider property designed to handle authentication automatically [1][4][3]. For simple bearer tokens, you can pass an object with a token function [1][4]: const transport = new SSEClientTransport(new URL(serverUrl), { authProvider: { token: async => "your-bearer-token" } }); When an authProvider is provided, the SDK automatically attaches the Authorization header to outgoing requests [1][4]. If the server responds with a 401, the SDK can handle refreshes if an onUnauthorized callback is implemented [1][2][3]. Manual Header Configuration (Alternative) If you need to configure headers manually (e.g., for specific requirements not covered by the authProvider), you can pass a custom fetch implementation via the top-level fetch option in SSEClientTransportOptions [2][3][5]. Be aware of the following technical details: 1. SSE/GET vs. POST: The SSE transport uses two channels: a GET request for the initial SSE stream and POST requests for messages [1][5]. Setting headers solely via requestInit may only secure the POST channel [5]. To ensure headers reach both, using the authProvider or a custom fetch wrapper is preferred [1][5]. 2. Header Duplication: If you use both requestInit.headers and a custom eventSourceInit.fetch wrapper, you may inadvertently create duplicate Authorization headers (e.g., Bearer X, Bearer X), which some servers reject [6]. The best practice is to centralize header injection through the top-level fetch option to avoid these conflicts [6][5]. 3. Header Normalization: Recent versions of the SDK (e.g., v1.x and main branches) include fixes for header normalization, ensuring that Headers instances and plain objects are handled consistently [7]. Note: The SSEClientTransport is currently marked as deprecated in favor of StreamableHTTPClientTransport where possible [8]. If your use case allows, consider migrating to the newer transport type.
Citations:
- 1: https://ts.sdk.modelcontextprotocol.io/v2/api/@modelcontextprotocol/client/client/sse.html
- 2: https://ts.sdk.modelcontextprotocol.io/v2/types/_modelcontextprotocol_client.client_sse.SSEClientTransportOptions.html
- 3: https://github.com/modelcontextprotocol/typescript-sdk/blob/327243ce/packages/client/src/client/sse.ts
- 4: https://github.com/modelcontextprotocol/typescript-sdk/blob/cc4b4161/packages/client/src/client/sse.ts
- 5: https://gist.github.com/Anirudhx7/e68ce79bcd994734e37c63bf9a6996e4
- 6: SSE client: duplicate Authorization header when using eventSourceInit.fetch + requestInit.headers modelcontextprotocol/typescript-sdk#1872
- 7: SSE client is not adding headers from requestInit? in _commonHeaders method modelcontextprotocol/typescript-sdk#436
- 8: https://ts.sdk.modelcontextprotocol.io/v2/classes/_modelcontextprotocol_client.client_sse.SSEClientTransport.html
重写 hosted You.com 配置示例。不要用 command: "npx",改用 type: "sse" + url: "https://api.you.com/mcp",并把 YDC_API_KEY 转为 Authorization: Bearer ... 或 SSE transportOptions.authProvider.token。
同一问题出现在 examples/youcom-mcp-config.json、README.md 和 packages/ai-native/MCP.md,当前示例会按 stdio 启动本地进程,或错误地传递 remote env 给 SSE 运输层。
📍 Affects 3 files
examples/youcom-mcp-config.json#L5-L10(this comment)README.md#L76-L82packages/ai-native/MCP.md#L234-L243
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/youcom-mcp-config.json` around lines 5 - 10, Rewrite the hosted
You.com MCP examples in examples/youcom-mcp-config.json (lines 5-10), README.md
(lines 76-82), and packages/ai-native/MCP.md (lines 234-243) to use type "sse"
with url "https://api.you.com/mcp" instead of command-based stdio configuration;
remove the remote env mapping and pass YDC_API_KEY through an Authorization
Bearer value or the SSE transportOptions.authProvider.token configuration in
each affected example.
| "name": "filesystem", | ||
| "command": "npx", | ||
| "args": ["-y", "@modelcontextprotocol/server-filesystem", "${workspaceFolder}"], | ||
| "env": {} | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
统一补全旧配置数组中的 STDIO 类型。
ai.native.mcp.servers 的迁移逻辑依赖 server.type。缺少该字段的 STDIO 条目不会进入新的 mcpServers 配置。
- examples/youcom-mcp-config.json#L14-L18:添加
"type": "stdio",并显式设置"enabled": true。 - packages/ai-native/MCP.md#L203-L210:为认证版本地配置添加
"type": "stdio"。 - packages/ai-native/MCP.md#L219-L225:为 keyless 本地配置添加
"type": "stdio"。
📍 Affects 2 files
examples/youcom-mcp-config.json#L14-L18(this comment)packages/ai-native/MCP.md#L203-L210packages/ai-native/MCP.md#L219-L225
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@examples/youcom-mcp-config.json` around lines 14 - 18, 为旧配置中的所有 STDIO
服务器补全类型字段,确保迁移逻辑能够识别它们:在 examples/youcom-mcp-config.json 的 14-18 行添加 type 为
stdio 并显式设置 enabled 为 true;在 packages/ai-native/MCP.md 的 203-210 行和 219-225
行的本地配置示例中添加 type 为 stdio。
| "command": "npx", | ||
| "args": ["-y", "@youdotcom/mcp-server"], |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -u
# 检查两个包名的当前状态。
for package in '`@youdotcom/mcp-server`' '`@youdotcom-oss/mcp`'; do
echo "== $package =="
npm view "$package" name version dist-tags --json || true
doneRepository: opensumi/core
Length of output: 1860
🏁 Script executed:
#!/usr/bin/env bash
set -u
echo "== file outline =="
wc -l packages/ai-native/MCP.md
echo "== occurrences =="
rg -n "\"`@youdotcom`(-oss)/mcp(-server)?" packages/ai-native/MCP.md || true
echo "== relevant docs slice =="
sed -n '180,220p' packages/ai-native/MCP.md
echo "== public npm metadata =="
npm view '`@youdotcom-oss/mcp`' name version dist-tags --json
npm view '`@youdotcom-oss/mcp`' readme --json | python3 -c 'import json,sys,re; data=json.load(sys.stdin); print(data[0:-512] if len(data)>512 else data)'Repository: opensumi/core
Length of output: 3474
更新本地 MCP 包名。
@youdotcom/mcp-server 在 npm 上不可用;You.com 当前发布名称为 @youdotcom-oss/mcp。请将 packages/ai-native/MCP.md 中该示例行的 args 改为 ["-y", "@youdotcom-oss/mcp"],并同步后续重复的 You.com MCP 安装示例。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/ai-native/MCP.md` around lines 205 - 206, 更新 MCP.md 中 You.com MCP
配置示例的 args,将不可用的 `@youdotcom/mcp-server` 替换为 `@youdotcom-oss/mcp`,并同步修改后续所有重复的
You.com MCP 安装示例。
| For keyless operation (100 free searches/day): | ||
|
|
||
| ```json | ||
| { | ||
| "ai.native.mcp.servers": [ | ||
| { | ||
| "name": "youcom-search", | ||
| "command": "npx", | ||
| "args": ["-y", "@youdotcom/mcp-server", "--keyless"], | ||
| "env": {} | ||
| } | ||
| ] | ||
| } | ||
| ``` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
# 检查当前包支持的无密钥配置。
npm view '`@youdotcom-oss/mcp`' readme --json |
rg -n 'YDC_PROFILE|profile=free|keyless|you-search'Repository: opensumi/core
Length of output: 2613
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "Tracked MCP.md files:"
git ls-files | rg '(^|/)MCP\.md$'
echo
echo "Relevant sections:"
for f in $(git ls-files | rg '(^|/)MCP\.md$'); do
echo "--- $f ---"
rg -n -C 8 'keyless|youcom-search|`@youdotcom/mcp-server`|`@youdotcom-oss/mcp`|profile=free|you-contents|you-research' "$f" || true
doneRepository: opensumi/core
Length of output: 2606
🌐 Web query:
@youdotcom/mcp-server npm keyless YDC_PROFILE free profile
💡 Result:
The @youdotcom-oss/mcp package is the official NPM package for the You.com MCP server [1][2]. It supports a free, keyless tier that provides access to basic web search capabilities [3][4]. To use the free, keyless profile, you can set the YDC_PROFILE environment variable to free [1][5]. This configuration routes the bridge to a specialized endpoint (https://api.you.com/mcp?profile=free) that allows unauthenticated access to the you-search tool [2][6][7]. Key details regarding the free profile: - Functionality: It is restricted to search-only mode [2][3][7]. - Exclusions: It does not expose advanced tools such as you-research, you-contents, you-finance, you-balance, or you-discover [3][6][8]. - Precedence: Setting YDC_PROFILE to free takes precedence over YDC_ALLOWED_TOOLS configurations [3][6]. - Limitations: The free tier is subject to usage rate limits, specifically capped at 100 queries per day [6][9][10]. Example configuration for an MCP client: { "mcpServers": { "you": { "command": "npx", "args": ["@youdotcom-oss/mcp"], "env": { "YDC_PROFILE": "free" } } } } If you require access to the full suite of tools (e.g., research, content extraction, finance), you must unset YDC_PROFILE and provide a valid YDC_API_KEY [3][7][9].
Citations:
- 1: https://www.npmjs.com/package/@youdotcom-oss/mcp
- 2: https://registry.npmjs.org/%40youdotcom-oss%2Fmcp
- 3: https://you.com/docs/build-with-agents/mcp-server.md
- 4: https://mcp.pub/servers/youcom-web-access-ai/
- 5: https://github.com/youdotcom-oss/dx-toolkit/blob/main/packages/mcp/README.md
- 6: https://you.com/docs/build-with-agents/mcp-server
- 7: https://github.com/youdotcom-oss/dx-toolkit
- 8: https://you.com/resources/hermes-agent-ydc-web-search-skills-that-improve-themselves
- 9: https://you.com/docs/build-with-agents/agent-harnesses/pi
- 10: [Integration] youdotcom-oss/youdotcom-python-sdk — Temporal plugin (AI Partner Ecosystem) youdotcom-oss/integration-tracking#10
🌐 Web query:
@youdotcom-oss/mcp README tools YDC_ALLOWED_TOOLS profile=free search-only
💡 Result:
In the @youdotcom-oss/mcp package, the environment variable YDC_PROFILE=free enables a search-only, unauthenticated mode [1][2]. When YDC_PROFILE is set to free, it takes precedence over the YDC_ALLOWED_TOOLS configuration [3][4]. Consequently, while YDC_ALLOWED_TOOLS is typically used to create a comma-separated allowlist of specific hosted tool IDs (such as you-search, you-research, you-contents, or you-finance) [1][2], setting YDC_PROFILE=free overrides this and restricts access exclusively to the you-search tool [1][5]. Other tools, including you-research, you-contents, you-finance, and livecrawl, are not exposed when the free profile is active [3][2].
Citations:
- 1: https://www.npmjs.com/package/@youdotcom-oss/mcp
- 2: https://github.com/youdotcom-oss/dx-toolkit/blob/main/packages/mcp/README.md
- 3: https://you.com/docs/build-with-agents/mcp-server
- 4: https://github.com/youdotcom-oss/dx-toolkit/tree/main/packages/mcp
- 5: https://github.com/youdotcom-oss/dx-toolkit
🌐 Web query:
@youdotcom-oss/mcp command @youdotcom/mcp-server --keyless
💡 Result:
There is no --keyless flag for the @youdotcom-oss/mcp command [1][2]. The @youdotcom-oss/mcp package is a bridge that proxies STDIO MCP traffic to the hosted You.com MCP server [2][3]. To achieve "keyless" behavior (accessing the server without providing an API key), you should use the YDC_PROFILE environment variable instead [1][4]: 1. To run in a search-only free tier mode without an API key, set the environment variable YDC_PROFILE to free [1][3]. 2. In your MCP configuration (such as for Claude Desktop), it would look like this [4]: { "mcpServers": { "you": { "command": "npx", "args": ["@youdotcom-oss/mcp"], "env": { "YDC_PROFILE": "free" } } } } The free profile is restricted to search-only functionality and does not support advanced tools like you-research, you-contents, or you-finance [1][2]. If you do not set YDC_PROFILE to free, the server defaults to requiring a YDC_API_KEY environment variable for authenticated access [1][5].
Citations:
- 1: https://you.com/docs/build-with-agents/mcp-server
- 2: https://www.npmjs.com/package/@youdotcom-oss/mcp
- 3: https://github.com/youdotcom-oss/dx-toolkit/blob/main/packages/mcp/README.md
- 4: https://github.com/youdotcom-oss/youdotcom-mcp-server
- 5: https://you.com/docs/build-with-agents/mcp-server.md
🌐 Web query:
you.com docs build-with-agents mcp-server profile=free tool you-research you-contents
💡 Result:
The You.com Model Context Protocol (MCP) server enables AI agents to access real-time web search and content processing capabilities [1][2]. You can connect to the hosted MCP server at https://api.you.com/mcp or run it locally using the @youdotcom-oss/mcp package [1][3][4]. The You.com MCP server provides a flexible tier system for tool access [5][3]. The free tier is accessible by configuring the server with a profile parameter, such as?profile=free [5][3]. Tool Availability and Authentication: 1. Free Tier (?profile=free): Exposes the you-search tool, which provides web and news search capabilities [5][3]. This tier requires no API key or signup [5][3]. 2. Authenticated Access: By providing a valid You.com API key (via header or environment variable), users unlock additional tools including you-contents (page-content extraction) and you-research (deep, multi-source, citation-backed research) [5][3][6]. To configure the server: - Remote HTTP: Point your client to https://api.you.com/mcp?profile=free (for the free tier) or https://api.you.com/mcp (with Authorization: Bearer <API_KEY> for full access) [1][5][3]. - Local Stdio: Use npx @youdotcom-oss/mcp. If running locally, you can set the YDC_PROFILE environment variable to free or provide a YDC_API_KEY for full access [5][3][4]. Additionally, You.com provides a separate, read-only Docs MCP Server at https://you.com/docs/_mcp/server, which gives agents access to You.com's developer documentation using the searchDocs tool without requiring an API key [7][8].
Citations:
- 1: https://you.com/docs/build-with-agents/mcp-server
- 2: https://you.com/docs/capabilities/mcp-server-for-web-search
- 3: https://github.com/youdotcom-oss/dx-toolkit
- 4: https://old-docs.you.com/tools/mcp-server
- 5: https://you.com/docs/build-with-agents/agent-harnesses/codex-cli
- 6: https://docs.crewai.com/v1.14.4/en/tools/search-research/youai-search
- 7: https://you.com/docs/build-with-agents/docs-mcp-server
- 8: https://you.com/docs/build-with-agents/mcp-server.md
修正 You.com keyless 配置的命令与工具范围。
@youdotcom/mcp-server --keyless 不是官方支持的无密钥方式;无密钥 free profile 是省略 YDC_API_KEY 并设置 YDC_PROFILE=free,或远程使用 https://api.you.com/mcp?profile=free。profile=free 只暴露 you-search,限制每天 100 次查询,不包含 you-contents 和 you-research。请同时更新 line 223 的本地配置和 line 293 附近关于远程 free profile 的说明。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/ai-native/MCP.md` around lines 215 - 228, 更新 MCP.md 中 youcom-search
的 keyless 本地配置:移除 --keyless,改为省略 YDC_API_KEY 并在 env 中设置 YDC_PROFILE=free。同步修正远程
free profile 说明,使用 https://api.you.com/mcp?profile=free,并明确该 profile 仅提供
you-search、每日限制 100 次,不包含 you-contents 或 you-research。
| **Research with Citations:** | ||
| ```typescript | ||
| // Get researched summary with sources | ||
| const research = await mcpClient.callTool('you-research', { | ||
| query: 'React Server Components best practices 2024', | ||
| sources_count: 5 | ||
| }); |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
# 读取当前 MCP 工具的输入 schema。
npx --yes `@youdotcom-oss/cli` schema you-search input
npx --yes `@youdotcom-oss/cli` schema you-contents input
npx --yes `@youdotcom-oss/cli` schema you-research inputRepository: opensumi/core
Length of output: 1212
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "Repository files mentioning you-research / MCP schema:"
rg -n "you-research|sources_count|research_effort|tool:|MCP|`@youdotcom-oss/cli`" packages/ai-native/MCP.md packages -S || true
echo
echo "MCP outline if file exists:"
if [ -f packages/ai-native/MCP.md ]; then
wc -l packages/ai-native/MCP.md
sed -n '1,340p' packages/ai-native/MCP.md
fiRepository: opensumi/core
Length of output: 50370
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "MCP.md You.com section:"
sed -n '190,300p' packages/ai-native/MCP.md
echo
echo "Lockfile/package reference for `@youdotcom-oss/cli`:"
rg -n "`@youdotcom-oss/cli`|youdotcom-oss" package.json pnpm-lock.yaml yarn.lock package-lock.json packages -S || true
echo
echo "Search for installed `@youdotcom-oss` CLI package metadata if available:"
find /home/jailuser/.npm -name 'package.json' -path '*`@youdotcom-oss`*cli*' -print 2>/dev/null | head -20Repository: opensumi/core
Length of output: 3192
🌐 Web query:
You.com MCP server you-research inputSchema sources_count
💡 Result:
The official You.com MCP server does not have a parameter named sources_count in its you-research tool's input schema [1][2][3]. The you-research tool is designed for citation-backed synthesis and accepts the following input parameters: * query (string, required): The research question or complex query to investigate [4][5]. * research_effort (string, optional): Determines the depth of research, with supported values including lite, standard, deep, exhaustive, and frontier [1][5]. * source_control (object, optional): Used for filtering based on domains, freshness, and geography [4][5]. * output_schema (object, optional): Used for requesting structured JSON output (not compatible with lite effort) [4][5]. * background (boolean, optional): If set to true, executes the request asynchronously [5]. While some other technical tools or APIs in the MCP ecosystem (such as those for news aggregation or document indexing) may include a sources_count field in their output responses to indicate the number of sources processed or found [6][7], it is not a part of the you-research tool's input specification [4][5].
Citations:
- 1: https://you.com/docs/build-with-agents/mcp-server
- 2: https://you.com/docs/capabilities/mcp-server-for-web-search
- 3: https://you.com/resources/the-ydc-mcp-server-comes-to-warp
- 4: https://you.com/docs/api-reference/research/v1-research
- 5: https://you.com/docs/guides/research
- 6: https://github.com/L-1ngg/WebSearchMCP/blob/main/docs/README_EN.md
- 7: https://libraries.io/npm/@newsmcp%2Fserver
修正 you-research 示例中的参数成 source_control。
you-research MCP schema 不直接使用 sources_count;文档中仍用 OpenSearch Research API 输出字段示例。若示例需要限制引用数量,使用 source_control 并保留 query、如需要可保留 research_effort。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/ai-native/MCP.md` around lines 277 - 283, Update the you-research
example in the “Research with Citations” section to replace sources_count with
the MCP-supported source_control parameter. Preserve query and only retain
research_effort if needed; do not document sources_count as an input.
| #### Error Handling | ||
|
|
||
| The You.com MCP server handles common error scenarios gracefully: | ||
|
|
||
| - **Rate Limiting (429):** Provides clear guidance on API key upgrade options | ||
| - **Invalid API Key (401):** Helpful error message about checking YDC_API_KEY | ||
| - **Network Issues:** Graceful degradation with fallback suggestions | ||
| - **Malformed Responses:** Input validation with actionable error messages | ||
|
|
||
| All errors maintain the IDE's functionality and provide actionable guidance for developers. | ||
|
|
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
# 搜索实际的错误处理和降级实现。
rg -n -C 6 \
'429|401|fallback|Malformed|addExternalMCPServers|SSEMCPServer|logger\.(error|warn)' \
packages/ai-nativeRepository: opensumi/core
Length of output: 50370
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "## Relevant MCP.md section"
sed -n '240,320p' packages/ai-native/MCP.md
echo
echo "## Node source files listing"
git ls-remote --heads origin | head -1 || true
git ls-files 'packages/ai-native/src/node/**/mcp*' 'packages/ai-native/src/node/**/mcp-server*' | sort
echo
echo "## SSE server source outline and relevant content"
wc -l packages/ai-native/src/node/mcp-server.sse.ts
cat -n packages/ai-native/src/node/mcp-server.sse.ts
echo
echo "## You.com/YDC mentions"
rg -n -i -C 4 'you\.com|YDC_API_KEY|You\.com|you' packages/ai-native || true
echo
echo "## SSE and manager exception/error handling"
rg -n -C 5 'new SSEMCPServer|addExternalMCPServers|try \{|catch \(.*error\)|logger\.(error|log|warn|info)|isError|callTool|listTools' packages/ai-native/src/node/mcp-server-manager-impl.ts packages/ai-native/src/node/mcp-server.sse.ts packages/ai-native/src/node/mcp/sumi-mcp-server.ts || trueRepository: opensumi/core
Length of output: 50370
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "## Tests around SSEMCPServer implementation behavior"
wc -l packages/ai-native/__test__/node/mcp-server.sse.test.ts
cat -n packages/ai-native/__test__/node/mcp-server.sse.test.ts
echo
echo "## HTTP MCP fallback-related definitions in source (excluding tests)"
rg -n -C 6 'fallbackTool|fallback|invokeCapabilityTool|fallback to|callTool|isError' packages/ai-native/src node_modules/@modelcontextprotocol 2>/dev/null | head -300 || trueRepository: opensumi/core
Length of output: 32127
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "## Relevant MCP.md section"
sed -n '240,320p' packages/ai-native/MCP.md
echo
echo "## Node source files listing"
git ls-files 'packages/ai-native/src/node/**/mcp*' 'packages/ai-native/src/node/**/mcp-server*' | sort
echo
echo "## SSE server source outline and relevant content"
wc -l packages/ai-native/src/node/mcp-server.sse.ts
cat -n packages/ai-native/src/node/mcp-server.sse.ts
echo
echo "## You.com/YDC mentions"
rg -n -i -C 4 'you\.com|YDC_API_KEY|You\.com|you' packages/ai-native || true
echo
echo "## SSE and manager exception/error handling"
rg -n -C 5 'new SSEMCPServer|addExternalMCPServers|try \{|catch \(.*error\)|logger\.(error|log|warn|info)|isError|callTool|listTools' packages/ai-native/src/node/mcp-server-manager-impl.ts packages/ai-native/src/node/mcp-server.sse.ts packages/ai-native/src/node/mcp/sumi-mcp-server.ts || true
echo "## Tests around SSEMCPServer implementation behavior"
wc -l packages/ai-native/__test__/node/mcp-server.sse.test.ts
cat -n packages/ai-native/__test__/node/mcp-server.sse.test.ts
echo
echo "## HTTP MCP fallback-related definitions in source (excluding tests)"
rg -n -C 6 'fallbackTool|fallback|invokeCapabilityTool|fallback to|callTool|isError' packages/ai-native/src node_modules/@modelcontextprotocol 2>/dev/null | head -300 || trueRepository: opensumi/core
Length of output: 50370
将错误处理章节改为可验证的行为描述。
这些行声称 You.com MCP 会处理 429、401、网络错误和 malformed response,并提供 fallback。当前 packages/ai-native/src/node 中只能看到 SSE 连接的错误通过 logger 记录,addExternalMCPServers 也只能捕获启动异常;缺少按状态码/响应错误的用户提示或 fallback 实现。如果没有实际支持,请使用建议用语;如果已支持,需要补充对应的实现或测试依据。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/ai-native/MCP.md` around lines 302 - 312, 将 Error Handling
章节改为与当前实现一致的可验证描述:不要宣称已支持 429、401、网络错误、malformed response 的专项提示或 fallback,除非能在
addExternalMCPServers 及 SSE 错误处理流程中补齐实现并提供测试依据;否则仅描述现有 logger 记录和启动异常捕获行为。
Summary
This PR adds comprehensive integration documentation and configuration examples for You.com's MCP (Model Context Protocol) server, enabling OpenSumi users to add web search, content extraction, and research capabilities to their AI-Native IDE.
What's Added
Documentation
Configuration Support
Available Tools
Benefits for OpenSumi Users
Integration Approach
This follows OpenSumi's existing MCP architecture patterns:
Validation
This integration provides immediate value to OpenSumi users developing with AI assistance, enabling access to current web information and research capabilities that complement the existing file system and workspace tools.
Summary by CodeRabbit
新功能
文档