Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

baidu-mcp-server

MCP.Pizza Chef: Evilran

The Baidu MCP Server is a Model Context Protocol server that provides robust web search capabilities through Baidu. It features advanced rate limiting, intelligent content fetching and parsing, comprehensive error handling, and outputs results optimized for large language model consumption. This server enables seamless integration of Baidu search data into AI workflows with reliable performance and structured data formatting.

Use This MCP server To

Perform web searches using Baidu with structured result output Fetch and parse webpage content intelligently for LLM use Integrate Baidu search results into AI-driven applications Handle rate limits automatically during high-volume searches Log and manage errors during web search and content retrieval

README

Baidu Search MCP Server

smithery badge

A Model Context Protocol (MCP) server that provides web search capabilities through Baidu, with additional features for content fetching and parsing.

Baidu Server MCP server

Features

  • Web Search: Search Baidu with advanced rate limiting and result formatting
  • Content Fetching: Retrieve and parse webpage content with intelligent text extraction
  • Rate Limiting: Built-in protection against rate limits for both search and content fetching
  • Error Handling: Comprehensive error handling and logging
  • LLM-Friendly Output: Results formatted specifically for large language model consumption

Installation

Installing via Smithery

To install 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

Usage

Running with Claude Desktop

  1. Download Claude Desktop
  2. Create or edit your Claude Desktop configuration:
    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the following configuration:

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

Development

For local development, you can use the MCP CLI:

# Run with the MCP Inspector
mcp dev server.py

# Install locally for testing with Claude Desktop
mcp install server.py

Available Tools

1. Search Tool

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

Performs a web search on Baidu and returns formatted results.

Parameters:

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

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

2. Content Fetching Tool

async def fetch_content(url: str) -> str

Fetches and parses content from a webpage.

Parameters:

  • url: The webpage URL to fetch content from

Returns: Cleaned and formatted text content from the webpage.

Features in Detail

Rate Limiting

  • Search: Limited to 30 requests per minute
  • Content Fetching: Limited to 20 requests per minute
  • Automatic queue management and wait times

Result Processing

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

Error Handling

  • Comprehensive error catching and reporting
  • Detailed logging through MCP context
  • Graceful degradation on rate limits or timeouts

Contributing

Issues and pull requests are welcome! Some areas for potential improvement:

  • Additional search parameters (region, language, etc.)
  • Enhanced content parsing options
  • Caching layer for frequently accessed content
  • Additional rate limiting strategies

License

This project is licensed under the MIT License.

Acknowledgments

The code in this project references the following repositories:

Thanks to the authors and contributors of these repositories for their efforts and contributions to the open-source community.

baidu-mcp-server FAQ

How does the Baidu MCP Server handle rate limiting?
It includes built-in rate limiting to prevent exceeding Baidu's search and content fetching limits, ensuring stable operation.
Can the Baidu MCP Server parse webpage content?
Yes, it intelligently fetches and extracts text content from webpages for easy consumption by large language models.
Is the output from Baidu MCP Server optimized for LLMs?
Yes, the server formats search results and content specifically to be LLM-friendly for seamless integration.
What error handling features does the Baidu MCP Server provide?
It offers comprehensive error handling and logging to maintain reliability during searches and content retrieval.
How do I install the Baidu MCP Server?
Installation can be done via Smithery, following the provided instructions in the GitHub repository.
Can the Baidu MCP Server be used in multi-step AI workflows?
Yes, its structured output and error management make it suitable for complex AI-driven processes.
Does the Baidu MCP Server support other LLM providers?
While it is LLM-agnostic, it is designed to work well with providers like OpenAI, Anthropic Claude, and Google Gemini.