Content
# Dianping MCP Server
Dianping MCP Server is a Chinese Model Context Protocol server example for Dianping local service search and AI agent tool calling.
中文:Dianping MCP Server 是一个大众点评 MCP Server 示例,用于演示 Model Context Protocol、AI Agent 工具调用和中文本地生活服务搜索集成。
## Features
- MCP stdio server built with Python and FastMCP.
- Dianping category ranking tool for city, category, region, and sort queries.
- Dianping shop detail tool for shop profile, rating, address, price, and recommended dishes.
- Playwright-based browser session reuse through `auth.json`.
## Quickstart
```bash
python -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
playwright install chromium
python get_auth.py
python server.py
```
On Windows PowerShell, activate the virtual environment with:
```powershell
.\.venv\Scripts\Activate.ps1
```
`get_auth.py` is used to create `auth.json` for an authenticated Dianping browser session. Keep `auth.json` private and do not commit it.
## MCP Client Configuration
Claude Desktop, Cursor, VS Code, and other MCP clients can launch this server over stdio.
```json
{
"mcpServers": {
"dianping": {
"command": "python",
"args": ["server.py"],
"cwd": "/absolute/path/to/mcp-dianping"
}
}
}
```
## Tools
- `dianping_category_rank`: search Dianping category rankings by city, category, region, and sort mode.
- `dianping_shop_detail`: fetch detail information for a Dianping shop by `shop_id`.
## Use Cases
- Chinese local service search for AI agents.
- MCP tool-calling examples for restaurant, leisure, hotel, and lifestyle queries.
- Agent workflows that need structured local business information from Dianping.
## Notes
- This project requires a valid Dianping browser login session saved as `auth.json`.
- Website layout changes can break selectors; inspect and update `server.py` if parsing stops working.
- Respect Dianping terms and use reasonable request volume when testing.
If this project helps you build AI voice agents, consider starring the repo.
如果这个项目帮你跑通了 AI 语音 Agent,欢迎 Star,也欢迎提交 Issue 交流复现问题。