这是一个通过百度提供网络搜索能力的模型上下文协议(MCP)服务器,并具有内容抓取和解析的额外功能。
<a href="https://glama.ai/mcp/servers/@Evilran/baidu-mcp-server"> <img width="380" height="200" src="https://gips3.baidu.com/it/u=4162995105,494788043&fm=3081&app=3081&f=PNG?w=760&h=400" alt="百度服务器MCP服务器" /> </a>要通过Smithery自动安装百度搜索服务器到Claude Desktop:
npx -y @smithery/cli install @Evilran/baidu-mcp-server --client claude
uv安装直接从PyPI使用uv安装:
uv pip install baidu-mcp-server
~/Library/Application Support/Claude/claude_desktop_config.json添加以下配置:
{
"mcpServers": {
"baidu-search": {
"command": "uvx",
"args": ["baidu-mcp-server"]
}
}
}
对于本地开发,你可以使用MCP CLI:
# 使用MCP Inspector运行
mcp dev server.py
# 为测试安装到本地Claude Desktop
mcp install server.py
async def search(query: str, max_results: int = 10) -> str
在百度上执行网络搜索并返回格式化的结果。
参数:
query:搜索查询字符串max_results:返回的最大结果数(默认:10)返回值: 包含搜索结果标题、URL和摘要的格式化字符串。
async def fetch_content(url: str) -> str
抓取并解析网页内容。
参数:
url:要抓取内容的网页URL返回值: 来自网页的清理和格式化文本内容。
欢迎提出问题和拉取请求!一些潜在改进领域:
本项目采用MIT许可证。
本项目中的代码参考了以下仓库:
感谢这些仓库的作者和贡献者对开源社区的努力和贡献。