Baidu Search MCP Server
百度搜索MCP服务器
模型上下文协议 (MCP) 服务器通过百度提供网络搜索功能,并具有内容获取和解析的附加功能。
特征
网络搜索:使用高级速率限制和结果格式搜索百度
内容获取:通过智能文本提取检索和解析网页内容
速率限制:内置针对搜索和内容获取速率限制的保护
错误处理:全面的错误处理和日志记录
LLM 友好输出:专为大型语言模型使用而格式化的结果
Related MCP server: DuckDuckGo MCP Server
安装
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装百度搜索服务器:
npx -y @smithery/cli install @Evilran/baidu-mcp-server --client claude通过uv安装
使用uv直接从 PyPI 安装:
uv pip install baidu-mcp-server用法
使用 Claude Desktop 运行
下载Claude桌面
创建或编辑您的 Claude Desktop 配置:
在 macOS 上:
~/Library/Application Support/Claude/claude_desktop_config.json在 Windows 上:
%APPDATA%\Claude\claude_desktop_config.json
添加以下配置:
{
"mcpServers": {
"baidu-search": {
"command": "uvx",
"args": ["baidu-mcp-server"]
}
}
}重启Claude桌面
发展
对于本地开发,您可以使用 MCP CLI:
# Run with the MCP Inspector
mcp dev server.py
# Install locally for testing with Claude Desktop
mcp install server.py可用工具
1. 搜索工具
async def search(query: str, max_results: int = 10) -> str在百度上执行网络搜索并返回格式化的结果。
参数:
query:搜索查询字符串max_results:返回的最大结果数(默认值:10)
**返回:**包含带有标题、URL 和片段的搜索结果的格式化字符串。
2.内容获取工具
async def fetch_content(url: str) -> str从网页获取并解析内容。
参数:
url:获取内容的网页 URL
**返回:**网页中清理并格式化的文本内容。
详细功能
速率限制
搜索:每分钟限制 30 个请求
内容获取:每分钟限制 20 个请求
自动队列管理和等待时间
结果处理
删除广告和不相关的内容
清理百度重定向 URL
格式化结果以实现最佳的 LLM 消耗
适当截断长内容
错误处理
全面的错误捕获和报告
通过 MCP 上下文进行详细日志记录
速率限制或超时的优雅降级
贡献
欢迎提交问题和拉取请求!以下是一些有待改进的地方:
附加搜索参数(地区、语言等)
增强的内容解析选项
频繁访问内容的缓存层
额外的速率限制策略
执照
该项目已获得 MIT 许可。
致谢
本项目中的代码引用了以下存储库:
感谢这些存储库的作者和贡献者为开源社区所做的努力和贡献。
Available Tools
1 toolsearchC
Search Baidu and return formatted results.
Args:
query: The search query string
max_results: Maximum number of results to return (default: 6)
deep_mode: Deep search the web content (default: False)
ctx: MCP context for logging
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| max_results | No | ||
| deep_mode | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description does not disclose behavioral traits such as authentication requirements, rate limits, pagination behavior, or the nature of 'deep_mode.' With no annotations, the description carries full burden but fails to provide sufficient context beyond the basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short but poorly structured. It includes unnecessary notation like 'Args:' and references a 'ctx' parameter not in the schema, which is misleading. It mixes parameter docs with the main description, reducing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has three parameters, no output schema, and no annotations, the description is incomplete. It fails to explain output format, error handling, or advanced usage. A search tool typically requires more documentation to be used correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The parameter descriptions in 'Args' merely restate the schema field names and defaults (e.g., 'query: The search query string') without adding meaningful semantics. 'Deep search the web content' is vague. Schema coverage is 0%, and the description adds only trivial value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states 'Search Baidu and return formatted results,' which clearly identifies the tool's action (search) and resource (Baidu), and implies output formatting. No sibling tools exist, so differentiation is not needed. However, it could be more specific about the result format (e.g., titles, URLs, snippets).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool or its limitations. For a search tool, one would expect notes on query syntax, rate limits, or alternatives, but none are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.0.0- First observed
search
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion between different operations. The tool's purpose is clear and distinct.
The single tool is consistently named 'search', following a verb-only pattern that matches its action. There is no inconsistency.
A single tool for a search server is functional but minimal. It falls into the borderline category where the tool count feels thin for a typical API surface.
The search tool includes essential parameters like query, max_results, and deep_mode. However, it lacks other common search features like image or news search, leaving minor gaps.
Maintenance
Related MCP Connectors
Web search, page extraction, visual tools and developer utilities through Baizhi Cloud.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Web search, fetch, extract, and research for AI agents. Markdown output + AI-synthesized answers.
Web search, browser automation, scraping, crawling and CAPTCHA solving for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to perform intelligent web searches using the Baidu Wenxin API, supporting multiple models, search modes, and providing search results with reference sources.21 npm6MIT
- AlicenseBqualityCmaintenanceEnables web search through DuckDuckGo and webpage content fetching with intelligent text extraction. Features built-in rate limiting and LLM-optimized result formatting for seamless integration with language models.2MIT
- FlicenseAqualityDmaintenanceProvides web search capabilities across multiple engines and webpage content fetching to simplified Markdown. It enables AI assistants to access real-time internet information and extract text from specific URLs.213-
- FlicenseNot gradedqualityDmaintenanceWraps the Kimi Coding Search and Fetch APIs into MCP tools for web searching and content retrieval. It enables LLMs to perform targeted searches and crawl web pages using standardized interfaces.1-