web search

更新时间:
复制 MD 格式

Add a web search tool to Coding Plan so the model can retrieve real-time information.

Availability

Applies to tools that extend web search through Model Context Protocol (MCP), such as Qwen Code and Claude Code. Some tools, such as Cursor, have built-in web search and don't require a separate service.

Prerequisites

  1. You have subscribed to Coding Plan. See Getting started.

  2. You have set up a Coding Plan tool, such as Claude Code or Qwen Code, and can chat. See Clients and developer tools.

  3. You have obtained an Alibaba Cloud Model Studio API key. This is the general-purpose Model Studio API key (format: sk-xxx) for calling the MCP service. It's different from the Coding Plan-specific API key (format: sk-sp-xxx).

Enable or upgrade web search MCP

The web search MCP has been upgraded from the legacy Server-Sent Events (SSE) protocol to the new Streamable HTTP protocol. Choose your scenario:

First-time activation (new users)

  1. Go to the MCP Marketplace in Model Studio and locate the Web Search MCP service.

  2. Click Enable Now > Confirm activation.

    • The web search MCP offers a free quota of 2,000 calls for all users. After the free quota is used up, the service is billed at CNY 29 per 1,000 calls. If you use a third-party MCP service, it may have its own charges. See the service description.

  3. After the service is enabled, get the following configuration:

    1. Streamable HTTP endpoint: The MCP service connection address. The web search MCP endpoint is https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp.

    2. API key: The Model Studio API key for authenticating with the MCP service.

Upgrade protocol (existing users)

  1. Go to the MCP Marketplace in Model Studio and find the Web Search MCP service.

  2. Click Cancel activation, then click Enable Now.

    • The web search MCP offers a free quota of 2,000 calls for all users. After the free quota is used up, the service is billed at CNY 29 per 1,000 calls. If you use a third-party MCP service, it may have its own charges. For more information, see the service description.

  3. After you re-enable the service, the protocol is upgraded. Get the following configuration:

    1. Streamable HTTP endpoint: The MCP service connection address. The web search MCP endpoint is https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp.

    2. API Key: The Model Studio API key. This key is used for authentication with the MCP service.

Integrate with tools

Add the MCP service to your AI programming tool.

OpenClaw

  1. Install MCPorter.

    npm install -g mcporter
  2. Enable MCPorter.

    openclaw config set skills.entries.mcporter.enabled true
  3. In the ~/.openclaw/workspace directory, run the following command. Before you run the command, replace YOUR_API_KEY with the Alibaba Cloud Model Studio API key that you obtained when you enabled or upgraded the web search MCP.

    mcporter config add WebSearch https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp --transport http --header "Authorization=Bearer YOUR_API_KEY" --scope home
  4. In the ~/.openclaw/workspace directory, run the following command to confirm that the MCP is installed.

    mcporter list

    image

  5. Run the following command to apply the configuration.

    openclaw gateway restart
  6. Send the prompt Use mcporter to search for news about Alibaba Cloud to see the search results.

    image

OpenCode

  1. In the OpenCode configuration file ~/.config/opencode/opencode.json, add the MCP configuration information. Replace YOUR_API_KEY with the API key that you obtained in the previous step.

    {
      "mcp": {
        "WebSearch": {
          "type": "remote",
          "url": "https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_API_KEY"
          }
        }
      }
    }

    If the opencode.json file already contains other configurations, such as provider, merge the mcp field into the existing configuration. After the configuration is complete, save the file.

  2. Run the following command in the terminal to start OpenCode.

    opencode
  3. In the dialog box, run /mcps to confirm that the status of websearch is Enabled. After you confirm the status, press Esc to exit.

    image

  4. Send the prompt Use the websearch MCP to search for news about Alibaba Cloud to see the search results.

    Mention the websearch MCP explicitly to avoid confusion with other tools.

    image

