Baidu Search MCP server

Provides web search capabilities through Baidu's search engine, enabling retrieval of search results and webpage content with robust error handling and content parsing.
Back to servers
Provider
Evilran
Release date
Apr 01, 2025
Language
Python
Package
Stats
3.0K downloads
6 stars

Baidu Search MCP Server provides web search capabilities through Baidu, with additional features for content fetching and intelligent text extraction. It's designed to format search results specifically for large language model consumption while handling rate limiting and error processing automatically.

Installation Options

Installing via Smithery

To install the Baidu Search Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @Evilran/baidu-mcp-server --client claude

Installing via uv

Install directly from PyPI using uv:

uv pip install baidu-mcp-server

Setting Up with Claude Desktop

  1. Download Claude Desktop

  2. Create or edit your Claude Desktop configuration file:

    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%\Claude\claude_desktop_config.json
  3. Add the following configuration to your file:

{
    "mcpServers": {
        "baidu-search": {
            "command": "uvx",
            "args": ["baidu-mcp-server"]
        }
    }
}
  1. Restart Claude Desktop to apply the changes

Available Tools

Search Tool

The search tool allows you to perform web searches through the Baidu search engine:

async def search(query: str, max_results: int = 10) -> str

Parameters:

  • query: The search query string
  • max_results: Maximum number of results to return (default: 10)

Returns: A formatted string containing search results with titles, URLs, and snippets.

Content Fetching Tool

The content fetching tool retrieves and parses webpage content:

async def fetch_content(url: str) -> str

Parameters:

  • url: The webpage URL to fetch content from

Returns: Cleaned and formatted text content from the webpage.

Advanced Features

Rate Limiting Protection

The server includes built-in rate limiting protection:

  • Search requests are limited to 30 per minute
  • Content fetching is limited to 20 requests per minute
  • The system handles queue management and wait times automatically

Result Processing

The server performs several optimizations on search results:

  • Removes advertisements and irrelevant content
  • Cleans up Baidu redirect URLs
  • Formats results specifically for LLM consumption
  • Truncates long content appropriately

Error Handling

The server includes comprehensive error handling:

  • Catches and reports errors in a structured way
  • Provides detailed logging through MCP context
  • Maintains graceful degradation when rate limits are reached or timeouts occur

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later