Web Search MCP Server logo

Web Search MCP Server

by m-mcp

This is a web search server implemented based on the Model Context Protocol (MCP), providing a tool interface for web search functionality. It utilizes the search API from Zhipu AI.

View on GitHub

Last updated: N/A

What is Web Search MCP Server?

The Web Search MCP Server offers a web search tool that leverages the Zhipu AI search API to provide asynchronous search functionality. It provides error handling, result parsing, and utilizes environment variables for API key configuration, supporting standard input/output (stdio) as a transport method.

How to use Web Search MCP Server?

  1. Ensure Python 3.10 or higher is installed.
  2. Configure the environment variable BIGMODEL_API_KEY in the .env file.
  3. Install dependencies using a package manager, referencing the dependencies listed in pyproject.toml.
  4. Run the server using uv run main.py.

Key features of Web Search MCP Server

  • Asynchronous web search interface

  • Error handling and result parsing

  • API key configuration via environment variables

  • Standard input/output (stdio) support

Use cases of Web Search MCP Server

  • Integrating web search into MCP-based applications

  • Providing a search tool within a conversational AI agent

  • Augmenting knowledge retrieval processes with external web sources

  • Developing a server for web search in other application

FAQ from Web Search MCP Server

API 密钥问题: 检查 .env 文件丢失或者BIGMODEL_API_KEY 是否正确设置?

请确认 .env 文件是否存在并正确设置,并且环境变量是否正确加载。

网络请求问题: 检查网络连接是否正常?,验证 API 请求 URL 是否正确?

验证 API 请求 URL 是否正确,查看请求头和参数格式

结果解析问题: 检查 API 响应格式是否符合预期?

验证 JSON 解析是否正确, 确认结果提取逻辑是否正确

如何处理API调用错误?

检查 response 中的 error 字段.

如何处理网络错误?

使用 try-except 捕获 httpx 异常.