Claude Code

  1. Add the web search MCP service.

    1. Copy the following command to the terminal:

      claude mcp add WebSearch https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp -t http -H "Authorization: Bearer YOUR_API_KEY"
    2. Replace YOUR_API_KEY in the command with the Alibaba Cloud Model Studio API key that you obtained when you enabled or upgraded the web search MCP.

    3. Run the updated command in the terminal.

      Note

      The terminal returns Added HTTP MCP server WebSearch with URL: ... to local config. Confirm the connection status in the next steps.

  2. Run the following command in the terminal to start Claude Code.

    claude
  3. In the dialog box, run the /mcp command and confirm that websearch status is connected. Wait for the status to change from connecting to connected.

    image

    If the connection status is failed, select the MCP and choose Reconnect. If the connection fails after retrying, check your configuration.

    image

  4. Press Esc to exit the MCP list, then send the prompt Use the websearch MCP to search for news about Alibaba Cloud to see the search results.

    Mention the websearch MCP explicitly to avoid confusion with other tools.

    image

Qwen Code

  1. Add the web search MCP.

    1. Copy the following command to the terminal.

      qwen mcp add WebSearch \
        -t http \
        "https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp" \
        -H "Authorization: Bearer YOUR_API_KEY"
    2. Replace YOUR_API_KEY in the command with the Alibaba Cloud Model Studio API key that you obtained when you enabled or upgraded the web search MCP.

    3. Run the updated command in the terminal.

      Note

      The terminal returns MCP server "WebSearch" added to user settings. (http). Confirm the connection status in the next steps.

  2. Run the following command in the terminal to start Qwen Code.

    qwen
  3. In the Qwen Code dialog box, run the /mcp command to confirm the MCP connection status.

    image

  4. Send the prompt Use the websearch MCP to search for news about Alibaba Cloud to see the search results.

    Mention the websearch MCP explicitly to avoid confusion with other tools.

    image

Kilo CLI

  1. In the ~/.config/kilo/opencode.json configuration file, add the MCP configuration information. Replace YOUR_API_KEY with the API key that you obtained in the previous step. After the configuration is complete, save the file.

    {
      "mcp": {
        "websearch": {
          "type": "remote",
          "url": "https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_API_KEY"
          }
        }
      }
    }

    If the opencode.json file already contains other configurations, such as provider, merge the mcp field into the existing configuration. After the configuration is complete, save the file.

  2. Run the following command in the terminal to view the MCP status. A Connected status indicates a successful connection.

    kilocode mcp list

    image

  3. Run the following command in the terminal to start Kilo CLI.

    kilo
  4. Send the prompt Use the websearch MCP to search for news about Alibaba Cloud to see the search results.

    Mention the websearch MCP explicitly to avoid confusion with other tools.

    image

Kilo Code IDE plugin

  1. Open the Kilo Code IDE plugin to configure the web search MCP information. Replace YOUR_API_KEY with the API key that you obtained in the previous step. After the configuration is complete, save the file.

    image

    {
      "mcpServers": {
        "websearch": {
          "type": "streamable-http",
          "url": "https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp",
          "headers": {
            "Authorization": "Bearer YOUR_API_KEY"
          }
        }
      }
    }

    When the status of the web search MCP turns green, the service is added successfully.

    image

  2. Return to the conversation interface and send the prompt Use the websearch MCP to search for news about Alibaba Cloud to see the search results.

    Mention the websearch MCP explicitly to avoid confusion with other tools.

    image

FAQ

What do I do if I cannot connect to the web search MCP service?

Common causes and troubleshooting methods:

  1. Web search MCP service not enabled or upgraded: Confirm that you have enabled or upgraded the web search MCP service in the Model Studio MCP Marketplace. See Enable or upgrade web search MCP.

  2. Incorrect Streamable HTTP endpoint address:

    • Check whether the URL is spelled correctly. The complete URL is https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp.

    • If you are using the URL https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/sse, it means you have enabled the legacy SSE protocol. Upgrade the protocol to Streamable HTTP.

  3. Incorrect API key: Confirm that you're using a valid general-purpose Model Studio API key (format: sk-xxx, not the Coding Plan-specific API key) and have correctly replaced YOUR_API_KEY in the command.

  4. Free quota exhausted: The web search MCP offers a free quota of 2,000 calls for all users. After the free quota is used up, the service is billed at CNY 29 per 1,000 calls. Make sure your account balance is sufficient.

  5. Network connection failure: Confirm that your current network has access.

What do I do if the model doesn't call web search during a conversation?

  1. Make sure the web search MCP service is connected and available.

  2. Mention the tool name explicitly in the conversation, for example: Use the websearch MCP to search for news about Alibaba Cloud.